forked from QiShaoXuan/rhythm-ripple
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
88 lines (76 loc) · 1.65 KB
/
index.html
File metadata and controls
88 lines (76 loc) · 1.65 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
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon"
href="https://qishaoxuan.github.io/animate_resume_ts/images/favicon.png">
<title>RhythmDisk Demo</title>
</head>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
html, body {
height: 100%;
background: #303133;
}
audio {
position: absolute;
left: 40px;
top: 40px;
z-index: 100;
}
.copyright {
position: absolute;
left: 15px;
bottom: 15px;
font-size: 14px;
color: #fff;
}
.link {
position: absolute;
right: 15px;
bottom: 15px;
font-size: 14px;
color: #fff;
}
@media screen and (max-width: 767px) {
audio {
left: 0;
right: 0;
margin: auto;
}
}
.body{
height:100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
</style>
<body>
<div class="body">
<div id="canvas-container"></div>
<a href="https://github.com/QiShaoXuan/rhythm-disk" class="link">GITHUB ==></a>
</div>
</body>
<script src="./dist/Ripple.js"></script>
<script>
function detectDeviceType() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop'
}
const mobileOption = {
size: window.innerWidth - 30,
radius: .25,
rippeWidth: 2,
pointRadius: 4,
}
const rd = new Ripple('#canvas-container', Object.assign({cover: './asset/Qi.png'}, detectDeviceType() === 'Mobile' ? mobileOption : {}))
rd.animate()
</script>
</html>