-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
730 lines (703 loc) · 19.7 KB
/
app.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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
// Déclaration des chanteurs avec leurs informations
const singers = [
{
name: "John Lennon",
country: "Angleterre",
tessitura: "Ténor",
ambitus: "C3 - C6",
birthDate: "9 octobre 1940",
deathDate: "8 décembre 1980",
wikipediaLink: "https://fr.wikipedia.org/wiki/John_Lennon",
},
{
name: "Freddie Mercury",
country: "Angleterre",
tessitura: "Baryton",
ambitus: "F2 - F5",
birthDate: "5 septembre 1946",
deathDate: "24 novembre 1991",
wikipediaLink: "https://fr.wikipedia.org/wiki/Freddie_Mercury",
},
{
name: "Maria Callas",
country: "Grèce",
tessitura: "Soprano",
ambitus: "B♭3 - E6",
birthDate: "2 décembre 1923",
deathDate: "16 septembre 1977",
wikipediaLink: "https://fr.wikipedia.org/wiki/Maria_Callas",
},
{
name: "Luciano Pavarotti",
country: "Italie",
tessitura: "Ténor",
ambitus: "C3 - B5",
birthDate: "12 octobre 1935",
deathDate: "6 septembre 2007",
wikipediaLink: "https://fr.wikipedia.org/wiki/Luciano_Pavarotti",
},
{
name: "Whitney Houston",
country: "États-Unis",
tessitura: "Soprano",
ambitus: "B♭3 - E6",
birthDate: "9 août 1963",
deathDate: "11 février 2012",
wikipediaLink: "https://fr.wikipedia.org/wiki/Whitney_Houston",
},
{
name: "Andrea Bocelli",
country: "Italie",
tessitura: "Ténor",
ambitus: "C3 - G5",
birthDate: "22 septembre 1958",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Andrea_Bocelli",
},
{
name: "Edith Piaf",
country: "France",
tessitura: "Soprano",
ambitus: "C4 - C6",
birthDate: "19 décembre 1915",
deathDate: "10 octobre 1963",
wikipediaLink: "https://fr.wikipedia.org/wiki/Édith_Piaf",
},
{
name: "Beyoncé",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "G3 - F#6",
birthDate: "4 septembre 1981",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Beyoncé",
},
{
name: "Elvis Presley",
country: "États-Unis",
tessitura: "Baryton",
ambitus: "G2 - B♭5",
birthDate: "8 janvier 1935",
deathDate: "16 août 1977",
wikipediaLink: "https://fr.wikipedia.org/wiki/Elvis_Presley",
},
{
name: "Céline Dion",
country: "Canada",
tessitura: "Contralto",
ambitus: "G3 - C6",
birthDate: "30 mars 1968",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Céline_Dion",
},
{
name: "Frank Sinatra",
country: "États-Unis",
tessitura: "Baryton",
ambitus: "E♭2 - B♭4",
birthDate: "12 décembre 1915",
deathDate: "14 mai 1998",
wikipediaLink: "https://fr.wikipedia.org/wiki/Frank_Sinatra",
},
{
name: "Aretha Franklin",
country: "États-Unis",
tessitura: "Soprano",
ambitus: "B♭2 - B♭5",
birthDate: "25 mars 1942",
deathDate: "16 août 2018",
wikipediaLink: "https://fr.wikipedia.org/wiki/Aretha_Franklin",
},
{
name: "Lucia Popp",
country: "Slovaquie",
tessitura: "Soprano",
ambitus: "F#3 - F6",
birthDate: "12 novembre 1939",
deathDate: "16 novembre 1993",
wikipediaLink: "https://fr.wikipedia.org/wiki/Lucia_Popp",
},
{
name: "Diana Ankudinova",
country: "Russie",
tessitura: "Contralto",
ambitus: "C3 - B♭5",
birthDate: "12 novembre 2003",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Diana_Ankudinova",
},
{
name: "Michael Jackson",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "B2 - B♭6",
birthDate: "29 août 1958",
deathDate: "25 juin 2009",
wikipediaLink: "https://fr.wikipedia.org/wiki/Michael_Jackson",
},
{
name: "Adele",
country: "Royaume-Uni",
tessitura: "Mezzo-soprano",
ambitus: "B2 - D6",
birthDate: "5 mai 1988",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Adele_(chanteuse)",
},
{
name: "Lucie Arnaz",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "A3 - F6",
birthDate: "17 juillet 1951",
deathDate: "",
wikipediaLink: "https://en.wikipedia.org/wiki/Lucie_Arnaz",
},
{
name: "Stevie Wonder",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "G2 - C6",
birthDate: "13 mai 1950",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Stevie_Wonder",
},
{
name: "Mariah Carey",
country: "États-Unis",
tessitura: "Soprano",
ambitus: "F2 - G7",
birthDate: "27 mars 1969",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Mariah_Carey",
},
{
name: "Sam Smith",
country: "Royaume-Uni",
tessitura: "Contreténor",
ambitus: "D3 - G5",
birthDate: "19 mai 1992",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Sam_Smith",
},
{
name: "Barbra Streisand",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "A2 - F♯6",
birthDate: "24 avril 1942",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Barbra_Streisand",
},
{
name: "Amy Winehouse",
country: "Royaume-Uni",
tessitura: "Mezzo-soprano",
ambitus: "C3 - C6",
birthDate: "14 septembre 1983",
deathDate: "23 juillet 2011",
wikipediaLink: "https://fr.wikipedia.org/wiki/Amy_Winehouse",
},
{
name: "Janis Joplin",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "A2 - C6",
birthDate: "19 janvier 1943",
deathDate: "4 octobre 1970",
wikipediaLink: "https://fr.wikipedia.org/wiki/Janis_Joplin",
},
{
name: "Chris Cornell",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "E2 - F5",
birthDate: "20 juillet 1964",
deathDate: "18 mai 2017",
wikipediaLink: "https://fr.wikipedia.org/wiki/Chris_Cornell",
},
{
name: "Alicia Keys",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "G♯2 - C6",
birthDate: "25 janvier 1981",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Alicia_Keys",
},
{
name: "David Bowie",
country: "Royaume-Uni",
tessitura: "Ténor",
ambitus: "C2 - B5",
birthDate: "8 janvier 1947",
deathDate: "10 janvier 2016",
wikipediaLink: "https://fr.wikipedia.org/wiki/David_Bowie",
},
{
name: "Ariana Grande",
country: "États-Unis",
tessitura: "Soprano",
ambitus: "E3 - C7",
birthDate: "26 juin 1993",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Ariana_Grande",
},
{
name: "Bob Marley",
country: "Jamaïque",
tessitura: "Ténor",
ambitus: "D3 - B5",
birthDate: "6 février 1945",
deathDate: "11 mai 1981",
wikipediaLink: "https://fr.wikipedia.org/wiki/Bob_Marley",
},
{
name: "Christina Aguilera",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "C3 - E♭6",
birthDate: "18 décembre 1980",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Christina_Aguilera",
},
{
name: "Prince",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "G2 - G6",
birthDate: "7 juin 1958",
deathDate: "21 avril 2016",
wikipediaLink: "https://fr.wikipedia.org/wiki/Prince_(musicien)",
},
{
name: "Ella Fitzgerald",
country: "États-Unis",
tessitura: "Soprano",
ambitus: "B♭3 - E♭6",
birthDate: "25 avril 1917",
deathDate: "15 juin 1996",
wikipediaLink: "https://fr.wikipedia.org/wiki/Ella_Fitzgerald",
},
{
name: "Justin Timberlake",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "G2 - G5",
birthDate: "31 janvier 1981",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Justin_Timberlake",
},
{
name: "Nina Simone",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "G♯2 - E6",
birthDate: "21 février 1933",
deathDate: "21 avril 2003",
wikipediaLink: "https://fr.wikipedia.org/wiki/Nina_Simone",
},
{
name: "Axl Rose",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "A1 - B♭5",
birthDate: "6 février 1962",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Axl_Rose",
},
{
name: "Jennifer Hudson",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "G♯2 - E♭6",
birthDate: "12 septembre 1981",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Jennifer_Hudson",
},
{
name: "Lana Del Rey",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "C3 - F♯5",
birthDate: "21 juin 1985",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Lana_Del_Rey",
},
{
name: "Tony Bennett",
country: "États-Unis",
tessitura: "Baryton",
ambitus: "C2 - F5",
birthDate: "3 août 1926",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Tony_Bennett",
},
{
name: "Billie Eilish",
country: "États-Unis",
tessitura: "Soprano",
ambitus: "B2 - E6",
birthDate: "18 décembre 2001",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Billie_Eilish",
},
{
name: "Lionel Richie",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "D2 - B5",
birthDate: "20 juin 1949",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Lionel_Richie",
},
{
name: "Demi Lovato",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "G♯2 - E♭6",
birthDate: "20 août 1992",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Demi_Lovato",
},
{
name: "Florent Pagny",
country: "France",
tessitura: "Ténor",
ambitus: "A2 - G5",
birthDate: "6 novembre 1961",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Florent_Pagny",
},
{
name: "Garou",
country: "Canada",
tessitura: "Baryton",
ambitus: "G2 - G5",
birthDate: "26 juin 1972",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Garou_(chanteur)",
},
{
name: "Mika",
country: "Liban",
tessitura: "Ténor",
ambitus: "B2 - D6",
birthDate: "18 août 1983",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Mika_(chanteur)",
},
{
name: "Shakira",
country: "Colombie",
tessitura: "Mezzo-soprano",
ambitus: "G2 - E6",
birthDate: "2 février 1977",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Shakira",
},
{
name: "Rita Ora",
country: "Royaume-Uni",
tessitura: "Soprano",
ambitus: "B3 - E6",
birthDate: "26 novembre 1990",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Rita_Ora",
},
{
name: "Nico Santos",
country: "Allemagne",
tessitura: "Baryton",
ambitus: "B2 - B♭5",
birthDate: "7 janvier 1993",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Nico_Santos",
},
{
name: "Marina Kaye",
country: "France",
tessitura: "Soprano",
ambitus: "E♭3 - E♭6",
birthDate: "9 février 1998",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Marina_Kaye",
},
{
name: "Lilian Renaud",
country: "France",
tessitura: "Ténor",
ambitus: "C♯2 - G♯5",
birthDate: "17 août 1991",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Lilian_Renaud",
},
{
name: "Kendji Girac",
country: "France",
tessitura: "Ténor",
ambitus: "A2 - G♯5",
birthDate: "3 juillet 1996",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Kendji_Girac",
},
{
name: "Slimane",
country: "France",
tessitura: "Ténor",
ambitus: "G2 - G♯5",
birthDate: "13 octobre 1989",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Slimane_(chanteur)",
},
{
name: "Adam Levine",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "A2 - G5",
birthDate: "18 mars 1979",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Adam_Levine",
},
{
name: "Kelly Clarkson",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "A2 - G♯5",
birthDate: "24 avril 1982",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Kelly_Clarkson",
},
{
name: "Kelly Rowland",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "F♯3 - C♯6",
birthDate: "11 février 1981",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Kelly_Rowland",
},
{
name: "Dimash Kudaibergenov",
country: "Kazakhstan",
tessitura: "Ténor",
ambitus: "C2 - B♭1",
birthDate: "24 mai 1994",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Dimash_Kudaibergen",
},
{
name: "Tina Karol",
country: "Ukraine",
tessitura: "Mezzo-soprano",
ambitus: "F3 - G♯6",
birthDate: "25 janvier 1985",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Tina_Karol",
},
{
name: "Rea Garvey",
country: "Irlande",
tessitura: "Baryton",
ambitus: "C♯2 - G♯5",
birthDate: "3 mai 1973",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Rea_Garvey",
},
{
name: "Eros Ramazzotti",
country: "Italie",
tessitura: "Ténor",
ambitus: "D2 - G5",
birthDate: "28 octobre 1963",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Eros_Ramazzotti",
},
{
name: "Tina Turner",
country: "États-Unis",
tessitura: "Mezzo-soprano",
ambitus: "E3 - C6",
birthDate: "26 novembre 1939",
deathDate: "24 mai 2023",
wikipediaLink: "https://fr.wikipedia.org/wiki/Tina_Turner",
},
{
name: "Bruno Mars",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "C3 - G5",
birthDate: "8 octobre 1985",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Bruno_Mars",
},
{
name: "Charlie Puth",
country: "États-Unis",
tessitura: "Ténor",
ambitus: "A2 - G5",
birthDate: "2 décembre 1991",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Charlie_Puth",
},
{
name: "Tom Gregory",
country: "Royaume-Uni",
tessitura: "Ténor",
ambitus: "E2 - G♯4",
birthDate: "29 novembre 1994",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Tom_Gregory",
},
{
name: "George Michael",
country: "Royaume-Uni",
tessitura: "Ténor",
ambitus: "B♭2 - A5",
birthDate: "25 juin 1963",
deathDate: "25 décembre 2016",
wikipediaLink: "https://fr.wikipedia.org/wiki/George_Michael",
},
{
name: "Harry Styles",
country: "Royaume-Uni",
tessitura: "Ténor",
ambitus: "C3 - C6",
birthDate: "1er février 1994",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Harry_Styles",
},
{
name: "Delta Goodrem",
country: "Australie",
tessitura: "Mezzo-soprano",
ambitus: "E♭3 - B♭5",
birthDate: "9 novembre 1984",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Delta_Goodrem",
},
{
name: "Guy Sebastian",
country: "Australie",
tessitura: "Ténor",
ambitus: "D3 - G5",
birthDate: "26 octobre 1981",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Guy_Sebastian",
},
{
name: "Monika Pundziūtė",
country: "Lituanie",
tessitura: "Mezzo-soprano",
ambitus: "E♭3 - E♭6",
birthDate: "5 mai 1997",
deathDate: "",
wikipediaLink: "https://fr.wikipedia.org/wiki/Monika_Pundziūtė",
},
];
// Fonction pour trier les chanteurs par ordre alphabétique
function sortSingersByName(singers) {
return singers.sort((a, b) => a.name.localeCompare(b.name));
}
// Fonction pour trier les pays par ordre alphabétique
function sortCountries(countries) {
return countries.sort((a, b) => a.localeCompare(b));
}
// Fonction pour créer les options du select pour les noms
function createNameOptions() {
const nameSelect = document.getElementById("name-select");
nameSelect.innerHTML =
"<option disabled selected value>--Choisir un artiste--</option>";
const sortedSingers = sortSingersByName(singers);
sortedSingers.forEach((singer) => {
const option = document.createElement("option");
option.value = singer.name;
option.textContent = singer.name;
nameSelect.appendChild(option);
});
}
// Fonction pour créer les options du select pour les pays
function createCountryOptions() {
const countrySelect = document.getElementById("country-select");
countrySelect.innerHTML =
"<option disabled selected value>--Choisir un pays--</option>";
const countries = singers.map((singer) => singer.country);
const sortedCountries = sortCountries([...new Set(countries)]);
sortedCountries.forEach((country) => {
const option = document.createElement("option");
option.value = country;
option.textContent = country;
countrySelect.appendChild(option);
});
}
// Fonction pour filtrer les chanteurs en fonction des sélections
// Fonction pour filtrer les chanteurs en fonction des sélections
function filterSingers() {
const nameSelect = document.getElementById("name-select");
const countrySelect = document.getElementById("country-select");
const singersContainer = document.getElementById("singers-container");
const noSingerMessage = document.getElementById("no-singer-message");
const selectedName = nameSelect.value;
const selectedCountry = countrySelect.value;
const filteredSingers = singers.filter((singer) => {
const nameMatch = selectedName === "" || singer.name === selectedName;
const countryMatch =
selectedCountry === "" || singer.country === selectedCountry;
return nameMatch && countryMatch;
});
singersContainer.innerHTML = "";
if (selectedName !== "") {
countrySelect.value = ""; // Réinitialise le select "Pays" si un nom est sélectionné
}
if (selectedCountry !== "") {
nameSelect.value = ""; // Réinitialise le select "Nom" si un pays est sélectionné
}
if (filteredSingers.length === 0) {
noSingerMessage.style.display = "block";
} else {
noSingerMessage.style.display = "none";
filteredSingers.forEach((singer) => {
const singerCard = document.createElement("div");
singerCard.classList.add("singer-card");
const singerName = document.createElement("h2");
singerName.innerHTML = singer.name;
singerCard.appendChild(singerName);
const singerCountry = document.createElement("p");
singerCountry.innerHTML = singer.country;
singerCard.appendChild(singerCountry);
const singerInfo = document.createElement("p");
singerInfo.innerHTML = `<span class="tessitura">${singer.tessitura}</span><br>
<span class="tessitura">${singer.ambitus}</span><br>
${singer.birthDate} - <br>
${singer.deathDate}`;
singerCard.appendChild(singerInfo);
const wikipediaLink = document.createElement("a");
wikipediaLink.href = singer.wikipediaLink;
wikipediaLink.textContent = "Plus d'infos sur l'artiste";
singerCard.appendChild(wikipediaLink);
singersContainer.appendChild(singerCard);
});
}
}
// Fonction pour afficher tous les artistes
function showAllSingers() {
const nameSelect = document.getElementById("name-select");
const countrySelect = document.getElementById("country-select");
nameSelect.value = "";
countrySelect.value = "";
filterSingers();
}
// Fonction pour afficher/masquer la définition
function toggleAside() {
const aside = document.querySelector("aside");
aside.classList.toggle("visible");
}
const closeAsideButton = document.querySelector(".close-aside");
const aside = document.querySelector("aside");
closeAsideButton.addEventListener("click", () => {
aside.classList.remove("visible");
});
// Initialisation de la page
createNameOptions();
createCountryOptions();
filterSingers();