master
*anna* 3 years ago
parent 2863cfbb47
commit bd60946c9f

BIN
tree/imgs/.DS_Store vendored

Binary file not shown.

Binary file not shown.

@ -33,6 +33,16 @@
}
.instructions{
font-family:jolyregularitalic
}
body.park_body{
overflow: hidden;
}
::-moz-selection { /* Code for Firefox */
background: transparent;
}
@ -41,7 +51,7 @@
}
#player_img {
bottom: 25%;
bottom: 20%;
left: 15%;
position:absolute ;
z-index: 20;
@ -254,7 +264,7 @@ span.button_text{
#bench {
bottom: 35%;
bottom: 30%;
left: 8%;
position: absolute;
z-index:18;
@ -268,20 +278,20 @@ span.button_text{
}
#tree2 {
bottom:45%;
left: 4%;
left: 3%;
position: absolute;
z-index:16;
}
#tree3 {
bottom:50%;
left: 25%;
left: 28%;
position: absolute;
z-index:2;
}
#newspaperimg {
bottom: 43%;
left: 10%;
bottom: 38%;
left: 9.5%;
position: absolute;
z-index:19;
}
@ -294,14 +304,14 @@ span.button_text{
#flower2{
bottom: 38%;
left: 4%;
left: 2%;
position: absolute;
z-index:17;
}
#flower3{
bottom: 80%;
left: 30%;
bottom: 30%;
left: 25%;
position: absolute;
z-index:17;
}
@ -320,48 +330,154 @@ span.button_text{
#grass1{
bottom: 30%;
left: 30%;
left: 40%;
position: absolute;
z-index:17;
}
#grass2{
bottom: 60%;
left: 55%;
bottom: 65%;
left: 45%;
position: absolute;
z-index:17;
}
#statue{
bottom: 70%;
left: 43%;
left: 60%;
position: absolute;
z-index:17;
}
#tree4{
bottom: 25%;
left: 50%;
left: 70%;
position: absolute;
}
#flower6{
bottom: 30%;
left: 70%;
bottom: 65%;
left: 72%;
position: absolute;
}
#flower7{
bottom: 50%;
left: 55%;
position: absolute;
}
#flower8{
bottom: 30%;
left: 95%;
position: absolute;
}
#dog{
bottom: 27%;
left: 54%;
bottom: 32%;
left: 50%;
position: absolute;
z-index:17;
}
#tree5{
bottom: 50%;
left: 90%;
position: absolute;
}
/* fries kiosk*/
#kiosk{
bottom: 70%;
left: 70%;
bottom: 60%;
left: 20%;
position: absolute;
}
.bubble1 {
bottom: 80%;
left: 13%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 1.2vw;
line-height: 3.5vw;
text-align: center;
width: 14vw;
height: 4vw;
border-radius: 13px;
padding: 0px;
border: 1px black solid;
}
.bubble1:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-width: 0 30px 24px 0;
border-color: transparent #ffffff transparent transparent;
bottom: -24px;
left: 83%;
margin-left: -15px;
}
.bubble1:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-width: 0 31px 25px 0;
border-color: transparent #000000 transparent transparent;
bottom: -26px;
left: 83%;
margin-left: -15px;
display: block;
}
.bubble2 {
z-index: 1;
bottom: 75%;
left: 26.5%;
position: absolute;
background: #ffffff;
color: #000000;
font-family:sinistre;
font-size: 1.2vw;
line-height: 1.5vw;
text-align: center;
width: 16vw;
height: 6vw;
border-radius: 13px;
padding: 1vw;
border: #000000 solid 1px;
}
.bubble2:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 2;
border-style: solid;
border-width: 24px 30px 0 0;
border-color: #ffffff transparent transparent transparent;
bottom: -24px;
left: 17%;
margin-left: -15px;
}
.bubble2:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-width: 25px 31px 0 0;
border-color: #000000 transparent transparent transparent;
bottom: -26px;
left: 17%;
margin-left: -16px;
display: block;
}

@ -8,7 +8,7 @@
<link rel="stylesheet" href="park.css">
</head>
<body>
<body class="park_body">
<!--baloons -->
<div class="baloons_all">
<div class="comment1stpage baloons"id="baloon1" style="display: none;">
@ -89,7 +89,6 @@
<div class="school5" style="display:none;">
<p class="news_title">Pleasant valley is showing excitement for the opening of the concert season</p>
Tonight the Pleasant Valley's arena will be happy to welcome the singer and performer Avril Lavigne who will open the new season of concerts. Tickets are still available at the town hall.
You were supposed to go to the concert with Amanda tonight. Probably she went to take the tickets before the meeting and she got stuck in the queue. Maybe is good to wait for her a bit longer.
<p class="news_author">by Pleasant valley's major</p>
</div>
@ -100,10 +99,12 @@
</div>
</div>
<div id="groundline"></div>
<div id="ground">
<div id="player_img"></div>
<div id="player_img" ></div>
<img id="bench" src="imgs/park/bench1.gif" height="20%">
<img id="tree1" src="imgs/park/tree1.gif" height="30%">
<img id="tree2" src="imgs/park/tree4.gif" height="25%">
@ -115,81 +116,44 @@
<img id="flower4" src="imgs/park/flower1.1.gif" height="5%">
<img id="flower5" src="imgs/park/flower1.gif" height="5%">
<img id="grass1" src="imgs/park/grass1.gif" height="75vw">
<img id="grass2" src="imgs/park/grass1.gif" height="75vw">
<img id="statue" src="imgs/park/statue.gif" height="20%">
<img id="tree4" src="imgs/park/tree4.gif" height="25%">
<img id="flower6" src="imgs/park/flower1.1.gif" height="5%">
<img id="dog" src="imgs/park/dog1.gif" height="10%">
<img id="kiosk" src="imgs/park/stand3.gif" height="20%">
<img id="kiosk" src="imgs/park/stand3.gif" height="22%" style="display: none;">
<div class="comic_div" style="display: none;" >
<div class="bubble1">Sorry, no fries today</div>
<div class="bubble2">I went to the market this early morning but it seems like someone had already bought all the potatoes</div> </div>
</div>
<div class="text_container">
<div class="message1">
Hello <span id="player_name"> </span> . It's Saturday morning. You are at the park waiting for your friend Amanda. She seems to be really late.
You spot a copy of today's newspaper on the bench close to you. Maybe you want to <button class="open_newspaper_index"><span class="button_text">give it a read</span></button> . You can also <button onclick="location.href='park_dream.html';"><span class="button_text">go for a little walk</span></button> or just <button id="wait_for_amanda"><span class="button_text">wait for Amanda</span></button>.
You spot a copy of today's newspaper on the bench close to you. Maybe you want to <button class="open_newspaper_index"><span class="button_text">give it a read</span></button> . You can also <button onclick="location.href='park_dream.html';"><span class="button_text">go for a little walk</span></button> or just <button class="wait_for_amanda"><span class="button_text">wait for Amanda</span></button>.
</div>
<div class="message2" style="display:none;">
The situation at the school looks serious. The person who left the annotated newspaper cannot be too far: they might know what is going on. <button onclick="location.href='park_N.html';"><span class="button_text">Look for them in the park</span></button> .
</div>
<div class="message3" style="display:none;">
You can try to <button onclick="location.href='cat_shelter.html';"><span class="button_text">look for Amanda at the cat shelter</span></button> . It can also be that she already went to purchase the tickets but she got stuck in the queue. It might be good to <button id="wait_for_amanda"><span class="button_text">wait for her</span></button> a bit longer.
You can try to <button onclick="location.href='cat_shelter.html';"><span class="button_text">look for Amanda at the cat shelter</span></button> . It can also be that she already went to purchase the tickets but she got stuck in the queue. It might be good to <button class="wait_for_amanda"><span class="button_text">wait for her</span></button> a bit longer.
</div>
<div class="message4" style="display:none;">
It looks like Amanda is not able to join you.
There is a nice kiosk close by: <button id="fries"><span class="button_text">go there to get fries</span></button> . You can still <button class="open_newspaper_index"><span class="button_text">have a look at the news</span></button> or <button onclick="location.href='park_dream.html';"><span class="button_text">go for a walk</span></button> .
</div>
<div class="message5 instructions" style="display:none;">
Click on the kiosk to get the fries.
</div>
<div class="message6" style="display:none;">
Pity! It looks like you are left with no option but to <button onclick="location.href='park_dream.html';"><span class="button_text">go for a walk</span></button> .
</div>
</div>
</div>
<script src="jquery.min.js"></script>
<script>
// player moves
var $div = $('#player_img');
var screenLeftMin = 200;
var screenLeftMax = 870;
function adjustScroll() {
var playerLeft = parseInt($div.css("left"));
var scrollLeft = $(document).scrollLeft();
var screenLeft = playerLeft - scrollLeft;
console.log ("screenleft:", screenLeft);
if (screenLeft > screenLeftMax ) {
$(document).scrollLeft(playerLeft - screenLeftMax)
}
if (screenLeft < screenLeftMin ) {
$(document).scrollLeft(playerLeft - screenLeftMin)
}
}
$(document).keydown(function(e) {
switch (e.which) {
case 37:
$div.css('left', $div.offset().left - 20);
e.preventDefault();
adjustScroll();
break;
case 38:
$div.css('top', $div.offset().top - 20);
break;
case 39:
$div.css('left', $div.offset().left + 20);
e.preventDefault();
adjustScroll();
break;
case 40:
$div.css('top', $div.offset().top + 20);
break;
}
})
//get player avatar from local storage
console.log (localStorage.myavatar)
var img = document.createElement("img");
@ -252,10 +216,12 @@ $(document).keydown(function(e) {
$("#baloon2").show();
$(".message2").show();
});
$("#wait_for_amanda").click (function(){
$(".wait_for_amanda").click (function(){
$(".message3").hide();
$(".message1").hide();
$("#newspaper,#baloon1, #baloon2, #baloon3, #baloon4, .close").hide();
$(".message4").show();
});
$(".close").click (function(){
@ -271,6 +237,20 @@ $(document).keydown(function(e) {
$(".message4").show();
});
$("#fries").click (function(){
$("#newspaper, .message4").hide();
$(".message5, #kiosk ").show();
});
$("#kiosk").click (function(){
$(".message5").hide();
$(".comic_div").toggle();
$(".message6").show();
});
</script>

@ -30,7 +30,9 @@
</div>
<div class="text_container">
move
<div class="message1 instructions">
Move around the park with the arrows ←↑↓→ and click on the people to talk with them.
</div>
</div>

@ -0,0 +1,218 @@
<!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>park_dream</title>
<link rel="icon" href="imgs/park/flower2.gif">
<link rel="stylesheet" href="park.css">
</head>
<body>
<div id="groundline"></div>
<div id="ground">
<div id="player_img"></div>
<img id="bench" src="imgs/park/bench1.gif" height="20%">
<img id="tree1" src="imgs/park/tree1.gif" height="30%">
<img id="tree2" src="imgs/park/tree4.gif" height="25%">
<img id="tree3" src="imgs/park/tree4.gif" height="25%">
<img id="newspaperimg" src="imgs/park/newspaper2.gif" height="7%">
<img id="flower1" src="imgs/park/flower1.gif" height="5%">
<img id="flower2" src="imgs/park/flower3.gif" height="7%">
<img id="flower3" src="imgs/park/flower3.1.gif" height="6%">
<img id="flower4" src="imgs/park/flower1.1.gif" height="5%">
<img id="flower5" src="imgs/park/flower1.gif" height="5%">
<img id="grass1" src="imgs/park/grass1.gif" height="75vw">
<img id="grass2" src="imgs/park/grass1.gif" height="75vw">
<img id="statue" src="imgs/park/statue.gif" height="22%">
<img id="tree4" src="imgs/park/tree4.gif" height="25%">
<img id="flower6" src="imgs/park/flower1.1.gif" height="5%">
<img id="flower7" src="imgs/park/flower3.1.gif" height="6%">
<img id="flower8" src="imgs/park/flower3.1.gif" height="6%">
<img id="dog" src="imgs/park/dog1.gif" height="12%">
<img id="tree5" src="imgs/park/tree1.gif" height="30%">
</div>
<div class="text_container">
<div class="message1">
hello
</div>
</div>
</div>
<script src="jquery.min.js"></script>
<script>
// player moves
var $div = $('#player_img');
var screenLeftMin = 200;
var screenLeftMax = 870;
var screenTopMin = 202;
var screenTopMax = 450;
function adjustScroll() {
var playerLeft = parseInt($div.css("left"));
var scrollLeft = $(document).scrollLeft();
var screenLeft = playerLeft - scrollLeft;
console.log ("screenleft:", screenLeft);
var playerTop = parseInt($div.css("top"));
var scrollTop = $(document).scrollTop();
var screenTop = playerTop - scrollTop;
console.log ("screentop:", screenTop);
if (screenLeft > screenLeftMax ) {
$(document).scrollLeft(playerLeft - screenLeftMax)
}
if (screenLeft < screenLeftMin ) {
$(document).scrollLeft(playerLeft - screenLeftMin)
}
if (screenTop > screenTopMax ) {
$(document).scrollTop(playerTop - screenTopMax)
}
if (screenTop < screenTopMin ) {
$(document).scrollTop(playerTop - screenTopMin)
}
}
$(document).keydown(function(e) {
switch (e.which) {
case 37:
$div.css('left', $div.offset().left - 20);
e.preventDefault();
adjustScroll();
break;
case 38:
$div.css('top', $div.offset().top - 20);
break;
case 39:
$div.css('left', $div.offset().left + 20);
e.preventDefault();
adjustScroll();
break;
case 40:
$div.css('top', $div.offset().top + 20);
break;
}
})
//get player avatar from local storage
console.log (localStorage.myavatar)
var img = document.createElement("img");
img.src = localStorage.myavatar;
var player_img = document.querySelector("#player_img");
player_img.appendChild(img);
//get player name from local storage
document.querySelector('#player_name').innerHTML =localStorage.playerName;
//store that you've been in the park
window.onload = function() {
window.localStorage.setItem("park","opened")
console.log ("park:",localStorage.park)
}
// open newspaper
$(".open_newspaper_index").click (function(){
$("#newspaper, .close").toggle();
//saves that u opened the newspaper in the local storage
window.localStorage.setItem("newspaper","opened")
console.log ("newspaper:",localStorage.newspaper)
});
//newspaper pages
$("#arrow_go1").click (function(){
$(".index, .school1, .message1, .message4 ").hide();
$(".school2, .school3, #baloon1, #baloon2, .message2").show();
});
$("#arrow_back1").click (function(){
$("#baloon1, #baloon2, #baloon3, #baloon4, .school2,.school3, .message2").hide();
$(".index, .school1, .message4").show();
});
$("#arrow_go2").click (function(){
$(".school2").hide();
$(".school3").hide();
$("#baloon1").hide();
$("#baloon2").hide();
$(".message2").hide();
$(".school4").show();
$(".school5").show();
$("#baloon3").show();
$("#baloon4").show();
$(".message3").show();
});
$("#arrow_back2").click (function(){
$(".school4").hide();
$(".school5").hide();
$("#baloon3").hide();
$("#baloon4").hide();
$(".message3").hide();
$(".school2").show();
$(".school3").show();
$("#baloon1").show();
$("#baloon2").show();
$(".message2").show();
});
$("#wait_for_amanda").click (function(){
$(".message3").hide();
$(".message1").hide();
$(".message4").show();
});
$(".close").click (function(){
$("#newspaper").hide();
$(".close").hide();
$("#baloon1").hide();
$("#baloon2").hide();
$("#baloon3").hide();
$("#baloon4").hide();
$(".message1").hide();
$(".message2").hide();
$(".message3").hide();
$(".message4").show();
});
$("#fries").click (function(){
$("#newspaper, .message4").hide();
$(".message5").show();
});
$("#kiosk").click (function(){
$(".chat_fries").toggle();
});
</script>
<script type="text/javascript" src="index.js" ></script>
</body>
Loading…
Cancel
Save