forked from arcanis/secretsanta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpairing.html
executable file
·180 lines (126 loc) · 4.72 KB
/
pairing.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Secret Santa Pairing</title>
<script src="vendors/Lodash-3.10.1.js"></script>
<script src="vendors/Cryptojs.aes-3.1.2.js"></script>
<style>
* {
box-sizing: border-box;
}
html, body, .main {
margin: 0;
width: 100%;
height: 100%;
padding: 0;
}
body {
background: url(./assets/snow.png), url(./assets/santa.png), url(./assets/snow.png), radial-gradient(#FB3B3B, #EF3D3D);
background-repeat: repeat, no-repeat, repeat, no-repeat;
animation-name: snow;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-timing-function: linear;
font-family: 'Comic Sans MS';
}
@keyframes snow {
from { background-position: 130px 40px, bottom right, 0 0, 0 0; }
to { background-position: 130px 640px, bottom right, 0 300px, 0 0; }
}
.spirit-of-christmas {
display: block;
position: absolute;
bottom: 0;
left: 0;
padding: 20px;
font-size: 10px;
text-decoration: none;
color: #FFFFFF;
}
.main {
display: flex;
}
.background {
position: absolute;
left: 0;
bottom: 0;
}
.wrapper {
margin: auto;
padding: 20px;
background: repeating-linear-gradient(
45deg,
#5CC48A,
#5CC48A 30px,
#FFFFFF 30px,
#FFFFFF 60px,
#EF3D3D 60px,
#EF3D3D 90px,
#FFFFFF 90px,
#FFFFFF 120px
);
box-shadow: 3px 3px 10px rgba(0, 0, 0, .5);
}
.content {
padding: 40px;
background: #ffffff;
text-align: center;
}
.title {
font-size: 30px;
}
#pairing-name {
font-size: 90px;
}
#pairing-details {
margin-bottom: 20px;
font-size: 20px;
}
.affiliate {
display: block;
box-sizing: content-box;
margin-top: 40px;
border: none;
background: rgba(255, 255, 255, .7);
}
.affiliate + .affiliate {
margin-top: 40px;
}
</style>
<script>
var queryString = _.chain( location.search.slice( 1 ).split( /&/g ) )
.map( function ( item ) { if ( item ) return item.split( /=/ ).map( function ( str ) { return decodeURIComponent( str ); } ); } )
.compact().object().value();
var name = queryString.name;
var pairing = CryptoJS.AES.decrypt( queryString.pairing, queryString.key ).toString(CryptoJS.enc.Utf8);
var pairingDefinition = pairing.match( /^([^(]+)(?: (\([^)]+\)))?$/ );
</script>
</head>
<body>
<div class="main">
<div class="wrapper">
<div class="content">
<div class="title">Hi <span id="name"></span>! You've been paired with</div>
<script>document.getElementById('name').innerText = name</script>
<div class="pairing">
<div id="pairing-name"></div>
<div id="pairing-details"></div>
<script>
document.getElementById('pairing-name').innerText = pairingDefinition[1];
if (pairingDefinition[2]) {
document.getElementById('pairing-details').innerText = pairingDefinition[2];
} else {
document.getElementById('pairing-details').style.display = 'none';
}
</script>
</div>
<div class="title">Good luck!</div>
</div>
</div>
<a href="http://arcanis.github.io/secretsanta/" class="spirit-of-christmas">
Want to start your own Secret Santa with your friends? Click here to get started!
</a>
</div>
</body>
</html>