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.

138 lines
4.1 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>chemtrails</title>
<link rel="icon" href="imgs/pleiadian_s/planet7.gif">
<link rel="stylesheet" href="major_house.css">
</head>
<body >
<div id="ground_color"></div>
<div id="groundline" ></div>
<div id="ground">
<div class="duo">
<span id="player_img"></span>
<img id="pat" src="imgs/cat_shelter/parrot.gif" height="100px">
</div>
<img id="tree1" src="imgs/cat_shelter/tree.gif" height="160px">
<img id="tree2" src="imgs/cat_shelter/tree.gif"height="160px">
<img id="tree3" src="imgs/cat_shelter/tree.gif" height="160px">
<img id="tree4" src="imgs/cat_shelter/tree.gif" height="160px">
<img id="tree5"src="imgs/cat_shelter/tree.gif" height="160px">
<div class="bubble1" style="display: none;">Hello <span id="player_name"></span>, your enlightened spirit guided you here.</div>
<div class="bubble2" style="display: none;">We can sense that you are looking for something beyond your habits and understanding. We are happy to meet you. </div>
<div class="bubble3" style="display: none;">We are the beings of light. We don't belong to this planet.</div>
<div class="bubble4" style="display: none;">We can sense the other beings and planet's energetic state. A heinous crime is shaking this land's vibration.</div>
<div class="bubble5" style="display: none;">This darkness will soon spread to other planets. We came here as messengers, to help you elevate your soul and find the courage to fight evil.</div>
<div class="text_container" >
<div class="message1">
<span class="instructions"><span class="instructions_arrow"></span> </span>
</div>
<div class="message2" style="display: none;">
</div>
<div class="message3" style="display: none;">
</div>
</div>
<script src="jquery.min.js"></script>
<script>
// saves game step in the local storage
window.onload = function() {
window.localStorage.setItem("pleiadians","opened");
console.log ("pleiadians:",localStorage.pleiadians);
}
//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;
//adjust camera scroll
var $div = $('.duo');
var screenLeftMin = 50;
var screenLeftMax = 700;
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)
}
}
//move the character
$(document).keydown(function(e) {
var offset = $div.position();
console.log("offset:", offset);
switch (e.which) {
case 37:
offset.left -= 20;
console.log("left");
$div.addClass("flipped");
break;
case 39:
offset.left += 20;
console.log("right");
$div.removeClass("flipped");
break;
}
//check the offset and prevent the character to exceed the screen dimension
if (offset.left < 80) {
offset.left = 80;
}
if (offset.left > $("#ground").width() - 700) {
$(".message1").hide();
$(".message2").show();
}
if (offset.left > $("#ground").width() - 80) {
offset.left = $("#ground").width() - 80;
}
$div.css("left", offset.left);
$div.css("top", offset.top);
e.preventDefault();
adjustScroll();
})
</script>
<script type="text/javascript" src="index.js" ></script>
</body>