-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
66 lines (46 loc) · 1.96 KB
/
script.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// hide or show the menu divs
$('.start-btn').click( function() {
$("#home").removeClass("show");
$("#home").addClass("hidden");
$("#enarksi").addClass("show");
console.log("start");
} );
$('.about-btn').click( function() {
$("#home").removeClass("show");
$("#home").addClass("hidden");
$("#about").addClass("show");
console.log("about");
} );
$('.credits-btn').click( function() {
$("#home").addClass("hidden");
$("#home").removeClass("show");
$("#credits").addClass("show");
console.log("credits");
} );
$('.back').click( function() {
$("#home").removeClass("hidden");
$("#home").addClass("show");
$("#enarksi").removeClass("show");
$("#about").removeClass("show");
$("#credits").removeClass("show");
console.log("back");
} );
// loop title images
const timer = ms => new Promise(res => setTimeout(res, ms)) // create a timer
//arrays with images
var enarksii = ["images/enarksi2.png" , "images/enarksi3.png", "images/enarksi4.png", "images/enarksi5.png", "images/enarksi1.png"];
var credd = ["images/cred2.png" , "images/cred3.png", "images/cred4.png", "images/cred5.png", "images/cred.png", "images/cred6.png"];
var logoo = ["images/18m1.png" ,"images/18m2.png" ,"images/18m3.png" ,"images/18m5.png" ,"images/18m6.png" ];
var pouu = ["images/pou1.png" ,"images/pou2.png" ,"images/pou3.png" ,"images/pou4.png" ];
var startt = ["images/start.png" ,"images/start2.png" ,"images/start3.png" ,"images/start4.png","images/start5.png" ];
// PARALLAX MOVING BACKGROUND
$(document).ready(function(){
$('body').mousemove(function(e){
var pageX; // get mouse coordinates
var pageY;
var amountMovedX = (e.pageX * -1 / 10); // divide them to get smaller number
var amountMovedY = (e.pageY * -1 / 10);
$('.values').html("<div>" + amountMovedX + 'px ' + amountMovedY + 'px' + "</div>");
$(this).css('background-position',amountMovedX+'px '+amountMovedY+'px'); // move the background image
});
});