-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (84 loc) · 2.54 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sketch</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<style>
.buttonContainer {
display: flex;
flex-direction: column;
z-index: 1;
}
button {
padding: 20px;
font-size: 20px;
}
.container {
display: flex;
}
iframe {
position: absolute;
top: 0;
left: 0;
opacity: 0.2;
touch-action: none;
pointer-events: none;
}
</style>
<script src="libraries/p5.min.js"></script>
<script src="libraries/p5.sound.min.js"></script>
</head>
<body>
<div class="container">
<div id="myCanvas"></div>
<div id="player"></div>
<div class="buttonContainer">
<button onkeydown="preventSpacebarClick(event);" class="recordBtn">
녹음하기
</button>
<button onkeydown="preventSpacebarClick(event);" class="playBtn">
게임 시작하기
</button>
<button onkeydown="preventSpacebarClick(event);" class="replayBtn">
다시 시작
</button>
<button onkeydown="preventSpacebarClick(event);" class="songSelectBtn">
노래 선곡
</button>
</div>
</div>
<script>
function onYouTubeIframeAPIReady() {
ytPlayer.onYouTubeIframeAPIReady();
}
</script>
<script>
function preventSpacebarClick(event) {
if (event.key === " " || event.keyCode === 32) {
if (event.target === document.activeElement) {
event.preventDefault();
}
}
}
</script>
<script src="objects/BasicNote.js"></script>
<script src="objects/RecordNote.js"></script>
<script src="objects/Note.js"></script>
<script src="system/YouTubePlayer.js"></script>
<script src="system/SongLibrary.js"></script>
<script src="system/GameManager.js"></script>
<script src="system/LoadYTPlayer.js"></script>
<script src="system/NotePlayer.js"></script>
<script src="system/Recorder.js"></script>
<script src="system/Utils.js"></script>
<script src="system/System.js"></script>
<script src="ui/Button.js"></script>
<script src="ui/Controller.js"></script>
<script src="ui/UI.js"></script>
<script src="sketch.js"></script>
</body>
</html>
<!-- mongodb에 저장할 것 1. youtube video id 2. notes = {time: 0, note: 0} 배열 3.
song id -->