-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
196 lines (145 loc) · 6.09 KB
/
index.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Sphere vs Gravity</title>
<link rel="stylesheet" href="./css/style.css" type="text/css" />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<link rel="icon" type="image/png" href="./assets/icons/256.png" />
<meta name="description" content="Free to play 3D Platformer.">
<meta name="keywords" content="3D Platformer, Free to Play,html5, threejs,webgl,webgl2,webgpu,steam, Sphere vs Gravity, Game, Fun, Platform Game" />
<meta property="og:title" content="Sphere vs Gravity" />
<meta property="og:description" content="Free to play 3D Platformer." />
<meta property="og:image" content="https://sphere-vs-gravity.online/css/og.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:url" content="https://sphere-vs-gravity.online/" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://sphere-vs-gravity.online/css/og.png" />
</head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7XJ9SFJJW6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7XJ9SFJJW6');
</script>
<body id="body">
<span id="ballPostion"></span>
<span class="centered"></span>
<!-- loading -->
<div id="loading">
<div class="spinner"></div>
</div>
<button id="start_button">PLAY</button>
<a href="#" id="youtube-link">
<img src="./assets/icons/youtube-icon.svg" alt="Watch on YouTube" />
<span>Watch Gameplay</span>
</a>
<!-- Modal structure -->
<div id="youtube-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<iframe id="youtube-video" width="853" height="505" src="" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
</div>
<script>// Get the modal, link, and close button
const modal = document.getElementById("youtube-modal");
const youtubeLink = document.getElementById("youtube-link");
const closeBtn = document.querySelector(".close");
const youtubeVideo = document.getElementById("youtube-video");
// YouTube video URL (with autoplay)
const videoURL = "https://www.youtube.com/embed/H4wJatV_hW8?vq=hd720p?autoplay=1";
// When the user clicks the link, open the modal and embed the video
youtubeLink.onclick = function(e) {
e.preventDefault();
modal.style.display = "block";
youtubeVideo.src = videoURL;
}
// When the user clicks the close button, hide the modal and stop the video
closeBtn.onclick = function() {
modal.style.display = "none";
youtubeVideo.src = ""; // Stop video
}
// When the user clicks anywhere outside the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
youtubeVideo.src = ""; // Stop video
}
}
</script>
<button id="fullscreen-btn" class="js-toggle-fullscreen-btn toggle-fullscreen-btn" aria-label="Enter fullscreen mode" >
<svg class="toggle-fullscreen-svg" width="28" height="28" viewBox="-2 -2 28 28">
<g class="icon-fullscreen-enter">
<path d="M 2 9 v -7 h 7" />
<path d="M 22 9 v -7 h -7" />
<path d="M 22 15 v 7 h -7" />
<path d="M 2 15 v 7 h 7" />
</g>
<g class="icon-fullscreen-leave">
<path d="M 24 17 h -7 v 7" />
<path d="M 0 17 h 7 v 7" />
<path d="M 0 7 h 7 v -7" />
<path d="M 24 7 h -7 v -7" />
</g>
</svg>
</button>
<div id="container"> </div>
<script src="./js/fullscreen_button.js"></script>
<script type="module" src="./js/initThree.js"> </script>
</body>
</html>
<!--
<style>
.control-container {
width: 200px; /* Reduced fixed width */
height: 300px; /* Reduced fixed height */
border: solid 1px black;
position: absolute;
bottom: 20px;
left: 20px;
display: grid;
grid-template-areas:
"up-left up up-right"
"left center right"
"down-left down down-right";
gap: 10px; /* Reduced gap between buttons */
}
.control-button {
width: 50px; /* Reduced fixed width for buttons */
height: 50px; /* Reduced fixed height for buttons */
background-color: rgba(0, 0, 0, 0.5);
border-radius: 10%;
color: white;
user-select: none;
opacity: 0.5;
}
#gamepad {
pointer-events: none;
opacity: 0.0;
}
#up-button { grid-area: up; }
#down-button { grid-area: down; }
#left-button { grid-area: left; }
#right-button { grid-area: right; }
#up-left-button { grid-area: up-left; }
#up-right-button { grid-area: up-right; }
#down-left-button { grid-area: down-left; }
#down-right-button { grid-area: down-right; }
#center-button { grid-area: center; visibility: hidden; } /* Hidden button to maintain grid structure */
</style>
-->
<!-- <div class="control-container">
<img id="gamepad" style="position: absolute ; width: 100%; height: 100%; z-index: 1;" src = "./assets/icons/gamepad.svg" alt="My Happy SVG" "/>
<div id="up-left-button" class="control-button">↖</div>
<div id="up-button" class="control-button">↑</div>
<div id="up-right-button" class="control-button">↗</div>
<div id="left-button" class="control-button">←</div>
<div id="center-button" class="control-button"></div>
<div id="right-button" class="control-button">→</div>
<div id="down-left-button" class="control-button">↙</div>
<div id="down-button" class="control-button">↓</div>
<div id="down-right-button" class="control-button">↘</div>
</div> -->