Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- feedback.html +93 -0
- index.html +96 -0
feedback.html
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ja">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>会話フィードバック画面</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
display: flex;
|
11 |
+
justify-content: center;
|
12 |
+
align-items: center;
|
13 |
+
height: 100vh;
|
14 |
+
margin: 0;
|
15 |
+
}
|
16 |
+
.card {
|
17 |
+
border: 2px solid #000;
|
18 |
+
border-radius: 20px;
|
19 |
+
padding: 20px;
|
20 |
+
width: 300px;
|
21 |
+
text-align: center;
|
22 |
+
}
|
23 |
+
.level {
|
24 |
+
font-size: 24px;
|
25 |
+
font-weight: bold;
|
26 |
+
}
|
27 |
+
.message {
|
28 |
+
margin: 10px 0;
|
29 |
+
}
|
30 |
+
.bar {
|
31 |
+
height: 20px;
|
32 |
+
margin: 5px 0;
|
33 |
+
background-color: lightgray;
|
34 |
+
border-radius: 5px;
|
35 |
+
}
|
36 |
+
.bar-fill {
|
37 |
+
height: 100%;
|
38 |
+
border-radius: 5px;
|
39 |
+
}
|
40 |
+
.back-button {
|
41 |
+
margin-top: 15px;
|
42 |
+
padding: 8px 16px;
|
43 |
+
background-color: #007bff;
|
44 |
+
color: white;
|
45 |
+
border: none;
|
46 |
+
border-radius: 5px;
|
47 |
+
cursor: pointer;
|
48 |
+
}
|
49 |
+
.back-button:hover {
|
50 |
+
background-color: #0056b3;
|
51 |
+
}
|
52 |
+
</style>
|
53 |
+
<script>
|
54 |
+
function getMessage(level) {
|
55 |
+
if (level < 20) return "やばい";
|
56 |
+
if (level < 40) return "気をつけよう";
|
57 |
+
if (level < 60) return "まずまずですね";
|
58 |
+
if (level < 80) return "がんばれあとちょっと";
|
59 |
+
return "素晴らしい";
|
60 |
+
}
|
61 |
+
|
62 |
+
function goBack() {
|
63 |
+
history.back();
|
64 |
+
}
|
65 |
+
|
66 |
+
window.onload = function() {
|
67 |
+
const level = 73; // レベル値
|
68 |
+
const percentages = [80, 50, 60, 100, 30]; // 各バーのパーセンテージ
|
69 |
+
|
70 |
+
const message = getMessage(level);
|
71 |
+
document.getElementById("level").innerText = `話者Lv: ${level}`;
|
72 |
+
document.getElementById("message").innerText = message;
|
73 |
+
|
74 |
+
const barElements = document.getElementsByClassName("bar-fill");
|
75 |
+
for (let i = 0; i < barElements.length; i++) {
|
76 |
+
barElements[i].style.width = `${percentages[i]}%`;
|
77 |
+
}
|
78 |
+
};
|
79 |
+
</script>
|
80 |
+
</head>
|
81 |
+
<body>
|
82 |
+
<div class="card">
|
83 |
+
<div class="level" id="level">話者Lv: 85</div>
|
84 |
+
<div class="message" id="message">素晴らしい</div>
|
85 |
+
<div class="bar"><div class="bar-fill" style="background-color: lightblue;"></div></div>
|
86 |
+
<div class="bar"><div class="bar-fill" style="background-color: peachpuff;"></div></div>
|
87 |
+
<div class="bar"><div class="bar-fill" style="background-color: lightblue;"></div></div>
|
88 |
+
<div class="bar"><div class="bar-fill" style="background-color: peachpuff;"></div></div>
|
89 |
+
<div class="bar"><div class="bar-fill" style="background-color: lightcoral;"></div></div>
|
90 |
+
<button class="back-button" onclick="goBack()">前の画面に戻る</button>
|
91 |
+
</div>
|
92 |
+
</body>
|
93 |
+
</html>
|
index.html
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Voice Recorder Interface</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
display: flex;
|
10 |
+
flex-direction: column;
|
11 |
+
justify-content: center;
|
12 |
+
align-items: center;
|
13 |
+
height: 100vh;
|
14 |
+
margin: 0;
|
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: #d32f2f;
|
29 |
+
border-radius: 50%;
|
30 |
+
border: none;
|
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;
|
37 |
+
background-color: #4caf50;
|
38 |
+
border: none;
|
39 |
+
border-radius: 5px;
|
40 |
+
color: white;
|
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 |
+
}
|
47 |
+
</style>
|
48 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
49 |
+
</head>
|
50 |
+
<body>
|
51 |
+
<div class="chart">
|
52 |
+
<canvas id="speechChart"></canvas>
|
53 |
+
</div>
|
54 |
+
<button class="record-button" onclick="toggleRecording()"></button>
|
55 |
+
<button class="result-button" onclick="showResults()">結果を表示</button>
|
56 |
+
<script>
|
57 |
+
let isRecording = false;
|
58 |
+
function toggleRecording() {
|
59 |
+
isRecording = !isRecording;
|
60 |
+
if (isRecording) {
|
61 |
+
alert('Recording started');
|
62 |
+
} else {
|
63 |
+
alert('Recording stopped');
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
function showResults() {
|
68 |
+
window.location.href = 'feedback.html';
|
69 |
+
}
|
70 |
+
|
71 |
+
const ctx = document.getElementById('speechChart').getContext('2d');
|
72 |
+
const chart = new Chart(ctx, {
|
73 |
+
type: 'doughnut',
|
74 |
+
data: {
|
75 |
+
labels: ['自分', '他の人'],
|
76 |
+
datasets: [{
|
77 |
+
data: [30, 70],
|
78 |
+
backgroundColor: ['#4caf50', '#757575'],
|
79 |
+
}],
|
80 |
+
},
|
81 |
+
options: {
|
82 |
+
responsive: true,
|
83 |
+
plugins: {
|
84 |
+
legend: {
|
85 |
+
display: true,
|
86 |
+
position: 'bottom',
|
87 |
+
labels: {
|
88 |
+
color: 'white'
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
});
|
94 |
+
</script>
|
95 |
+
</body>
|
96 |
+
</html>
|