-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom.html
257 lines (237 loc) · 8.05 KB
/
random.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Page with Animations</title>
<link href="style1.css" rel="stylesheet" type="text/css">
<style>
body {
font-family: Dosis, 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
button {
font-family: Dosis, 'Arial', sans-serif;
background-color: #855CD6;
color: #fff;
text-align: center;
font-size: 24px;
text-shadow: -1px -1px 0 #000, 0px -1px 0 #000, 1px -1px 0 #000, -1px 0px 0 #000, 1px 0px 0 #000, -1px 1px 0 #000, 0px 1px 0 #000, 1px 1px 0 #000;
-webkit-text-stroke: 1px #fff;
}
.animation-container {
position: relative;
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.animated-box {
width: 100px;
height: 100px;
background-color: #3498db;
border-radius: 10px;
position: absolute;
top: 325px;
left: 25%;
animation: moveBox 2s ease-in-out infinite alternate;
}
@keyframes moveBox {
0% {
transform: translateY(0);
}
100% {
transform: translateY(50px);
}
}
header {
background-color: #333;
color: #fff;
padding: 16px;
text-align: center;
font-size: 24px;
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
.content {
margin-top: 40px; /* Adjust this value based on your header height */
padding: 20px;
}
.animated-circle {
position: absolute;
top: 350px;
left: 50%;
width: 100px;
height: 100px;
background-color: #3498db;
border-radius: 50%;
transform: translate(-50%, -50%);
animation: bouncecircle 2s infinite;
}
@keyframes bouncecircle {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-30px);
}
60% {
transform: translateY(-15px);
}
}
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px;
position: fixed;
bottom: 0;
width: 100%;
}
.slidecontainer {
width: 90%;
padding-left: 5%;
}
.slider {
-webkit-appearance: none;
width: 100%;
height: 35px;
border-radius: 5px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 50px;
height: 50px;
border-radius: 25%;
background: #04AA6D;
cursor: pointer;
}
.slider::-moz-range-thumb {
width: 50px;
height: 50px;
border-radius: 25%;
background: #04AA6D;
cursor: pointer;
}
</style>
</head>
<body>
<script src="./assets/js/three.js"></script>
<header>
Random Page with Animations
</header>
<div class="content">
<div id="animation-container">
<div class="animated-box"></div>
<div class="animated-circle"></div>
</div>
<div class="slidecontainer">
<button> <a href="/python1.html">Python1 (Look at console)</a></button>
<button> <a href="/index.html">Home</a></button>
<button> <a href="/Apps/Games/Create.JS New Project/index.html">CreateJS Test</a></button>
<button> <a href="https://github.com/MunaAlaneme/MunaAlaneme.github.io/releases/download/SourceCodes/Formula.Cartoon.All.Stars.Source.Code.zip">⬇️DOWNLOAD⬇️ Formula Cartoon: All Stars (Source Code) ⬇️DOWNLOAD⬇️</a></button>
<input type="range" min="-3.2" max="3.2" value="0.01" class="slider" id="myRange" step="1e-3">
<p>X Rotate: <span id="demo"></span></p>
<input type="range" min="-3.2" max="3.2" value="0.01" class="slider" id="myRange2" step="1e-3">
<p>Y Rotate: <span id="demo2"></span></p>
<input type="range" min="-3.2" max="3.2" value="0.01" class="slider" id="myRange3" step="1e-3">
<p>Z Rotate: <span id="demo3"></span></p>
</div>
</div>
<footer>
Made with ❤️ by Muna Alaneme
</footer>
<script>
function decimalToHex(decimal) {
return decimal.toString(16).toUpperCase();
}
// Add JavaScript to handle scroll event and add a class to the header
window.onscroll = function() {
var header = document.querySelector('header');
if (window.pageYOffset > 0) {
header.classList.add('sticky');
} else {
header.classList.remove('sticky');
}
};
</script>
<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
output.innerHTML = slider.value;
var xrot = output.innerHTML/1;
var slider2 = document.getElementById("myRange2");
var output2 = document.getElementById("demo2");
output2.innerHTML = slider2.value;
var yrot = output2.innerHTML/1;
var slider3 = document.getElementById("myRange3");
var output3 = document.getElementById("demo3");
output3.innerHTML = slider3.value;
var zrot = output3.innerHTML/1;
slider.oninput = function() {
output.innerHTML = this.value;
}
slider2.oninput = function() {
output2.innerHTML = this.value;
}
slider3.oninput = function() {
output3.innerHTML = this.value;
}
// Set up scene
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight*2, 0.1, 1000);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight/2);
document.body.appendChild(renderer.domElement);
// Create a cube
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
const cube = new THREE.Mesh(geometry, material);
scene.add(cube);
// Create an outline
const outlineMaterial = new THREE.LineBasicMaterial({ color: 0x000000 });
const outlineGeometry = new THREE.EdgesGeometry(geometry);
const outline = new THREE.LineSegments(outlineGeometry, outlineMaterial);
cube.add(outline);
// Position the camera
camera.position.z = 2;
// Animation function
const animate = () => {
requestAnimationFrame(animate);
// Rotate the cube
cube.rotation.x += xrot;
cube.rotation.y += yrot;
cube.rotation.z += zrot;
xrot = output.innerHTML/1;
yrot = output2.innerHTML/1;
zrot = output3.innerHTML/1;
// Render the scene
renderer.render(scene, camera);
};
// Handle window resize
window.addEventListener('resize', () => {
const newWidth = window.innerWidth;
const newHeight = window.innerHeight/2;
camera.aspect = newWidth / newHeight;
camera.updateProjectionMatrix();
renderer.setSize(newWidth, newHeight);
});
// Start the animation
animate();
</script>
</body>
</html>