-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard.html
76 lines (69 loc) · 1.76 KB
/
card.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,500" rel="stylesheet" type="text/css">
<style>
body {
margin: 0;
cursor: pointer;
}
.filler {
position: absolute;
width: 100vw;
height: 100vh;
}
.bg {
width: 98%;
height: 98%;
margin: auto;
overflow: hidden;
background-color: #fff;
border-radius: 5px;
background-size: contain;
background-image: url(https://literasee.io/public/img/thumb.svg);
background-position: center;
background-repeat: no-repeat;
font-family: Roboto, Helvetica, Arial, sans-serif;
font-weight: 300;
box-shadow: 0 3px 5px 0 rgba(0,0,0,0.2);
}
h1 {
margin: 1rem;
font-weight: 500;
}
.desc {
margin: 1rem;
}
</style>
</head>
<body onclick="goToRepo()">
<div class="filler">
<div class="bg">
<h1></h1>
<div class="desc"></div>
</div>
</div>
<script>
function parseQueryString (str) {
str = str || window.location.search;
if (str.substr(0, 1) === '?') str = str.substr(1);
if (!str) return {};
return str.split('&').reduce(function (prev, pair) {
prev[pair.split('=')[0]] = pair.split('=')[1];
return prev;
}, {});
}
var c = parseQueryString();
document.querySelector('h1').innerHTML = decodeURI(c.title) || 'Add a title';
document.querySelector('.desc').innerHTML = c.desc ? decodeURI(c.desc) : 'Add a description';
if (c.img) {
document.querySelector('.bg').style.backgroundImage = 'url(' + c.img + ')';
}
function goToRepo () {
window.open(c.link);
}
</script>
</body>
</html>