-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (36 loc) · 1.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Falling Sakura</title>
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="images/sakura.png">
</head>
<body>
<div class="switch-container">
<label class="switch">
<input type="checkbox" id="modeSwitch">
<span class="slider"></span>
</label>
</div>
<div class="background">
<div class="particles layer" id="layer1"></div>
<div class="particles layer" id="layer2"></div>
</div>
<script>
// Request permission for device orientation on iOS 13+ devices
if (window.DeviceOrientationEvent && typeof DeviceOrientationEvent.requestPermission === 'function') {
DeviceOrientationEvent.requestPermission()
.then(permissionState => {
if (permissionState === 'granted') {
// Add the device orientation event listener
window.addEventListener('deviceorientation', handleOrientation, true);
}
})
.catch(console.error);
}
</script>
<script src="scripts.js"></script>
</body>
</html>