-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
269 lines (245 loc) · 14.2 KB
/
index.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!doctype html>
<html lang="no">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ann Harriet 60 år!</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css" integrity="sha256-oSrCnRYXvHG31SBifqP2PM1uje7SJUyX0nTwO2RJV54=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.css" integrity="sha256-iK7AZM7Xa42iuURdMdo1sp38ld/JJ3fDtS0523GKqdk=" crossorigin="anonymous" />
<link rel="stylesheet" href="/style.css" />
</head>
</head>
<body>
<header>
<a class="home" href="/"><h1>Ann Harriet 60 🎉</h1></a>
</header>
<canvas id="canvas"></canvas>
<main>
<h2 class="heading"><a class="link tablemargin" href="/sangtekster">Sangtekster</a></h2>
</main>
<div style="width: auto;"class="ui fluid search selection dropdown">
<input type="hidden" name="person">
<i class="dropdown icon"></i>
<div class="default text">Finn plassen din</div>
<div class="menu">
<div class="item" data-value="Jubilanten"><img class="ui mini avatar image" src="/img/ann.jpg">Jubilanten</div>
<div class="item" data-value="Ada"><img class="ui mini avatar image" src="/img/ada.jpg">Ada</div>
<div class="item" data-value="Anders"><img class="ui mini avatar image" src="/img/anders.jpg">Anders</div>
<div class="item" data-value="Anne Cecilie"><img class="ui mini avatar image" src="/img/anne.jpg">Anne Cecilie</div>
<div class="item" data-value="Anne-Dorthe"><img class="ui mini avatar image" src="/img/anne-dorthe.png">Anne-Dorthe</div>
<div class="item" data-value="Astrid"><img class="ui mini avatar image" src="/img/astrid.png">Astrid</div>
<div class="item" data-value="Birger"><img class="ui mini avatar image" src="/img/birger.png">Birger</div>
<div class="item" data-value="Bodil"><img class="ui mini avatar image" src="/img/bodil.png">Bodil</div>
<div class="item" data-value="Charlotte"><img class="ui mini avatar image" src="/img/charlotte.png">Charlotte</div>
<div class="item" data-value="Dag-Harald"><img class="ui mini avatar image" src="/img/dag.png">Dag-Harald</div>
<div class="item" data-value="Daniel H"><img class="ui mini avatar image" src="/img/danielh.png">Daniel H</div>
<div class="item" data-value="Daniel S"><img class="ui mini avatar image" src="/img/daniels.jpg">Daniel S</div>
<div class="item" data-value="Emily"><img class="ui mini avatar image" src="/img/emily.png">Emily</div>
<div class="item" data-value="Geir"><img class="ui mini avatar image" src="/img/geir.png">Geir</div>
<div class="item" data-value="Grete"><img class="ui mini avatar image" src="/img/grete.jpg">Grete</div>
<div class="item" data-value="Hanne-Marthe"><img class="ui mini avatar image" src="/img/hanne-marthe.png">Hanne-Marthe</div>
<div class="item" data-value="Hans Christian"><img class="ui mini avatar image" src="/img/hanschristian.jpg">Hans Christian</div>
<div class="item" data-value="Håvard"><img class="ui mini avatar image" src="/img/haavard.jpg">Håvard</div>
<div class="item" data-value="Hege"><img class="ui mini avatar image" src="/img/hege.png">Hege</div>
<div class="item" data-value="Inger"><img class="ui mini avatar image" src="/img/inger.png">Inger</div>
<div class="item" data-value="Iva"><img class="ui mini avatar image" src="/img/iva.jpg">Iva</div>
<div class="item" data-value="Jørgen"><img class="ui mini avatar image" src="/img/jorgen.jpg">Jørgen</div>
<div class="item" data-value="Kristian"><img class="ui mini avatar image" src="/img/kristian.jpg">Kristian</div>
<div class="item" data-value="Maria og Sophia"><img class="ui mini avatar image" src="/img/maria.jpg">Maria og Sophia</div>
<div class="item" data-value="Marit K"><img class="ui mini avatar image" src="/img/maritk.jpg">Marit K</div>
<div class="item" data-value="Marit N"><img class="ui mini avatar image" src="/img/maritn.jpg">Marit N</div>
<div class="item" data-value="Marte"><img class="ui mini avatar image" src="/img/marte.jpg">Marte</div>
<div class="item" data-value="Nina"><img class="ui mini avatar image" src="/img/nina.png">Nina</div>
<div class="item" data-value="Sonja"><img class="ui mini avatar image" src="/img/sonja.png">Sonja</div>
<div class="item" data-value="Synnøve"><img class="ui mini avatar image" src="/img/synnove.png">Synnøve</div>
<div class="item" data-value="Tone Mette"><img class="ui mini avatar image" src="/img/tonemette.png">Tone Mette</div>
<div class="item" data-value="Tone"><img class="ui mini avatar image" src="/img/tone.jpg">Tone</div>
<div class="item" data-value="Trine"><img class="ui mini avatar image" src="/img/trine.jpg">Trine</div>
<div class="item" data-value="Party"><img class="ui mini avatar image" src="/img/partyhat.svg">Party</div>
</div>
</div>
<div class="groups">
<div class="group">
<div class="row">
<div class="person" data-content="Kristian" style="background: url('img/kristian.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Daniel H" style="background: url('img/danielh.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Hanne-Marthe" style="background: url('img/hanne-marthe.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Hans Christian" style="background: url('img/hanschristian.jpg') 0% 0% / 60px border-box"></div>
</div>
<div class="table-row no-table-end">
<div class="table"><span class="table-number">USA</span></div>
</div>
<div class="row">
<div class="person" data-content="Synnøve" style="background: url('img/synnove.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Nina" style="background: url('img/nina.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Daniel S" style="background: url('img/daniels.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Charlotte" style="background: url('img/charlotte.png') 0% 0% / 60px border-box"></div>
</div>
</div>
<div class="group">
<div class="row">
<div class="person" data-content="Tone" style="background: url('img/tone.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Emily" style="background: url('img/emily.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Tone Mette" style="background: url('img/tonemette.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Anne-Dorthe" style="background: url('img/anne-dorthe.png') 0% 0% / 60px border-box"></div>
</div>
<div class="table-row">
<div class="person" data-content="Trine" style="background: url('img/trine.jpg') 0% 0% / 60px border-box"></div>
<div class="table"><span class="table-number">Nittedal</span></div>
</div>
<div class="row">
<div class="person" data-content="Hege" style="background: url('img/hege.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Iva" style="background: url('img/iva.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Bodil" style="background: url('img/bodil.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Marit N" style="background: url('img/maritn.jpg') 0% 0% / 60px border-box"></div>
</div>
</div>
<div class="group">
<div class="row">
<div class="person" data-content="Geir" style="background: url('img/geir.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Birger" style="background: url('img/birger.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Jørgen" style="background: url('img/jorgen.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Maria og Sophia" style="background: url('img/maria.jpg') 0% 0% / 60px border-box"></div>
</div>
<div class="table-row">
<div class="person" data-content="Jubilanten" style="background: url('img/ann.jpg') 0% 0% / 60px border-box"></div>
<div class="table"><span class="table-number">Harstad</span></div>
</div>
<div class="row">
<div class="person" data-content="Ada" style="background: url('img/ada.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Dag-Harald" style="background: url('img/dag.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Anders" style="background: url('img/anders.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Marte" style="background: url('img/marte.jpg') 0% 0% / 60px border-box"></div>
</div>
</div>
<div class="group">
<div class="row">
<div class="person" data-content="Inger" style="background: url('img/inger.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Sonja" style="background: url('img/sonja.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Grete" style="background: url('img/grete.jpg') 0% 0% / 60px border-box"></div>
</div>
<div class="table-row no-table-end">
<div class="table"><span class="table-number">Tromsø</span></div>
</div>
<div class="row">
<div class="person" data-content="Håvard" style="background: url('img/haavard.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Anne Cecilie" style="background: url('img/anne.jpg') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Astrid" style="background: url('img/astrid.png') 0% 0% / 60px border-box"></div>
<div class="person" data-content="Marit K" style="background: url('img/maritk.jpg') 0% 0% / 60px border-box"></div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha256-/SIrNqv8h6QGKDuNoLGA4iret+kyesCkHGzVUUV0shc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.js" integrity="sha256-HcON65l89nxNl7vaRECVPe/zNDBzhCcJYBE7O+EcruU=" crossorigin="anonymous"></script>
<script>
let partymode = false;
$('.ui.dropdown').dropdown({
action: 'activate',
onChange: function(value, text, $selectedItem) {
if(value === 'Party') {
partymode = !partymode;
// Initialize
canvas.width = W;
canvas.height = H;
Draw(partymode);
$('.person').addClass('hat');
} else {
$('.person').removeClass('hat');
$('.person[data-content="' + value +'"]').addClass('hat');
document.querySelector('.person[data-content="' + value +'"]')
.parentElement.parentElement
.scrollIntoView({block: "start", behavior: "smooth"} );
}
}
});
$('.person').popup({
boundary: '.groups'
});
let W = window.innerWidth;
let H = window.innerHeight;
const canvas = document.getElementById("canvas");
const context = canvas.getContext("2d");
const maxConfettis = 100;
const particles = [];
const possibleColors = [
"DodgerBlue",
"OliveDrab",
"Gold",
"Pink",
"SlateBlue",
"LightBlue",
"Gold",
"Violet",
"PaleGreen",
"SteelBlue",
"SandyBrown",
"Chocolate",
"Crimson"
];
function randomFromTo(from, to) {
return Math.floor(Math.random() * (to - from + 1) + from);
}
function confettiParticle() {
this.x = Math.random() * W; // x
this.y = Math.random() * H - H; // y
this.r = randomFromTo(11, 33); // radius
this.d = Math.random() * maxConfettis + 11;
this.color =
possibleColors[Math.floor(Math.random() * possibleColors.length)];
this.tilt = Math.floor(Math.random() * 33) - 11;
this.tiltAngleIncremental = Math.random() * 0.07 + 0.05;
this.tiltAngle = 0;
this.draw = function() {
context.beginPath();
context.lineWidth = this.r / 2;
context.strokeStyle = this.color;
context.moveTo(this.x + this.tilt + this.r / 3, this.y);
context.lineTo(this.x + this.tilt, this.y + this.tilt + this.r / 5);
return context.stroke();
};
}
function Draw(more) {
const results = [];
// Magical recursive functional love
requestAnimationFrame(Draw);
context.clearRect(0, 0, W, window.innerHeight);
for (var i = 0; i < maxConfettis; i++) {
if(more) {
results.push(particles[i].draw());
}
}
let particle = {};
let remainingFlakes = 0;
for (var i = 0; i < maxConfettis; i++) {
particle = particles[i];
particle.tiltAngle += particle.tiltAngleIncremental;
particle.y += (Math.cos(particle.d) + 3 + particle.r / 2) / 2;
particle.tilt = Math.sin(particle.tiltAngle - i / 3) * 15;
if (particle.y <= H) remainingFlakes++;
// If a confetti has fluttered out of view,
// bring it back to above the viewport and let if re-fall.
if (particle.x > W + 30 || particle.x < -30 || particle.y > H) {
particle.x = Math.random() * W;
particle.y = -30;
particle.tilt = Math.floor(Math.random() * 10) - 20;
}
}
return results;
}
window.addEventListener(
"resize",
function() {
W = window.innerWidth;
H = window.innerHeight;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
},
false
);
// Push new confetti objects to `particles[]`
for (var i = 0; i < maxConfettis; i++) {
particles.push(new confettiParticle());
}
</script>
</body>
</html>