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.
88 lines
1.7 KiB
JavaScript
88 lines
1.7 KiB
JavaScript
4 years ago
|
|
||
4 years ago
|
|
||
4 years ago
|
// all jQuery stuff here
|
||
4 years ago
|
|
||
|
$(document).ready(function() {
|
||
4 years ago
|
//newspaper passage iframes
|
||
4 years ago
|
$(document).on('click', '#paper_1', function(){
|
||
|
$("#readme_1").show();
|
||
4 years ago
|
});
|
||
4 years ago
|
$(document).on('click', '#paper_2', function(){
|
||
|
$("#readme_2").show();
|
||
|
});
|
||
|
$(document).on('click', '#paper_3', function(){
|
||
|
$("#readme_3").show();
|
||
4 years ago
|
});
|
||
4 years ago
|
$(document).on('click', '#paper_4', function(){
|
||
|
$("#readme_4").show();
|
||
|
});
|
||
|
|
||
|
});;
|
||
|
|
||
4 years ago
|
|
||
4 years ago
|
$(document).ready(function() {
|
||
4 years ago
|
//switch story divs
|
||
4 years ago
|
$("#switchTo2_newspaper").click (function(){
|
||
|
$("#2_park_newspaper").show();
|
||
|
$("#1_park").hide();
|
||
|
});
|
||
4 years ago
|
|
||
4 years ago
|
$("#switchTo1_news").click (function(){
|
||
|
$("#1_park").show();
|
||
|
$("#2_park_newspaper").hide();
|
||
|
$("#readme_1,#readme_2,#readme_3,#readme_4").hide();
|
||
|
});
|
||
4 years ago
|
|
||
4 years ago
|
$("#switchTo2_walk").click (function(){
|
||
|
$("#2_park_walk").show();
|
||
|
$("#1_park").hide();
|
||
4 years ago
|
$("#gardenSpace").show();
|
||
|
|
||
4 years ago
|
});
|
||
4 years ago
|
|
||
4 years ago
|
$("#switchTo1_walk").click (function(){
|
||
|
$("#2_park_walk").hide();
|
||
|
$("#1_park").show();
|
||
4 years ago
|
$("#gardenSpace").hide();
|
||
|
});
|
||
|
|
||
|
//readme 1 salmonRoll
|
||
|
$('.readme').hover(
|
||
|
function(){ $('.salmonRoll1').addClass('pink')},
|
||
|
function(){ $('.salmonRoll1').removeClass('pink')
|
||
4 years ago
|
});
|
||
4 years ago
|
|
||
4 years ago
|
|
||
4 years ago
|
|
||
|
// garden moving box
|
||
|
var pane = $('#pane'),
|
||
|
box = $('#square'),
|
||
|
w = pane.width() - box.width(),
|
||
|
d = {},
|
||
|
x = 3;
|
||
|
|
||
|
function newv(v,a,b) {
|
||
|
var n = parseInt(v, 10) - (d[a] ? x : 0) + (d[b] ? x : 0);
|
||
|
return n < 0 ? 0 : n > w ? w : n;
|
||
|
}
|
||
|
|
||
|
$(window).keydown(function(e) { d[e.which] = true; });
|
||
|
$(window).keyup(function(e) { d[e.which] = false; });
|
||
|
|
||
|
setInterval(function() {
|
||
|
box.css({
|
||
|
left: function(i,v) { return newv(v, 37, 39); },
|
||
|
top: function(i,v) { return newv(v, 38, 40); }
|
||
|
});
|
||
|
}, 20);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
4 years ago
|
});;
|
||
4 years ago
|
|