-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathend.js
42 lines (30 loc) · 1.84 KB
/
end.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
let victoryEmblem = document.getElementById('victoryEmblem')
let playerInstructions = document.getElementById('playerInstructions')
let coatOfArms = document.getElementById('coatOfArms')
let victor = JSON.parse (sessionStorage.getItem('victor'))
console.log(victor.stats.name)
switch (victor.stats.name) {
case "Jon Snow":
victoryEmblem.setAttribute('src', "img/victory emblem jon.svg")
playerInstructions.innerText = `You “${victor.stats.name}”, Alone survived the journey North`
coatOfArms.setAttribute('src', "img/Shild Wolf.svg")
break;
case "Daenerys Targaryen":
victoryEmblem.setAttribute('src', "img/victory emblem dyneris.svg")
playerInstructions.innerText = `You “${victor.stats.name}”, Alone survived the journey North`
coatOfArms.setAttribute('src', "img/Shild Dragon.svg")
break;
case "Tyrion Lannister":
victoryEmblem.setAttribute('src', "img/victory emblem tyrian.svg")
playerInstructions.innerText = `You “${victor.stats.name}”, Alone survived the journey North`
coatOfArms.setAttribute('src', "img/Shild Lion.svg")
break;
case "Brienne of Tarth":
victoryEmblem.setAttribute('src', "img/victory emblem brian.svg")
playerInstructions.innerText = `You “${victor.stats.name}”, Alone survived the journey North`
coatOfArms.setAttribute('src', "img/Shild Dear.svg")
break;
}
document.getElementById('playButton').addEventListener('click', e =>{
window.location.href = "index.html"
})