-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
64 lines (57 loc) · 1.1 KB
/
index.html
File metadata and controls
64 lines (57 loc) · 1.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
<style>
* {
font-family: Arial;
background-color: beige;
}
.button-container {
display: inline-block;
position: relative;
width: 100px;
height: 100px;
}
.button {
width: 100px;
height: 100px;
background-color: gray;
border-radius: 50%;
position: relative;
overflow: hidden;
}
.button .top {
background-color: red;
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
top: 10px;
left: 10px;
transition: transform 0.1s ease;
}
.button:active .top {
transform: translateY(5px);
}
</style>
</head>
<body>
<h1>Simple button</h1>
<p>some text</p>
<div class="button-container">
<div class="button" onclick=playSound()>
<div class="top"></div>
</div>
</div>
<audio id="button-sound" src="sus.mp3"></audio>
<script>
function playSound() {
var audio = document.getElementById('button-sound');
audio.play();
}
</script>
</body>
</html>