forked from CodingClubBITSP/Qrious-19
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathroulette.html
164 lines (159 loc) · 6.47 KB
/
roulette.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Roulette</title>
<link rel="stylesheet" type="text/css" href="css/roulette.css">
<link href="css/materialize.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Acme|Baloo+Thambi|Permanent+Marker|ZCOOL+KuaiLe" rel="stylesheet">
<link href="css/loder.css" rel="stylesheet">
</head>
<body>
<div class="fixed-action-btn click-to-toggle" style="positon:absolute;top:10px;z-index: 2;">
<a class="btn-floating btn-large" style="background-color:rgba(0,0,0,0.7);">
<i class="large material-icons" style="font-size:40px;">add_circle_outline</i>
</a>
<ul>
<li><a class="btn-floating" style="background-color:rgba(0,0,0,0.7);" href="leaderboard.html"><i class="material-icons">brightness_7</i></a></li>
<li><a class="btn-floating" style="background-color:rgba(0,0,0,0.7);" onclick="openNav()"><i class="material-icons">info</i></a></li>
<li><a class="btn-floating" style="background-color:rgba(0,0,0,0.7);" onclick="toggleFullScreen()"><i class="material-icons">fullscreen</i></a></li>
<li><a class="btn-floating" style="background-color:rgba(0,0,0,0.7);"></a></li>
</ul>
</div>
<div id="nav" class="overlay" style="z-index: 200000;">
<a href="#" class="closeBtn" onclick="closeNav()">×</a>
<div class="overlay__content">
<a href="#">About</a>
<br>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
<div class="wraper">
<div class="container">
<div id="roulette">
<img src="Images/ROULLETE156.svg">
</div>
<div id="pointer"></div>
</div>
<div class="button" onclick="rand()">START</div>
<!-- <div class="question1">
<iframe src="mythologydes.html" style="width: 100vw; height: 100vh; margin:0; border:none;"></iframe>
</div>
<div class="question2">
<iframe src="magicdes.html" style="width: 100vw; height: 100vh; margin:0; border:none;"></iframe>
</div>
<div class="question3">
<iframe src="roboticdes.html" style="width: 100vw; height: 100vh; margin:0; border:none;"></iframe>
</div>
<div class="question4">
<iframe src="gamingdes.html" style="width: 100vw; height: 100vh; margin:0; border:none;"></iframe>
</div> -->
</div>
<script type="text/javascript" src="js/materialize.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.fixed-action-btn');
var instances = M.FloatingActionButton.init(elems, {
direction: 'left',
hoverEnabled: false
});
});
var question1 = document.getElementsByClassName('question1')[0];
var question2 = document.getElementsByClassName('question2')[0];
var question3 = document.getElementsByClassName('question3')[0];
var question4 = document.getElementsByClassName('question4')[0];
// var top = document.getElementById('roulette').getBoundingClientRect().top;
// document.getElementById('pointer').style.top = top +"px";
function rand(){
var random = Math.floor(Math.random()*4);
var choice = Math.floor(Math.random()*2);
console.log(random);
if(random == 0){
if(choice == 0){
document.getElementById('roulette').style.transform = "rotate(2497.5deg)";
}
else{
document.getElementById('roulette').style.transform = "rotate(2677.5deg)";
}
setTimeout(function(){
window.location.href="mythologydes.html";
// question1.style.transform = "scale(1)";
},5500);
}
else if(random == 1){
if(choice == 0){
document.getElementById('roulette').style.transform = "rotate(2632.5deg)";
}
else{
document.getElementById('roulette').style.transform = "rotate(2812.5deg)";
}
setTimeout(function(){
window.location.href="magicdes.html";
},5500)
}
else if(random == 2){
if(choice == 0){
document.getElementById('roulette').style.transform = "rotate(2587.5deg)";
}
else{
document.getElementById('roulette').style.transform = "rotate(2767.5deg)";
}
setTimeout(function(){
window.location.href="roboticdes.html";
// question3.style.transform = "scale(1)";
},5500)
}
else if(random == 3){
if(choice == 0){
document.getElementById('roulette').style.transform = "rotate(2542.5deg)";
}
else{
document.getElementById('roulette').style.transform = "rotate(2722.5deg)";
}
setTimeout(function(){
window.location.href="gamingdes.html";
// question4.style.transform = "scale(1)";
},5500)
}
console.log(random);
}
function stop() {
document.getElementById('roulette').classList.add('second');
}
function openNav()
{
document.getElementById('nav').style.height = "100%";
}
function closeNav()
{
document.getElementById('nav').style.height = "0%";
}
function toggleFullScreen() {
if ((document.fullScreenElement && document.fullScreenElement !== null) ||
(!document.mozFullScreen && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
}
</script>
</body>
</html>