You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
HTML
51 lines
1.3 KiB
HTML
4 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="en-US">
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||
|
<title>final test</title>
|
||
|
<link rel="icon" href="imgs/avatars/ball2.gif">
|
||
|
</head>
|
||
|
<body>
|
||
|
Hello <span id="player_name"></span> (<span id="player_img"></span>).
|
||
|
This is the end. In your journey you visited:
|
||
|
<div id="park_info" style="display:none;">
|
||
|
The park
|
||
|
</div>
|
||
|
<div id="newspaper_info" style="display:none;">
|
||
|
The newspaper
|
||
|
</div>
|
||
|
<script>
|
||
|
|
||
|
//player name
|
||
|
document.querySelector('#player_name').innerHTML =localStorage.playerName;
|
||
|
|
||
|
//player img
|
||
|
var img = document.createElement("img");
|
||
|
img.src = localStorage.myavatar;
|
||
|
var player_img = document.querySelector("#player_img");
|
||
|
player_img.appendChild(img);
|
||
|
|
||
|
//checks story development
|
||
|
|
||
|
window.onload = function (){
|
||
|
var park = document.querySelector("#park_info");
|
||
|
var news = document.querySelector("#newspaper_info");
|
||
|
|
||
|
if (localStorage.park === "opened" ) {
|
||
|
console.log ("park:",localStorage.park);
|
||
|
park.style.display ="block";
|
||
|
}
|
||
|
|
||
|
if (localStorage.newspaper === "opened" ) {
|
||
|
console.log ("newspaper:",localStorage.newspaper);
|
||
|
news.style.display ="block";
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
</script>
|
||
|
<script type="text/javascript" src="index.js" ></script>
|
||
|
|
||
|
</body>
|