-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
495 lines (439 loc) · 15.2 KB
/
script.js
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
// tableaux données élèves
const students = [
{
name: "Thomas Nigon",
quote: "« If it bleeds, we can kill it. »",
linkedin: "https://www.linkedin.com/in/thomas-nigon/",
github: "https://github.com/Thomas-Nigon",
picture: "assets/photos/blue/thomas.jpg",
deco: "assets/logos/Agile.png",
crew: "blue",
},
{
name: "Marie Saillard",
quote: "« Ce qui ne nous tue pas nous rend plus fort. »",
linkedin: "https://www.linkedin.com/in/marie-saillard-014276106/",
github: "https://github.com/Marie-Sail",
picture: "assets/photos/blue/Marie.jpg",
deco: "assets/logos/logoGit.png",
crew: "blue",
},
{
name: "Robin Fantino",
quote: "« Viens, on va prendre une frite. »",
linkedin: "http://www.linkedin.com/in/robin-fantino-b351b625b",
github: "https://github.com/NemoOnTheNet",
picture: "assets/photos/blue/Robin.jpg",
deco: "assets/logos/Logo-JS.png",
crew: "blue",
},
{
name: "Hélène Rampelberg",
quote: "« Don't worry, be happy! »",
linkedin: "http://www.linkedin.com/",
github: "https://github.com/HeleneRamp",
picture: "assets/photos/blue/helene.jpg",
deco: "assets/logos/logosHtmlCSS.png",
crew: "blue",
},
{
name: "Vincent Rousseaux",
quote:
"« Mistakes are a fact of life. It is the response to the error that counts. »",
linkedin: "https://www.linkedin.com/in/vincent-rousseaux-500211172/",
github: "https://github.com/VincentRssx",
picture: "assets/photos/blue/vincent.jpg",
deco: "assets/logos/logoCli.png",
crew: "blue",
},
{
name: "Frédéric Ticon",
quote: "« Qui part à fond finit comme un ***. »",
linkedin: "http://www.linkedin.com/",
github: "https://github.com/TICONFRED27",
picture: "assets/photos/blue/Fred.jpg",
deco: "assets/logos/react-logo.png",
crew: "blue",
},
{
name: "Farid Zian",
quote:
"« Le bonheur, ce n'est pas de faire ce que l'on veut, mais de vouloir ce que l'on fait. »",
linkedin: "https://www.linkedin.com/in/farid-zian-a81a2848/",
github: "https://github.com/Farid-Zian",
picture: "assets/photos/blue/Farid.jpg",
deco: "assets/logos/SQL.png",
crew: "blue",
},
{
name: "Florence Buchelet",
quote:
"« If you want to lift yourself up, lift up someone else. »",
linkedin: "https://www.linkedin.com/in/florence-buchelet-928a7a228/",
github: "https://github.com/FlorenceBuchelet",
picture: "assets/photos/blue/Florence.jpg",
deco: "assets/logos/logoNode.png",
crew: "blue",
},
/*crew yellow*/
{
name: "Romain Imbrasse",
quote: "« Rien n'est sérieux en ce bas monde que le rire. »",
linkedin: "https://www.linkedin.com/in/romain-imbrasse-9480ab1ba/",
github: "https://github.com/Romlion",
picture: "assets/photos/yellow/Romain.jpg",
deco: "assets/logos/logoCli.png",
crew: "yellow",
},
{
name: "Pierre Adrien Gouillart",
quote: "« Mundi placet et spiritus minima. »",
linkedin: "https://www.linkedin.com/in/pierre-adrien-gouillart",
github: "https://github.com/pagouillart",
picture: "assets/photos/yellow/Pierre-Adrien.jpg",
deco: "assets/logos/logoGit.png",
crew: "yellow",
},
{
name: "Lucas Merino",
quote: "« I prefer not to speak. »",
linkedin: "https://www.linkedin.com/in/lucasmerino10/",
github: "https://github.com/LucasMerino10",
picture: "assets/photos/yellow/Lucas.jpg",
deco: "assets/logos/SQL.png",
crew: "yellow",
},
{
name: "Cyril Daburon",
quote:
"« Je comprends ici ce qu'on appelle gloire : le droit d'aimer sans mesure. »",
linkedin: "https://www.linkedin.com/in/cyril-daburon",
github: "https://github.com/Cyrildab",
picture: "assets/photos/yellow/cyril.jpg",
deco: "assets/logos/logoNode.png",
crew: "yellow",
},
{
name: "Xavier Lobez",
quote: "« Papy fait de la résistance ! »",
linkedin: "https://www.linkedin.com/in/xavier-lobez-892501227/",
github: "https://github.com/Bravax",
picture: "assets/photos/yellow/Xavier.jpg",
deco: "assets/logos/Agile.png",
crew: "yellow",
},
{
name: "Julien Ozarowski",
quote:
"« Le gras c'est la vie... et encore plus quand c'est du fromage fondu. »",
linkedin: "https://www.linkedin.com/in/julien-ozarowski",
github: "https://github.com/JulienOza",
picture: "assets/photos/yellow/Julien.jpg",
deco: "assets/logos/css-logo.png",
crew: "yellow",
},
{
name: "Sébastien Samyn",
quote:
"« Je suis adroit de la main gauche et je suis gauche de la main droite. »",
linkedin: "https://www.linkedin.com/in/sebastien-samyn",
github: "https://github.com/",
picture: "assets/photos/yellow/Sebastien.jpg",
deco: "assets/logos/react-logo.png",
crew: "yellow",
},
{
name: "Rayane Moussaoui",
quote: "« C'est pas faux. »",
linkedin: "http://www.linkedin.com/",
github: "https://github.com/Rayane0823",
picture: "assets/photos/yellow/Rayan.jpg",
deco: "assets/logos/logosHtmlCSS.png",
crew: "yellow",
},
{
name: "Matthieu Thierry",
quote: "« La connaissance est le pouvoir. »",
linkedin: "http://www.linkedin.com/",
github: "https://github.com/ItsMatDev",
picture: "assets/photos/yellow/Mathieu.jpg",
deco: "assets/logos/Logo-JS.png",
crew: "yellow",
},
/*crew Data*/
{
name: "Caroline Rouvillain",
quote:
"« Nous savons bien que notre action n'est qu'une goutte d'eau dans l'océan, mais sans notre action cette goute manquerait. »",
linkedin: "https://www.linkedin.com/in/caroline-rouvillain-65b7a3160/",
github: "https://github.com/",
picture: "assets/photos/data/Caroline.jpg",
deco: "assets/logos/Agile.png",
crew: "data",
},
{
name: "Gwenaëlle Deschamps",
quote:
"« Quand on vise la médiocrité, c'est elle qui vous atteint. »",
linkedin: "https://www.linkedin.com/in/gwena%C3%ABlle-deschamps-419772138/",
github: "https://github.com/",
picture: "assets/photos/data/Gwenaelle.jpg",
deco: "assets/logos/logoNumpy.png",
crew: "data",
},
{
name: "Julien Billardon",
quote:
"« Nous ne nous arrêtons pas de jouer parce que nous vieillissons, mais nous vieillissons parce que nous nous arrêtons de jouer. »",
linkedin: "https://www.linkedin.com/in/julien-billardon-185476158/",
github: "https://github.com/Ju-stASimpleName",
picture: "assets/photos/data/Julien.jpg",
deco: "assets/logos/power-bi.png",
crew: "data",
},
{
name: "Félix Depret",
quote: "« Que peut le bœuf face à un lion ensanglanté. »",
linkedin: "https://www.linkedin.com/in/f%C3%A9lix-depret-96612a17a/",
github: "https://github.com/",
picture: "assets/photos/data/Felix.jpg",
deco: "assets/logos/logoPython.png",
crew: "data",
},
{
name: "Grégoire Lozach",
quote:
"« La vie serait une comédie bien agréable, si l'on n'y jouait pas un rôle. »",
linkedin: "https://www.linkedin.com/in/gr%C3%A9goire-lozac-h-1861b985/",
github: "https://github.com/",
picture: "assets/photos/data/Gregoire.jpg",
deco: "assets/logos/mysql.png",
crew: "data",
},
{
name: "Dorothée Catry",
quote: "« J'adore la data, les chips et les petits chats. »",
linkedin: "https://www.linkedin.com/in/doroth%C3%A9e-catry-3a451a138/",
github: "https://github.com/DoroChan/Dorothee_C_PEP8",
picture: "assets/photos/data/Dorothée.jpg",
deco: "assets/logos/SQL.png",
crew: "data",
},
];
// Génération de cards
function createCards(picture, name, quote, github, linkedin, decoration) {
//touch ul
const unorderedList = document.querySelector("ul");
// créer li "card"
const card = document.createElement("li");
card.classList.add("card");
unorderedList.appendChild(card);
// div "polaroid"
const pola = document.createElement("div");
pola.classList.add("polaroid");
card.appendChild(pola);
// créer le corps div class="innerPolaroid"
const innerPola = document.createElement("div");
innerPola.classList.add("innerPolaroid");
pola.appendChild(innerPola);
// créer front div class="frontPolaroid"
const frontPola = document.createElement("div");
frontPola.classList.add("frontPolaroid");
innerPola.appendChild(frontPola);
// créer l'image img class="photo"
const image = document.createElement("img");
image.src = picture;
image.alt = "the student's polaroid portrait";
image.classList.add("photo");
frontPola.appendChild(image);
// créer nom tag="h2"
const nameFront = document.createElement("h2");
nameFront.innerHTML = name;
if (name.length > 19) {
nameFront.style.paddingTop = "6%";
}
frontPola.appendChild(nameFront);
//créer back div class="backPolaroid"
const backPola = document.createElement("div");
backPola.classList.add("backPolaroid");
innerPola.appendChild(backPola);
// créer le nom au dos tag="h3"
const nameBack = document.createElement("h3");
nameBack.innerHTML = name;
backPola.appendChild(nameBack);
// créer la citation tag="p"
const citation = document.createElement("p");
citation.innerHTML = quote;
backPola.appendChild(citation);
// créer le lien linkedin class="linkedin"
const linkedinLink = document.createElement("a");
linkedinLink.href = linkedin;
linkedinLink.classList.add("linkedin");
linkedinLink.setAttribute("target", "_blank");
const linkedinLogo = document.createElement("img");
linkedinLogo.src = "assets/logo-linkedin.png";
linkedinLogo.alt = "Logo LinkedIn";
linkedinLogo.classList.add("verso");
linkedinLink.appendChild(linkedinLogo);
backPola.appendChild(linkedinLink);
//créer le lien github a class="github" (+img class="verso")
const gitHubLink = document.createElement("a");
gitHubLink.href = github;
gitHubLink.classList.add("github");
gitHubLink.setAttribute("target", "_blank");
const gitHubLogo = document.createElement("img");
gitHubLogo.src = "assets/logo-github.png";
gitHubLogo.alt = "Logo GitHub";
gitHubLogo.classList.add("verso");
gitHubLink.appendChild(gitHubLogo);
backPola.appendChild(gitHubLink);
// créer la deco img class="deco"
const deco = document.createElement("img");
deco.src = decoration;
deco.alt = "HTML CSS or Javascript logos";
deco.classList.add("deco");
card.appendChild(deco);
}
// filtres
const changeTitle = document.querySelector("h1");
const onlyBlue = students.filter((whichCrew) => whichCrew.crew === "blue");
const onlyYellow = students.filter((whichCrew) => whichCrew.crew === "yellow");
const onlyData = students.filter((whichCrew) => whichCrew.crew === "data");
// liste promo de base
for (let i = 0; i < students.length; i++) {
changeTitle.innerHTML = "Wild Code School - Lille, September 2023";
createCards(
students[i].picture,
students[i].name,
students[i].quote,
students[i].github,
students[i].linkedin,
students[i].deco
);
}
// function remove list
function removeCards() {
const sectionPolaroids = document.querySelector("#polaroids");
const unorderedListRemove = document.querySelector("ul");
unorderedListRemove.remove();
const unorderedList = document.createElement("ul");
sectionPolaroids.appendChild(unorderedList);
}
// refresh logo
const logoWild = document.querySelector(".logo");
logoWild.addEventListener("click", function () {
location.reload();
});
// appeler la fonction
const clickBlue = document.querySelector(".Crew-bleu");
clickBlue.addEventListener("click", function () {
removeCards();
for (let i = 0; i < onlyBlue.length; i++) {
changeTitle.innerHTML = "Web Developer - Lille, September 2023";
createCards(
onlyBlue[i].picture,
onlyBlue[i].name,
onlyBlue[i].quote,
onlyBlue[i].github,
onlyBlue[i].linkedin,
onlyBlue[i].deco
);
}
callFlipOnClick();
});
const clickYellow = document.querySelector(".Crew-Yellow");
clickYellow.addEventListener("click", function () {
removeCards();
for (let i = 0; i < onlyYellow.length; i++) {
changeTitle.innerHTML = "Web Developer - Lille, September 2023";
createCards(
onlyYellow[i].picture,
onlyYellow[i].name,
onlyYellow[i].quote,
onlyYellow[i].github,
onlyYellow[i].linkedin,
onlyYellow[i].deco
);
}
callFlipOnClick();
});
const clickData = document.querySelector(".Crew-data");
clickData.addEventListener("click", function () {
removeCards();
for (let i = 0; i < onlyData.length; i++) {
changeTitle.innerHTML = "Data Analyst - Lille, September 2023";
createCards(
onlyData[i].picture,
onlyData[i].name,
onlyData[i].quote,
onlyData[i].github,
onlyData[i].linkedin,
onlyData[i].deco
);
}
callFlipOnClick();
});
/*animation flip*/
function callFlipOnClick() {
const flipOnClick = document.querySelectorAll(".polaroid");
flipOnClick.forEach(function (flip) {
flip.addEventListener("click", function () {
flip.classList.add("flipping");
});
});
flipOnClick.forEach(function (unflip) {
unflip.addEventListener("mouseleave", function () {
unflip.classList.remove("flipping");
});
});
}
callFlipOnClick();
// animation navbar
const menuBurger = document.querySelector(".menu-burger");
const cData = document.querySelector(".Crew-data");
const cYellow = document.querySelector(".Crew-Yellow");
const cBleu = document.querySelector(".Crew-bleu");
const cadrePolaroids = document.querySelector("#polaroids");
menuBurger.addEventListener("click", () => {
cData.classList.toggle("mobile-menu");
cYellow.classList.toggle("mobile-menu");
cBleu.classList.toggle("mobile-menu");
});
// navbar onclick
cData.addEventListener("click", () => {
cData.style.backgroundColor = "var(--color-fond)";
cData.style.borderBottom = "3px solid var(--color-fond)";
cYellow.style.backgroundColor = "var(--color-button)";
cYellow.style.borderBottom = "3px solid var(--color-border)";
cBleu.style.backgroundColor = "var(--color-button)";
cBleu.style.borderBottom = "2px solid var(--color-border) ";
});
cYellow.addEventListener("click", () => {
cYellow.style.backgroundColor = "var(--color-fond)";
cYellow.style.borderBottom = "3px solid var(--color-fond)";
cData.style.backgroundColor = "var(--color-button)";
cData.style.borderBottom = "3px solid var(--color-border)";
cBleu.style.backgroundColor = "var(--color-button)";
cBleu.style.borderBottom = "2px solid var(--color-border) ";
});
cBleu.addEventListener("click", () => {
cBleu.style.backgroundColor = "var(--color-fond)";
cBleu.style.borderBottom = "3px solid var(--color-fond)";
cYellow.style.backgroundColor = "var(--color-button)";
cYellow.style.borderBottom = "3px solid var(--color-border)";
cData.style.backgroundColor = "var(--color-button)";
cData.style.borderBottom = "2px solid var(--color-border) ";
});
/*compteur de click*/
let numberClick = 0;
function incrementClick() {
numberClick++;
burgerClick();
}
function burgerClick() {
if (numberClick % 2 === 0) {
cadrePolaroids.style.borderRadius = "20px";
} else {
cadrePolaroids.style.borderRadius = "20px 0px 20px 20px";
}
}