-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
174 lines (151 loc) · 5.7 KB
/
Copy pathscript.js
File metadata and controls
174 lines (151 loc) · 5.7 KB
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
class Errocometido extends Error {
constructor(message) {
super(message);
this.name = "Erro: está faltando adicionar os atributos";
}
}
class Card {
constructor(nome, descricao, imagem) {
this.nome = nome;
this.descricao = descricao;
this.imagem = imagem;
}
cardlist() {
try {
return this.atributos();
} catch (erro) {
console.error(erro);
return "";
}
}
atributos() {
if (this.nome != "" && this.descricao != "" && this.imagem != "") {
return `
<div>
<div class="card">
<img src="${this.imagem}" />
<div class="text">
<h2>${this.nome}</h2>
<p>${this.descricao}</p>
</div>
</div>
</div>`;
} else {
throw new Errocometido(
"Está faltando inserir alguma das informações necessárias para elaborar o Card :("
);
}
}
}
document.addEventListener("DOMContentLoaded", () => {
const cardBella = new Card(
"Bella - Literary Analyst",
"The team’s strategist, always with a smart solution inspired by books.",
"images/bela pc.png"
);
const idBella = document.getElementById("cardBella");
idBella.insertAdjacentHTML('afterbegin', cardBella.cardlist());
const cardAurora = new Card(
"Aurora - Dream Specialist",
"Brings calm and clarity to missions with her enchanted magic.",
"images/aurora pc.png"
);
const idAurora = document.getElementById("cardAurora");
idAurora.insertAdjacentHTML('afterbegin', cardAurora.cardlist());
const cardMerida = new Card(
"Merida - Explorer",
"Fearless and precise, leading the team through challenging terrains.",
"images/merida pc.png"
);
const idMerida = document.getElementById("cardMerida");
idMerida.insertAdjacentHTML('afterbegin', cardMerida.cardlist());
const cardMoana = new Card(
"Moana - Aquatic Navigator",
"Guides the team through water and communicates with nature.",
"images/moana pc.png"
);
const idMoana = document.getElementById("cardMoana");
idMoana.insertAdjacentHTML('afterbegin', cardMoana.cardlist());
const cardAnna = new Card(
"Anna - Unifier",
"The team’s morale booster, always bringing everyone together with her positive energy.",
"images/ana pc.png"
);
const idAnna = document.getElementById("cardAnna");
idAnna.insertAdjacentHTML('afterbegin', cardAnna.cardlist());
const cardElsie = new Card(
"Elsie - Ice Strategist",
"The team’s ice expert, controlling snow and ice to create safe paths and manage extreme weather.",
"images/elsa pc.png"
);
const idElsie = document.getElementById("cardElsie");
idElsie.insertAdjacentHTML('afterbegin', cardElsie.cardlist());
const cardEsme = new Card(
"Esme - Street Artist",
"Spreads creativity and messages, ensuring the team is always well-received.",
"images/esmeralda pc.png"
);
const idEsme = document.getElementById("cardEsme");
idEsme.insertAdjacentHTML('afterbegin', cardEsme.cardlist());
const cardRapha = new Card(
"Rapha - Healer & Rescuer",
"The team’s medic, using her golden ropes for elevated rescues and to heal injuries.",
"images/rapunzel pc.png"
);
const idRapha = document.getElementById("cardRapha");
idRapha.insertAdjacentHTML('afterbegin', cardRapha.cardlist());
const cardTia = new Card(
"Tia - Chef & Motivator",
"Keeps the team energized with delicious meals and helps them through difficult terrains.",
"images/tiana pc.png"
);
const idTia = document.getElementById("cardTia");
idTia.insertAdjacentHTML('afterbegin', cardTia.cardlist());
const cardAri = new Card(
"Ari - Underwater Rescuer",
"Specializes in underwater rescues with seashell-inspired tools and bubble gear.",
"images/ariel pc.png"
);
const idAri = document.getElementById("cardAri");
idAri.insertAdjacentHTML('afterbegin', cardAri.cardlist());
const cardCinderella = new Card(
"Cindy - Midnight Planner",
"Always ready to assist the team with her clockwork precision and elegant problem-solving skills.",
"images/cinderela pc.jpg"
);
const idCinderella = document.getElementById("cardCinderella");
idCinderella.insertAdjacentHTML('afterbegin', cardCinderella.cardlist());
const cardJasmine = new Card(
"Jaz - Sky Adventurer",
"With her flying carpet tools, Jaz leads the team on aerial adventures and daring rescues.",
"images/jasmine pc.png"
);
const idJasmine = document.getElementById("cardJasmine");
idJasmine.insertAdjacentHTML('afterbegin', cardJasmine.cardlist());
const cardMulan = new Card(
"Mila - Courage Specialist",
"A brave and fearless leader, Mila uses her battle-tested tactics to guide the team to victory.",
"images/mulan pc.png"
);
const idMulan = document.getElementById("cardMulan");
idMulan.insertAdjacentHTML('afterbegin', cardMulan.cardlist());
const cardSnowWhite = new Card(
"Snowy - Wildlife Whisperer",
"Snowy charms forest creatures to assist the team with her kindness and gentle leadership.",
"images/neve pc.png"
);
const idSnowWhite = document.getElementById("cardSnowWhite");
idSnowWhite.insertAdjacentHTML('afterbegin', cardSnowWhite.cardlist());
const cardPocahontas = new Card(
"Poca - Nature Navigator",
"Guides the team through nature with her wisdom and connection to the environment.",
"images/pocahontas pc.png"
);
const idPocahontas = document.getElementById("cardPocahontas");
idPocahontas.insertAdjacentHTML('afterbegin', cardPocahontas.cardlist());
const cards = document.querySelectorAll(".card");
cards.forEach((card, index) => {
card.style.setProperty('--animate-delay', `${index * 0.2}s`);
card.classList.add("animate__animated", "animate__fadeInUp");
});
});