-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopPlayers.html
361 lines (301 loc) · 10.3 KB
/
topPlayers.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.css">
<title>Assignment 2a/b: JavaScript</title>
<link rel="stylesheet" href = "css/style.css">
<link rel="stylesheet" href="css/lightbox.min.css">
</head>
<body>
<div class = "ui grid stackable container">
<a href="index.html">
<img src="images/lobaLogo.png" id="logo" alt="Roma Logo">
</a>
<nav class="ui top attached tabular stackable menu">
<a class="item" href = "index.html">Home</a>
<a class="item" href = "team.html">Team</a>
<a class="active item" href = "topPlayers.html">Top Players</a>
<a class="item" href = "winAPrize.html">Win A Prize</a>
<a class="item" href = "about.html">About</a>
</nav>
<div class = "ui sixteen wide center aligned column">
<header><h1 class="ml15">
<span class="word">TOP</span>
<span class="word">PLAYERS</span>
</h1></header>
</div>
<main>
<div id="gallery">
<h2 class="h2Cards">STRIKERS</h2>
<div class="strikersss"></div>
<h2 class="h2Cards">MIDFIELDERS</h2>
<div class="midfieldersss"></div>
<h2 class="h2Cards">DEFENDERS</h2>
<div class="defendersss"></div>
<h2 class="h2Cards">GOALKEEPERS</h2>
<div class="goalkeepersss"></div>
<script id="strikerCards" type="text/x-handlebars-template">
<div class="ui link cards">
{{#each this}}
<div class="ui card">
<div class="image">
<a href="{{image}}" data-title = "{{formatFullName fullname}}" data-lightbox="{{lightbox}}">
<img src="{{smallImage}}" class="noRadius" alt="Picture of Roma Player"></a>
</div>
<div class="content">
<a class="header">{{formatFullName fullname}}</a>
<div class="meta">
<span class="date">Born {{born}}</span>
</div>
<div class="description">
{{nationality}} player - {{description}}
</div>
</div>
<div class="extra content">
<a>
<i class="black tie icon"></i>
Shirt No. {{shirt}}
</a>
</div>
</div>
{{/each}}
</div>
</script>
</div>
<br>
<hr class = "hrFunFacts">
<h2 class="h2Cards">Fun Facts</h2>
<div class="ui styled fluid accordion">
<div class="active title">
<i class="dropdown icon"></i>
Did you know that Francesco Totti played for Roma for his entire career?
</div>
<div class="active content">
<p class="pRoma">Totti was born in Roma, and he was always a big fan of the team. He always wanted to play for them. He joined the team in 1983, and he retired in 2017, solely playing for AS Roma eventhough teams like Barcelona had tried to offer him a contract.</p>
</div>
<div class="title">
<i class="dropdown icon"></i>
Did you know that AS Roma shares the Stadium with their worst rival?
</div>
<div class="content">
<p class="pRoma">Roma's biggest rival is Lazio team which are also located in Rome. Everytime there is a match between them, they give their best to prove to the city which team is better.</p>
</div>
<div class="title">
<i class="dropdown icon"></i>
Did you know that Mohamed Salah used to play for AS Roma?
</div>
<div class="content">
<p class="pRoma">Before Salah played for Liverpool, he was playing for Roma. He is an extraordinary player. He joined Roma in 2015, left for Liverpool in 2017.</p>
</div>
</div>
<br><br>
</main>
<footer class = "sixteen wide center aligned column">
<p class="pfooter">© AS ROMA - All rights reserved</p>
<p class="pfooter"><a href="mailto:20092351@mail.wit.ie" class="indexQuoteLinks">AS Roma Email</a></p>
</footer>
</div>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.js"></script>
<script src="js/accordion.js"></script>
<script language='javascript'>
$(document).ready(function(){
$('.ui.accordion').accordion();
});
</script>
<script src = "js/javaScript.js"></script>
<script src="js/lightbox.min.js"></script>
<script src="js/rollover.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.7/handlebars.min.js"></script>
<script>
anime.timeline({loop: false})
.add({
targets: '.ml15 .word',
scale: [14,1],
opacity: [0,1],
easing: "easeOutCirc",
duration: 1200,
delay: (el, i) => 800 * i
}).add({
targets: '.ml15',
opacity: 0,
duration: 1000,
easing: "easeOutExpo",
delay: 10000000000000000
});
</script>
<script>
$(document).ready(function() {
const strikers = [
{
"name":"Francesco",
"fullname":"francesco toTti",
"image":"images/totti.jpg",
"smallImage":"images/small/tottiS.jpg",
"born":"September 27, 1976",
"description":"Known as The Gladiator, one of the best players. A true Legend.",
"nationality":"Italian",
"shirt":10,
"lightbox":"ST"
},
{
"name":"Carles",
"fullname":"Carles Perez",
"image":"images/carles.jpeg",
"smallImage":"images/small/carlesS.jpg",
"born":"February 16, 1998",
"description":"Outstanding striker. Used to play for Barcelona. Joined AS Roma in the year 2020.",
"nationality":"Spanish",
"shirt":31,
"lightbox":"ST"
},
{
"name":"Edin",
"fullname":"Edin Dzeko",
"image":"images/dzeko.jpg",
"smallImage":"images/small/dzekoS.jpg",
"born":"March 17, 1986",
"description":"Excellent Striker. Always surprises the team with his goals.",
"nationality":"Bosnian",
"shirt":9,
"lightbox":"ST"
}
]
const midfielders = [
{
"name":"Henrikh",
"fullname":"Henrikh Mkhitaryan",
"image":"images/miki.jpg",
"smallImage":"images/small/mikiS.jpg",
"born":"January 21, 1989",
"description":"Super fast midfielder. Joined AS Roma in 2019.",
"nationality":"Armenian",
"shirt":77,
"lightbox":"MF"
},
{
"name":"Nicolo",
"fullname":"Nicolo Zaniolo",
"image":"images/zaniolo.jpg",
"smallImage":"images/small/zanioloS.jpg",
"born":"July 2, 1999",
"description":"Professional footballer. Joined AS Roma in 2018.",
"nationality":"Italian",
"shirt":22,
"lightbox":"MF"
},
{
"name":"Daniele",
"fullname":"Daniele De Rossi",
"image":"images/derossi.jpg",
"smallImage":"images/small/derossiS.jpg",
"born":"July 24, 1983",
"description":"Another true midfielder Legend. One of a kind player.",
"nationality":"Italian",
"shirt":16,
"lightbox":"MF"
}
]
const defenders = [
{
"name":"Federico",
"fullname":"Federico FaZio",
"image":"images/fazio.jpg",
"smallImage":"images/small/fazioS.jpg",
"born":"March 17, 1987",
"description":"Professional footballer. Fast and reliable player.",
"nationality":"Argentinian",
"shirt":20,
"lightbox":"DF"
},
{
"name":"Juan",
"fullname":"Juan Jesus",
"image":"images/juan.jpg",
"smallImage":"images/small/juanS.jpg",
"born":"Born June 10, 1991",
"description":"He will defend the pitch even if it is the last thing he does.",
"nationality":"Brazilian",
"shirt":5,
"lightbox":"DF"
},
{
"name":"Chris",
"fullname":"Chris Smalling",
"image":"images/smalling.jpg",
"smallImage":"images/small/smallingS.jpg",
"born":"November 22, 1989",
"description":"Professional player who knows what he is doing.",
"nationality":"English",
"shirt":6,
"lightbox":"DF"
}
]
const goalkeepers = [
{
"name":"Pau",
"fullname":"PaU lopez",
"image":"images/pau.jpg",
"smallImage":"images/small/pauS.jpg",
"born":"December 13, 1994",
"description":"He has had amazing saves with AS Roma team.",
"nationality":"Spanish",
"shirt":13,
"lightbox":"GK"
},
{
"name":"Antonio",
"fullname":"Antonio Mirante",
"image":"images/mirante.jpg",
"smallImage":"images/small/miranteS.jpg",
"born":"July 8, 1983",
"description":"Exceptional Goalkeeper, he will always give his all in the pitch.",
"nationality":"Italian",
"shirt":83,
"lightbox":"GK"
}
]
//custom helper
Handlebars.registerHelper('formatFullName', (names) => {
let data=names.split(" ")
let formattedname=""
for (item of data) {
formattedname+= `${item.charAt(0).toUpperCase()}${item.substring(1,).toLowerCase()} `
}
return formattedname
})
let template = Handlebars.compile($('#strikerCards').html());
let outputStrikers = template(strikers);
$('.strikersss').html(outputStrikers);
let outputMidfielders = template(midfielders);
$('.midfieldersss').html(outputMidfielders);
let outputDefenders = template(defenders);
$('.defendersss').html(outputDefenders);
let outputGoalkeepers = template(goalkeepers);
$('.goalkeepersss').html(outputGoalkeepers);
});
</script>
<script>
$(document).ready(function() {
$('.card img').css('opacity', 0.7)
$('.card img').hover(
function(){
$(this).stop().fadeTo('slow', 1)
},
function(){
$(this).stop().fadeTo('slow', 0.6)
})
lightbox.option({
'fadeDuration':1200,
'imageFadeDuration':2400,
'wrapAround': true
})
})
</script>
</body>
</html>