<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>grand0128のブログ</title>
<link>https://ameblo.jp/grand0128/</link>
<atom:link href="http://rssblog.ameba.jp/grand0128/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>ブログの説明を入力します。</description>
<language>ja</language>
<item>
<title>時計</title>
<description>
<![CDATA[ <p>&lt;!DOCTYPE html&gt;<br>&lt;html lang="ja"&gt;<br>&lt;head&gt;<br>&nbsp; &nbsp; &lt;meta charset="UTF-8"&gt;<br>&nbsp; &nbsp; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;<br>&nbsp; &nbsp; &lt;title&gt;経過時間お知らせタイマー&lt;/title&gt;<br>&nbsp; &nbsp; &lt;style&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; body {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-family: 'Helvetica Neue', Arial, sans-serif;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display: flex;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; flex-direction: column;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; align-items: center;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; justify-content: center;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min-height: 100vh;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin: 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-color: #f0f2f5;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 20px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; box-sizing: border-box;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .container {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text-align: center;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: white;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 2.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-radius: 12px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; box-shadow: 0 4px 6px rgba(0,0,0,0.1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: 100%;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max-width: 360px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; box-sizing: border-box;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .label {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 1.2rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: #666;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 0.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #timer {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 3.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 1.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: #333;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-variant-numeric: tabular-nums;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .settings {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 1.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 1rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: #f8f9fa;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-radius: 8px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text-align: left;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .settings label {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display: block;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 0.9rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: #555;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 0.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .speed-control {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display: flex;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; align-items: center;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gap: 10px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 1.2rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; input[type="range"] {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; flex: 1;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #speedVal {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min-width: 2rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .toggle-group {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display: flex;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gap: 6px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 1.2rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; flex-wrap: wrap;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .toggle-group button {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; flex: 1;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min-width: 60px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 0.85rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 0.5rem 0.25rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-color: #e9ecef;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: #495057;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border: 1px solid #ced4da;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-radius: 4px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cursor: pointer;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transition: all 0.2s;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .toggle-group button.active {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-color: #007bff;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: white;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-color: #007bff;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .btn-group {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display: flex;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gap: 10px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; justify-content: center;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 10px;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; .main-btn {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 1.1rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 0.75rem 1.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cursor: pointer;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: white;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border: none;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-radius: 6px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transition: background-color 0.2s;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #startBtn { background-color: #28a745; flex: 1; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #startBtn:hover { background-color: #218838; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #stopBtn { background-color: #dc3545; flex: 1; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #stopBtn:hover { background-color: #c82333; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #sampleBtn {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-color: #6c757d;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: 100%;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 1rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 0.5rem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border: none;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-radius: 6px;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: white;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cursor: pointer;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; #sampleBtn:hover { background-color: #5a6268; }<br>&nbsp; &nbsp; &nbsp; &nbsp; button:disabled {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-color: #ccc !important;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; border-color: #ccc !important;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: white !important;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cursor: not-allowed;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br><br>&lt;div class="container"&gt;<br>&nbsp; &nbsp; &lt;div class="label"&gt;経過時間&lt;/div&gt;<br>&nbsp; &nbsp; &lt;div id="timer"&gt;00:00:00&lt;/div&gt;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &lt;div class="settings"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- アナウンス間隔の設定 --&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;label&gt;お知らせの間隔&lt;/label&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class="toggle-group"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="interval5" class="active" onclick="setIntervalMinutes(5)"&gt;5分毎&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="interval10" onclick="setIntervalMinutes(10)"&gt;10分毎&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="interval15" onclick="setIntervalMinutes(15)"&gt;15分毎&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="interval30" onclick="setIntervalMinutes(30)"&gt;30分毎&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- 声の種類の設定 --&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;label&gt;声の種類&lt;/label&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class="toggle-group"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="femaleBtn" class="active" onclick="setGender('female')"&gt;?? 女性&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="maleBtn" onclick="setGender('male')"&gt;?? 男性&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- 読み上げ速度の設定 --&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;label for="speedRange"&gt;読み上げ速度（標準: 1.0）&lt;/label&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class="speed-control"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type="range" id="speedRange" min="0.5" max="1.5" step="0.1" value="1.0" oninput="changeSpeed(this.value)"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;span id="speedVal"&gt;1.0&lt;/span&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br>&nbsp; &nbsp; &lt;/div&gt;<br><br>&nbsp; &nbsp; &lt;div class="btn-group"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="startBtn" class="main-btn" onclick="startTimer()"&gt;スタート&lt;/button&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;button id="stopBtn" class="main-btn" onclick="stopTimer()" disabled&gt;ストップ&lt;/button&gt;<br>&nbsp; &nbsp; &lt;/div&gt;<br>&nbsp; &nbsp; &lt;button id="sampleBtn" onclick="playSample()"&gt;?? サンプル音声を聴く&lt;/button&gt;<br>&lt;/div&gt;<br><br>&lt;script&gt;<br>&nbsp; &nbsp; let timeElapsed = 0;<br>&nbsp; &nbsp; let timerId = null;<br>&nbsp; &nbsp; let currentSpeed = 1.0;<br>&nbsp; &nbsp; let currentGender = 'female';<br>&nbsp; &nbsp; let announceIntervalSeconds = 300; // デフォルトは5分（300秒）<br>&nbsp; &nbsp; const MAX_TIME = 12 * 60 * 60;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; let voicesList = [];<br>&nbsp; &nbsp; let selectedVoice = null;<br><br>&nbsp; &nbsp; function loadVoices() {<br>&nbsp; &nbsp; &nbsp; &nbsp; voicesList = window.speechSynthesis.getVoices();<br>&nbsp; &nbsp; &nbsp; &nbsp; updateSelectedVoice();<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function updateSelectedVoice() {<br>&nbsp; &nbsp; &nbsp; &nbsp; const jaVoices = voicesList.filter(v =&gt; v.lang === 'ja-JP');<br>&nbsp; &nbsp; &nbsp; &nbsp; if (currentGender === 'male') {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selectedVoice = jaVoices.find(v =&gt; v.name.includes('Ichiro')) ||&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices.find(v =&gt; v.name.includes('Otoya')) ||<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices.find(v =&gt; v.name.toLowerCase().includes('male')) ||<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices;<br>&nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selectedVoice = jaVoices.find(v =&gt; v.name.includes('Google')) ||<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices.find(v =&gt; v.name.includes('Kyoko')) ||<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices.find(v =&gt; v.name.includes('Ayumi')) ||<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices.find(v =&gt; v.name.toLowerCase().includes('female')) ||<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jaVoices;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; window.speechSynthesis.onvoiceschanged = loadVoices;<br>&nbsp; &nbsp; loadVoices();<br><br>&nbsp; &nbsp; // 間隔を切り替える関数<br>&nbsp; &nbsp; function setIntervalMinutes(minutes) {<br>&nbsp; &nbsp; &nbsp; &nbsp; announceIntervalSeconds = minutes * 60;<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; // ボタンのアクティブ状態を切り替え<br>&nbsp; &nbsp; &nbsp; &nbsp; [5, 10, 15, 30].forEach(m =&gt; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(`interval${m}`).classList.toggle('active', m === minutes);<br>&nbsp; &nbsp; &nbsp; &nbsp; });<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 切り替えたことを音声でプレビュー<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.cancel();<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(createUtterance(`${minutes}分ごとにお知らせします。`));<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function setGender(gender) {<br>&nbsp; &nbsp; &nbsp; &nbsp; currentGender = gender;<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('femaleBtn').classList.toggle('active', gender === 'female');<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('maleBtn').classList.toggle('active', gender === 'male');<br>&nbsp; &nbsp; &nbsp; &nbsp; updateSelectedVoice();<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.cancel();<br>&nbsp; &nbsp; &nbsp; &nbsp; const msg = gender === 'female' ? "女性の声です。" : "男性の声です。";<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(createUtterance(msg));<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function changeSpeed(val) {<br>&nbsp; &nbsp; &nbsp; &nbsp; currentSpeed = parseFloat(val);<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('speedVal').textContent = currentSpeed.toFixed(1);<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function updateDisplay() {<br>&nbsp; &nbsp; &nbsp; &nbsp; const hours = Math.floor(timeElapsed / 3600);<br>&nbsp; &nbsp; &nbsp; &nbsp; const minutes = Math.floor((timeElapsed % 3600) / 60);<br>&nbsp; &nbsp; &nbsp; &nbsp; const seconds = timeElapsed % 60;<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('timer').textContent =&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function startTimer() {<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(new SpeechSynthesisUtterance(''));<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('startBtn').disabled = true;<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('stopBtn').disabled = false;<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; timerId = setInterval(() =&gt; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timeElapsed++;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; updateDisplay();<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 設定された間隔ごとに音声でお知らせ<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (timeElapsed % announceIntervalSeconds === 0 &amp;&amp; timeElapsed &gt; 0) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; speak(timeElapsed);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (timeElapsed &gt;= MAX_TIME) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stopTimer();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; speakFinal();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }, 1000);<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function stopTimer() {<br>&nbsp; &nbsp; &nbsp; &nbsp; clearInterval(timerId);<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('startBtn').disabled = false;<br>&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('stopBtn').disabled = true;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function createUtterance(text) {<br>&nbsp; &nbsp; &nbsp; &nbsp; const uttr = new SpeechSynthesisUtterance(text);<br>&nbsp; &nbsp; &nbsp; &nbsp; uttr.lang = "ja-JP";<br>&nbsp; &nbsp; &nbsp; &nbsp; uttr.rate = currentSpeed;<br>&nbsp; &nbsp; &nbsp; &nbsp; if (selectedVoice) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uttr.voice = selectedVoice;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; return uttr;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function speak(secondsTotal) {<br>&nbsp; &nbsp; &nbsp; &nbsp; const hours = Math.floor(secondsTotal / 3600);<br>&nbsp; &nbsp; &nbsp; &nbsp; const minutes = Math.floor((secondsTotal % 3600) / 60);<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; let text = "";<br>&nbsp; &nbsp; &nbsp; &nbsp; if (hours &gt; 0) text += `${hours}時間`;<br>&nbsp; &nbsp; &nbsp; &nbsp; if (minutes &gt; 0) text += `${minutes}分`;<br>&nbsp; &nbsp; &nbsp; &nbsp; text += "経過しました。";<br><br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(createUtterance(text));<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function speakFinal() {<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(createUtterance("制限時間の12時間が経過しました。"));<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; function playSample() {<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.cancel();&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; const intervalText = announceIntervalSeconds / 60;<br>&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(createUtterance(`現在は、${intervalText}分ごとに、この声でお知らせします。`));<br>&nbsp; &nbsp; }<br>&lt;/script&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&nbsp;</p>
]]>
</description>
<link>https://ameblo.jp/grand0128/entry-12983930138.html</link>
<pubDate>Sun, 08 Nov 2026 13:05:33 +0900</pubDate>
</item>
</channel>
</rss>
