Spaces:
Sleeping
Sleeping
Update index.html
Browse files録音開始ボタンを改良
開始、停止アラートを削除
- index.html +33 -5
index.html
CHANGED
@@ -15,22 +15,43 @@
|
|
15 |
background-color: #121212;
|
16 |
color: white;
|
17 |
}
|
|
|
18 |
.chart {
|
19 |
width: 300px;
|
20 |
height: 300px;
|
21 |
margin-bottom: 20px;
|
22 |
}
|
|
|
23 |
.record-button {
|
24 |
position: fixed;
|
25 |
bottom: 30px;
|
26 |
width: 80px;
|
27 |
height: 80px;
|
28 |
-
background-color:
|
29 |
border-radius: 50%;
|
30 |
-
border:
|
|
|
|
|
|
|
31 |
cursor: pointer;
|
32 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
|
|
|
33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
.result-button {
|
35 |
margin-top: 20px;
|
36 |
padding: 10px 20px;
|
@@ -41,6 +62,7 @@
|
|
41 |
cursor: pointer;
|
42 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
|
43 |
}
|
|
|
44 |
.result-button:hover {
|
45 |
background-color: #388e3c;
|
46 |
}
|
@@ -51,16 +73,22 @@
|
|
51 |
<div class="chart">
|
52 |
<canvas id="speechChart"></canvas>
|
53 |
</div>
|
54 |
-
<button class="record-button" onclick="toggleRecording()"
|
|
|
|
|
55 |
<button class="result-button" onclick="showResults()">結果を表示</button>
|
56 |
<script>
|
57 |
let isRecording = false;
|
|
|
58 |
function toggleRecording() {
|
|
|
|
|
59 |
isRecording = !isRecording;
|
|
|
60 |
if (isRecording) {
|
61 |
-
|
62 |
} else {
|
63 |
-
|
64 |
}
|
65 |
}
|
66 |
|
|
|
15 |
background-color: #121212;
|
16 |
color: white;
|
17 |
}
|
18 |
+
|
19 |
.chart {
|
20 |
width: 300px;
|
21 |
height: 300px;
|
22 |
margin-bottom: 20px;
|
23 |
}
|
24 |
+
|
25 |
.record-button {
|
26 |
position: fixed;
|
27 |
bottom: 30px;
|
28 |
width: 80px;
|
29 |
height: 80px;
|
30 |
+
background-color: transparent;
|
31 |
border-radius: 50%;
|
32 |
+
border: 4px solid white;
|
33 |
+
display: flex;
|
34 |
+
justify-content: center;
|
35 |
+
align-items: center;
|
36 |
cursor: pointer;
|
37 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
|
38 |
+
transition: all 0.2s ease;
|
39 |
}
|
40 |
+
|
41 |
+
.record-icon {
|
42 |
+
width: 60px;
|
43 |
+
height: 60px;
|
44 |
+
background-color: #d32f2f;
|
45 |
+
border-radius: 50%;
|
46 |
+
transition: all 0.2s ease;
|
47 |
+
}
|
48 |
+
|
49 |
+
.recording .record-icon {
|
50 |
+
width: 40px;
|
51 |
+
height: 40px;
|
52 |
+
border-radius: 10%;
|
53 |
+
}
|
54 |
+
|
55 |
.result-button {
|
56 |
margin-top: 20px;
|
57 |
padding: 10px 20px;
|
|
|
62 |
cursor: pointer;
|
63 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
|
64 |
}
|
65 |
+
|
66 |
.result-button:hover {
|
67 |
background-color: #388e3c;
|
68 |
}
|
|
|
73 |
<div class="chart">
|
74 |
<canvas id="speechChart"></canvas>
|
75 |
</div>
|
76 |
+
<button class="record-button" id="recordButton" onclick="toggleRecording()">
|
77 |
+
<div class="record-icon" id="recordIcon"></div>
|
78 |
+
</button>
|
79 |
<button class="result-button" onclick="showResults()">結果を表示</button>
|
80 |
<script>
|
81 |
let isRecording = false;
|
82 |
+
|
83 |
function toggleRecording() {
|
84 |
+
const recordButton = document.getElementById('recordButton');
|
85 |
+
const recordIcon = document.getElementById('recordIcon');
|
86 |
isRecording = !isRecording;
|
87 |
+
|
88 |
if (isRecording) {
|
89 |
+
recordButton.classList.add('recording');
|
90 |
} else {
|
91 |
+
recordButton.classList.remove('recording');
|
92 |
}
|
93 |
}
|
94 |
|