-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
135 lines (100 loc) · 3.67 KB
/
script.js
File metadata and controls
135 lines (100 loc) · 3.67 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
$(document).ready(function(){
$('ul li').click(function(){
// This function will be called every time one of the tabs is clicked
var clicked_tab = $(this);
// TODO Complete the next line to add the active class to the clicked tab:
clicked_tab.addClass('active');
// TODO Complete the next line to remove the active class from the rest:
clicked_tab.parent().children('li').not(clicked_tab).removeClass('active');
});
var carousel = $(".carousel"),
currdeg = 0;
$(".next").on("click", { d: "n" }, rotate);
$(".prev").on("click", { d: "p" }, rotate);
function rotate(e){
if(e.data.d=="n"){
currdeg = currdeg - 60;
}
if(e.data.d=="p"){
currdeg = currdeg + 60;
}
carousel.css({
"-webkit-transform": "rotateY("+currdeg+"deg)",
"-moz-transform": "rotateY("+currdeg+"deg)",
"-o-transform": "rotateY("+currdeg+"deg)",
"transform": "rotateY("+currdeg+"deg)"
});
}
;(function(){ // Final page transition code
var animation = false,
animationstring = 'animation',
keyframeprefix = '',
domPrefixes = 'Webkit Moz O ms Khtml'.split(' '),
pfx = '',
elm = document.createElement('div');
if( elm.style.animationName !== undefined ) { animation = true; }
if( animation === false ) {
for( var i = 0; i < domPrefixes.length; i++ ) {
if( elm.style[ domPrefixes[i] + 'AnimationName' ] !== undefined ) {
pfx = domPrefixes[ i ];
animationstring = pfx + 'Animation';
keyframeprefix = '-' + pfx.toLowerCase() + '-';
animation = true;
break;
}
}
}
var minloadingtime = 50;
var maxloadingtime = 100;
var startTime = new Date()
var elapsedTime
var dismissonloadfunc, maxloadingtimer
if (animation && document.documentElement && document.documentElement.classList){
document.documentElement.classList.add('hidescrollbar')
window.addEventListener('load', dismissonloadfunc = function(){ // when page loads
clearTimeout(maxloadingtimer) // cancel dismissal of transition after maxloadingtime time
elapsedTime = new Date() - startTime // get time elapsed once page has loaded
var hidepageloadertimer = (elapsedTime > minloadingtime)? 0 : minloadingtime - elapsedTime
setTimeout(function(){
}, hidepageloadertimer)
setTimeout(function(){
document.documentElement.classList.remove('hidescrollbar')
}, hidepageloadertimer + 100) // 100 is the duration of the fade out effect
}, false)
maxloadingtimer = setTimeout(function(){ // force dismissal of page transition after maxloadingtime time
window.removeEventListener('load', dismissonloadfunc, false) // cancel onload event function call
document.getElementById('pageloader').classList.add('dimissloader') // dismiss transition
setTimeout(function(){
document.documentElement.classList.remove('hidescrollbar')
}, 100) // 100 is the duration of the fade out effect
}, maxloadingtime)
}
else{
document.getElementById('pageloader').style.display = 'none'
}
})();
window.addEventListener("beforeunload", function () {
document.body.classList.add("animate-out");
});
function myTimer(){
var points = document.getElementById("house").innerHTML;
var points2 = document.getElementById("house").innerHTML;
var min = Math.ceil(1000);
var max = Math.floor(3000);
var min1 = Math.ceil(100);
var max1 = Math.floor(300);
var bad = Math.floor(Math.random() * (max1 - min1)) + min1;
var val = Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
document.getElementById("house").innerHTML = parseInt(points,10) + val;
}
setInterval(myTimer, 1000);
});
/*
<div id="pageloader">
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
</div>
*/