Spaces:
Running
Running
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Voice Recorder Interface</title> | |
<style> | |
body { | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
margin: 0; | |
background-color: #121212; | |
color: white; | |
} | |
.chart { | |
width: 300px; | |
height: 300px; | |
margin-bottom: 20px; | |
} | |
.record-button { | |
position: fixed; | |
bottom: 30px; | |
width: 80px; | |
height: 80px; | |
background-color: #d32f2f; | |
border-radius: 50%; | |
border: none; | |
cursor: pointer; | |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4); | |
} | |
.result-button { | |
margin-top: 20px; | |
padding: 10px 20px; | |
background-color: #4caf50; | |
border: none; | |
border-radius: 5px; | |
color: white; | |
cursor: pointer; | |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4); | |
} | |
.result-button:hover { | |
background-color: #388e3c; | |
} | |
</style> | |
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
</head> | |
<body> | |
<div class="chart"> | |
<canvas id="speechChart"></canvas> | |
</div> | |
<button class="record-button" onclick="toggleRecording()"></button> | |
<button class="result-button" onclick="showResults()">結果を表示</button> | |
<script> | |
let isRecording = false; | |
function toggleRecording() { | |
isRecording = !isRecording; | |
if (isRecording) { | |
alert('Recording started'); | |
} else { | |
alert('Recording stopped'); | |
} | |
} | |
function showResults() { | |
window.location.href = 'feedback.html'; | |
} | |
const ctx = document.getElementById('speechChart').getContext('2d'); | |
const chart = new Chart(ctx, { | |
type: 'doughnut', | |
data: { | |
labels: ['自分', '他の人'], | |
datasets: [{ | |
data: [30, 70], | |
backgroundColor: ['#4caf50', '#757575'], | |
}], | |
}, | |
options: { | |
responsive: true, | |
plugins: { | |
legend: { | |
display: true, | |
position: 'bottom', | |
labels: { | |
color: 'white' | |
} | |
} | |
} | |
} | |
}); | |
</script> | |
</body> | |
</html> |