{"id":153,"date":"2025-04-26T19:20:37","date_gmt":"2025-04-26T10:20:37","guid":{"rendered":"https:\/\/suyasuyahirohiro.com\/?p=153"},"modified":"2025-04-28T11:45:37","modified_gmt":"2025-04-28T02:45:37","slug":"%e4%b8%80%e6%99%82%e5%81%9c%e6%ad%a2%e6%a9%9f%e8%83%bd%e3%81%ae%e8%bf%bd%e5%8a%a0","status":"publish","type":"post","link":"https:\/\/suyasuyahirohiro.com\/?p=153","title":{"rendered":"\u4e00\u6642\u505c\u6b62\u6a5f\u80fd\u306e\u8ffd\u52a0"},"content":{"rendered":"\n<p>\u4e00\u5ea6\u52d5\u3044\u305f\u30bf\u30a4\u30de\u30fc\u3092\u6b62\u3081\u3089\u308c\u306a\u3044\u306e\u3067\u4e00\u6642\u505c\u6b62\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3059<br>\u3053\u306e\u90e8\u5206\u3067\u306f\u8a18\u8f09\u3057\u305f\u306f\u305a\u306e\u4e00\u6642\u505c\u6b62\u30bf\u30a4\u30de\u30fc\u304c\u51fa\u529b\u3055\u308c\u306a\u3044\u3001\u30bf\u30b9\u30af\u7d42\u4e86\u5f8c\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306b\u9077\u79fb\u3057\u306a\u304b\u3063\u305f\u308a\u3068\u5927\u5909\u3067\u3057\u305f<\/p>\n\n\n\n<p><strong>1. <code>data<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u4e00\u6642\u505c\u6b62\u306e\u72b6\u614b\u3068\u30dc\u30bf\u30f3\u306e\u8868\u793a\u3092\u5236\u5fa1\u3059\u308b\u5909\u6570\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  data() {\n    return {\n      minutes: 0,\n      seconds: 10,\n      breakMinutes: 0,\n      breakSeconds: 10,\n      breakTimerStartButton: false, \/\/\u300c\u4f5c\u696d\u6642\u9593\u300d\u304c\u7d42\u4e86\u3057\u3001\u30bf\u30a4\u30de\u30fc\u95a2\u9023\u306e UI \u8981\u7d20\u3092\u8868\u793a\u30fb\u975e\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30d5\u30e9\u30b0\n      breakTimerDisplay: false,\n      remainingWorkSeconds: 25 * 60, \/\/ \u4f5c\u696d\u6b8b\u308a\u6642\u9593\uff08\u79d2\uff09\n      remainingBreakSeconds: 5 * 60, \/\/ \u4f11\u61a9\u6b8b\u308a\u6642\u9593\uff08\u79d2\uff09\n      isWorkTimerActive: false, \/\/ \u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u304b\u3069\u3046\u304b\n      isBreakTimerActive: false, \/\/ \u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u304b\u3069\u3046\u304b\n      isWorkTimerPaused: false, \/\/ \u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u304c\u4e00\u6642\u505c\u6b62\u4e2d\u304b\u3069\u3046\u304b\n      isBreakTimerPaused: false, \/\/ \u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u304c\u4e00\u6642\u505c\u6b62\u4e2d\u304b\u3069\u3046\u304b\n      timerInterval: null, \/\/ \u30bf\u30a4\u30de\u30fc\u306e\u30a4\u30f3\u30bf\u30fc\u30d0\u30ebID\n      currentTimerLabel: \"\u4f5c\u696d\u6642\u9593\", \/\/ \u73fe\u5728\u306e\u30bf\u30a4\u30de\u30fc\u306e\u30e9\u30d9\u30eb\n    };\n  },<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>isWorkTimerPaused<\/code>: \u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u304c\u4e00\u6642\u505c\u6b62\u4e2d\u304b\u3069\u3046\u304b\u3092\u793a\u3059\u771f\u507d\u5024\u3067\u3059\u3002\u521d\u671f\u5024\u306f <code>false<\/code> \u3067\u3059\u3002<\/li>\n\n\n\n<li><code>isBreakTimerPaused<\/code>: \u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u304c\u4e00\u6642\u505c\u6b62\u4e2d\u304b\u3069\u3046\u304b\u3092\u793a\u3059\u771f\u507d\u5024\u3067\u3059\u3002\u521d\u671f\u5024\u306f <code>false<\/code> \u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>2. \u30bf\u30a4\u30de\u30fc\u3092\u4e00\u6642\u505c\u6b62\u30fb\u518d\u958b\u3059\u308b\u30e1\u30bd\u30c3\u30c9 (<code>pauseTimer<\/code>, <code>resumeTimer<\/code>) \u3092 <code>methods<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  methods: {\n    toggleTimer(timerType) {\n      console.log(\n        \"toggleTimer \u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3057\u305f:\",\n        timerType,\n        this.isWorkTimerActive,\n        this.isBreakTimerActive\n      );\n      if (timerType === \"work\") {\n        if (!this.isWorkTimerActive) {\n          this.startWorkTimerInternal(); \/\/ \u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u958b\u59cb\u51e6\u7406\n        } else {\n          this.pauseTimer(\"work\"); \/\/ \u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u4e00\u6642\u505c\u6b62\n        }\n      } else if (timerType === \"break\") {\n        if (!this.isBreakTimerActive) {\n          this.startBreakTimerInternal(); \/\/ \u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u958b\u59cb\u51e6\u7406\n        } else {\n          this.pauseTimer(\"break\"); \/\/ \u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u4e00\u6642\u505c\u6b62\n        }\n      }\n      console.log(\n        \"toggleTimer \u7d42\u4e86:\",\n        this.isWorkTimerActive,\n        this.isBreakTimerActive,\n        this.isWorkTimerPaused,\n        this.isBreakTimerPaused\n      );\n    },\n    startWorkTimerInternal() {\n      this.isWorkTimerActive = true;\n      this.isWorkTimerPaused = false;\n      this.currentTimerLabel = \"\u4f5c\u696d\u6642\u9593\";\n      this.remainingWorkSeconds = this.minutes * 60 + this.seconds;\n      this.timerInterval = setInterval(() =&gt; {\n        if (!this.isWorkTimerPaused) {\n          if (this.remainingWorkSeconds &gt; 0) {\n            this.remainingWorkSeconds--;\n          } else {\n            this.stopTimerInterval();\n            this.isWorkTimerActive = false;\n            this.isWorkTimerPaused = false;\n            this.sendTimerEndStatus(\"work\");\n            alert(\"\u4f5c\u696d\u6642\u9593\u7d42\u4e86\uff01\u4f11\u61a9\u3092\u958b\u59cb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\n            this.startBreakTimerInternal();\n          }\n        }\n      }, 1000);\n    },\n    startBreakTimerInternal() {\n      this.isBreakTimerActive = true;\n      this.isBreakTimerPaused = false;\n      this.currentTimerLabel = \"\u4f11\u61a9\u6642\u9593\";\n      this.remainingBreakSeconds = this.breakMinutes * 60 + this.breakSeconds;\n      this.timerInterval = setInterval(() =&gt; {\n        if (!this.isBreakTimerPaused) {\n          if (this.remainingBreakSeconds &gt; 0) {\n            this.remainingBreakSeconds--;\n          } else {\n            this.stopTimerInterval();\n            this.isBreakTimerActive = false;\n            this.isBreakTimerPaused = false;\n            this.sendTimerEndStatus(\"break\");\n            alert(\"\u4f11\u61a9\u6642\u9593\u7d42\u4e86\uff01\");\n            \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u3092\u518d\u958b\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\n          }\n        }\n      }, 1000);\n    },\n    pauseTimer(timerType) {\n      console.log(\n        \"pauseTimer \u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3057\u305f:\",\n        timerType,\n        this.timerInterval\n      );\n      if (this.timerInterval) {\n        this.stopTimerInterval();\n        if (timerType === \"work\") {\n          this.isWorkTimerPaused = true;\n        } else if (timerType === \"break\") {\n          this.isBreakTimerPaused = true;\n        }\n      }\n      console.log(\n        \"pauseTimer \u7d42\u4e86:\",\n        this.isWorkTimerPaused,\n        this.isBreakTimerPaused,\n        this.timerInterval\n      );\n    },\n    resumeTimer(timerType) {\n      if (!this.timerInterval) {\n        if (\n          timerType === \"work\" &amp;&amp;\n          this.isWorkTimerPaused &amp;&amp;\n          this.isWorkTimerActive\n        ) {\n          this.isWorkTimerPaused = false;\n          this.timerInterval = setInterval(() =&gt; {\n            if (this.remainingWorkSeconds &gt; 0) {\n              this.remainingWorkSeconds--;\n            } else {\n              this.stopTimerInterval();\n              this.isWorkTimerActive = false;\n              this.isWorkTimerPaused = false;\n              this.sendTimerEndStatus(\"work\");\n              alert(\"\u4f5c\u696d\u6642\u9593\u7d42\u4e86\uff01\u4f11\u61a9\u3092\u958b\u59cb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\n              this.startBreakTimer();\n            }\n          }, 1000);\n        } else if (\n          timerType === \"break\" &amp;&amp;\n          this.isBreakTimerPaused &amp;&amp;\n          this.isBreakTimerActive\n        ) {\n          this.isBreakTimerPaused = false;\n          this.timerInterval = setInterval(() =&gt; {\n            if (this.remainingBreakSeconds &gt; 0) {\n              this.remainingBreakSeconds--;\n            } else {\n              this.stopTimerInterval();\n              this.isBreakTimerActive = false;\n              this.isBreakTimerPaused = false;\n              this.sendTimerEndStatus(\"break\");\n              alert(\"\u4f11\u61a9\u6642\u9593\u7d42\u4e86\uff01\");\n              \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u3092\u518d\u958b\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\n            }\n          }, 1000);\n        }\n      }\n    },\n    stopTimerInterval() {\n      clearInterval(this.timerInterval);\n      this.timerInterval = null;\n    },\n    sendTimerEndStatus(status) {\n      const timerStatus = {\n        status: status,\n        endTime: new Date().toISOString(),\n      };\n      axios\n        .post(\"http:\/\/localhost:8080\/api\/timer-status\", timerStatus) \/\/ \u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\n        .then((response) =&gt; {\n          console.log(\"\u30bf\u30a4\u30de\u30fc\u7d42\u4e86\u30b9\u30c6\u30fc\u30bf\u30b9\u9001\u4fe1\u6210\u529f\", response.data);\n        })\n        .catch((error) =&gt; {\n          console.error(\"\u30bf\u30a4\u30de\u30fc\u7d42\u4e86\u30b9\u30c6\u30fc\u30bf\u30b9\u9001\u4fe1\u5931\u6557\", error);\n        });\n    },\n  },\n};<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>startTimer()<\/code> \u3068 <code>startBreakTimer()<\/code>: \u30bf\u30a4\u30de\u30fc\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u5834\u5408\u306f <code>pauseTimer()<\/code> \u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u958b\u59cb\u6642\u306b\u306f\u4e00\u6642\u505c\u6b62\u72b6\u614b\u3092\u89e3\u9664\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>pauseTimer(timerType)<\/code>: <code>setInterval()<\/code> \u3067\u8a2d\u5b9a\u3055\u308c\u305f\u30bf\u30a4\u30de\u30fc\u3092 <code>clearInterval()<\/code> \u3067\u505c\u6b62\u3057\u3001<code>timerInterval<\/code> \u3092 <code>null<\/code> \u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u5f15\u6570 <code>timerType<\/code> \u306b\u5fdc\u3058\u3066\u3001\u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u307e\u305f\u306f\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306e\u4e00\u6642\u505c\u6b62\u72b6\u614b\u3092 <code>true<\/code> \u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>resumeTimer(timerType)<\/code>: <code>timerInterval<\/code> \u304c <code>null<\/code> \u306e\u5834\u5408\uff08\u30bf\u30a4\u30de\u30fc\u304c\u505c\u6b62\u3057\u3066\u3044\u308b\u5834\u5408\uff09\u3001\u5f15\u6570 <code>timerType<\/code> \u306b\u5fdc\u3058\u3066\u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u307e\u305f\u306f\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u3092\u518d\u958b\u3057\u307e\u3059\u3002\u4e00\u6642\u505c\u6b62\u72b6\u614b\u3092 <code>false<\/code> \u306b\u623b\u3057\u3001<code>setInterval()<\/code> \u3092\u518d\u5ea6\u8a2d\u5b9a\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u30c0\u30a6\u30f3\u3092\u518d\u958b\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>3. <code>&lt;template&gt;<\/code> \u90e8\u5206\u306b\u4e00\u6642\u505c\u6b62\/\u518d\u958b\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<p>HTML<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n  &lt;div&gt;\n    &lt;h1&gt;\u30dd\u30e2\u30c9\u30fc\u30ed\u30bf\u30a4\u30de\u30fc&lt;\/h1&gt;\n    &lt;div&gt;\n      &lt;label for=\"minutes\"&gt;\u5206\uff1a&lt;\/label&gt;\n      &lt;input type=\"number\" id=\"minutes\" v-model=\"minutes\" min=\"0\" max=\"59\" \/&gt;\n      &lt;input type=\"range\" v-model=\"minutes\" min=\"0\" max=\"59\" \/&gt;\n    &lt;\/div&gt;\n    &lt;div&gt;\n      &lt;label for=\"seconds\"&gt;\u79d2\uff1a&lt;\/label&gt;\n      &lt;input type=\"number\" id=\"seconds\" v-model=\"seconds\" min=\"0\" max=\"59\" \/&gt;\n      &lt;input type=\"range\" v-model=\"seconds\" min=\"0\" max=\"59\" \/&gt;\n    &lt;\/div&gt;\n    &lt;p&gt;\n      {{ currentTimerLabel }}\uff1a\n      {{\n        currentTimerLabel === \"\u4f5c\u696d\u6642\u9593\" ? formattedTime : formattedBreakTime\n      }}\n    &lt;\/p&gt;\n    &lt;button @click=\"toggleTimer('work')\" :disabled=\"isBreakTimerActive\"&gt;\n      {{ isWorkTimerActive ? \"\u4e00\u6642\u505c\u6b62\" : \"\u958b\u59cb\" }}\n    &lt;\/button&gt;\n    &lt;button\n      v-if=\"isWorkTimerActive\"\n      @click=\"resumeTimer('work')\"\n      :disabled=\"!isWorkTimerPaused\"\n    &gt;\n      \u518d\u958b\n    &lt;\/button&gt;\n\n    &lt;div v-if=\"breakTimerStartButton\"&gt;\n      &lt;h2&gt;\u4f11\u61a9\u30bf\u30a4\u30de\u30fc&lt;\/h2&gt;\n      &lt;div&gt;\n        &lt;label for=\"breakMinutes\"&gt;\u5206\uff1a&lt;\/label&gt;\n        &lt;input\n          type=\"number\"\n          id=\"breakMinutes\"\n          v-model=\"breakMinutes\"\n          min=\"0\"\n          max=\"59\"\n        \/&gt;\n        &lt;input type=\"range\" v-model=\"breakMinutes\" min=\"0\" max=\"59\" \/&gt;\n      &lt;\/div&gt;\n      &lt;div&gt;\n        &lt;label for=\"breakSeconds\"&gt;\u5206\uff1a&lt;\/label&gt;\n        &lt;input\n          type=\"number\"\n          id=\"breakSeconds\"\n          v-model=\"breakSeconds\"\n          min=\"0\"\n          max=\"59\"\n        \/&gt;\n        &lt;input type=\"range\" v-model=\"breakSeconds\" min=\"0\" max=\"59\" \/&gt;\n      &lt;\/div&gt;\n      &lt;p&gt;\u4f11\u61a9\u6642\u9593\uff1a{{ formattedBreakTime }}&lt;\/p&gt;\n      &lt;button @click=\"toggleTimer('break')\" :disabled=\"isWorkTimerActive\"&gt;\n        {{ isBreakTimerActive ? \"\u4e00\u6642\u505c\u6b62\" : \"\u4f11\u61a9\u958b\u59cb\" }}\n      &lt;\/button&gt;\n      &lt;button\n        v-if=\"isBreakTimerActive\"\n        @click=\"resumeTimer('break')\"\n        :disabled=\"!isBreakTimerPaused\"\n      &gt;\n        \u4f11\u61a9\u518d\u958b\n      &lt;\/button&gt;\n    &lt;\/div&gt;\n    &lt;p v-if=\"breakTimerDisplay\"&gt;\u4f11\u61a9\u6642\u9593\u7d42\u4e86&lt;\/p&gt;\n  &lt;\/div&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u306e\u300c\u958b\u59cb\u300d\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u5834\u5408\u306f\u300c\u4e00\u6642\u505c\u6b62\u300d\u306b\u5207\u308a\u66ff\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li>\u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u5834\u5408\u306b\u306e\u307f\u8868\u793a\u3055\u308c\u308b\u300c\u518d\u958b\u300d\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002\u4e00\u6642\u505c\u6b62\u4e2d\u3067\u306a\u3044\u5834\u5408\u306f\u975e\u6d3b\u6027\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306b\u3082\u540c\u69d8\u306b\u300c\u4e00\u6642\u505c\u6b62\u300d\u3068\u300c\u518d\u958b\u300d\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<p><br><br>\u4e0a\u8a18\u3092\u884c\u306a\u3063\u305f\u3053\u3068\u3067<br>\u30bf\u30b9\u30af\u5b9f\u884c\u4e2d\u306b\u4e00\u6642\u505c\u6b62\u30dc\u30bf\u30f3\u304c\u51fa\u529b\u3055\u308c\u3001\u6a5f\u80fd\u3082\u3057\u305f<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u753b\u9762\u53ce\u9332-2025-04-21-14.52.42.mov\"><\/video><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3057\u304b\u3057\u4f11\u61a9\u4e2d\u306b\u306f\u4e00\u6642\u505c\u6b62\u306e\u30dc\u30bf\u30f3\u304c\u51fa\u529b\u3055\u308c\u306a\u3044\u305f\u3081\u8ffd\u52a0\u4f5c\u696d\u3092\u884c\u3046<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"390\" height=\"148\" src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-21-15.24.04.png\" alt=\"\" class=\"wp-image-156\" srcset=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-21-15.24.04.png 390w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-21-15.24.04-300x114.png 300w\" sizes=\"(max-width: 390px) 100vw, 390px\" \/><\/figure>\n\n\n\n<p><strong>\u4fee\u6b63\u7b87\u6240:<\/strong><\/p>\n\n\n\n<p><code>&lt;template&gt;<\/code> \u90e8\u5206\u306e\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306e\u958b\u59cb\u30dc\u30bf\u30f3\u3068\u4e00\u6642\u505c\u6b62\u30dc\u30bf\u30f3\u306e\u8868\u793a\u6761\u4ef6\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u73fe\u5728\u306e\u30b3\u30fc\u30c9:<\/p>\n\n\n\n<p>HTML<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      &lt;button @click=\"toggleTimer('break')\" :disabled=\"isWorkTimerActive\"&gt;\n        {{ isBreakTimerActive ? \"\u4e00\u6642\u505c\u6b62\" : \"\u4f11\u61a9\u958b\u59cb\" }}\n      &lt;\/button&gt;\n      &lt;button\n        v-if=\"isBreakTimerActive\"\n        @click=\"resumeTimer('break')\"\n        :disabled=\"!isBreakTimerPaused\"\n      &gt;\n        \u4f11\u61a9\u518d\u958b\n      &lt;\/button&gt;\n<\/code><\/pre>\n\n\n\n<p>\u4fee\u6b63\u5f8c\u306e\u30b3\u30fc\u30c9:<\/p>\n\n\n\n<p>HTML<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      &lt;button @click=\"toggleTimer('break')\" :disabled=\"isWorkTimerActive\"&gt;\n        {{ isBreakTimerActive &amp;&amp; !isBreakTimerPaused ? \"\u4e00\u6642\u505c\u6b62\" : \"\u4f11\u61a9\u958b\u59cb\" }}\n      &lt;\/button&gt;\n      &lt;button\n        v-if=\"isBreakTimerActive &amp;&amp; isBreakTimerPaused\"\n        @click=\"resumeTimer('break')\"\n        :disabled=\"false\"\n      &gt;\n        \u4f11\u61a9\u518d\u958b\n      &lt;\/button&gt;\n<\/code><\/pre>\n\n\n\n<p><strong>\u4fee\u6b63\u5f8c\u306e\u7d50\u679c\u3068\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4f11\u61a9\u958b\u59cb\/\u4e00\u6642\u505c\u6b62\u30dc\u30bf\u30f3\u306e\u4fee\u6b63:<\/strong> HTML<code>&lt;button @click=\"toggleTimer('break')\" :disabled=\"isWorkTimerActive\"&gt; {{ isBreakTimerActive &amp;&amp; !isBreakTimerPaused ? \"\u4e00\u6642\u505c\u6b62\" : \"\u4f11\u61a9\u958b\u59cb\" }} &lt;\/button&gt;<\/code>\n<ul class=\"wp-block-list\">\n<li><code>@click=\"toggleTimer('break')\"<\/code>: \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001<code>toggleTimer<\/code> \u30e1\u30bd\u30c3\u30c9\u304c <code>'break'<\/code> \u3092\u5f15\u6570\u3068\u3057\u3066\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u3001\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306e\u958b\u59cb\u3068\u4e00\u6642\u505c\u6b62\u306e\u51e6\u7406\u304c\u884c\u308f\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>:disabled=\"isWorkTimerActive\"<\/code>: \u4f5c\u696d\u30bf\u30a4\u30de\u30fc\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u9593\u306f\u3001\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306e\u64cd\u4f5c\u30dc\u30bf\u30f3\u3092\u975e\u6d3b\u6027\u306b\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>{{ isBreakTimerActive &amp;&amp; !isBreakTimerPaused ? \"\u4e00\u6642\u505c\u6b62\" : \"\u4f11\u61a9\u958b\u59cb\" }}<\/code>:\n<ul class=\"wp-block-list\">\n<li>\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u304c\u30a2\u30af\u30c6\u30a3\u30d6 (<code>isBreakTimerActive<\/code> \u304c <code>true<\/code>) <strong>\u304b\u3064<\/strong> \u4e00\u6642\u505c\u6b62\u4e2d\u3067\u306a\u3044 (<code>!isBreakTimerPaused<\/code> \u304c <code>true<\/code>) \u5834\u5408\u3001\u300c\u4e00\u6642\u505c\u6b62\u300d\u3068\u8868\u793a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u4e0a\u8a18\u4ee5\u5916\u306e\u72b6\u614b\uff08\u975e\u30a2\u30af\u30c6\u30a3\u30d6\u307e\u305f\u306f\u4e00\u6642\u505c\u6b62\u4e2d\uff09\u306e\u5834\u5408\u306f\u3001\u300c\u4f11\u61a9\u958b\u59cb\u300d\u3068\u8868\u793a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u304c\u958b\u59cb\u3055\u308c\u308b\u3068\u30dc\u30bf\u30f3\u306e\u8868\u793a\u304c\u300c\u4e00\u6642\u505c\u6b62\u300d\u306b\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u4e0a\u8a18\u3092\u884c\u306a\u3063\u3066\u3082\u89e3\u6d88\u3055\u308c\u305a<br>\u4e0b2\u884c\u3092\u7de8\u96c6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>startWorkTimerInternal() {\n      this.isWorkTimerActive = true;\n      this.isWorkTimerPaused = false;\n      this.currentTimerLabel = \"\u4f5c\u696d\u6642\u9593\";\n      this.remainingWorkSeconds = this.minutes * 60 + this.seconds;\n      this.timerInterval = setInterval(() =&gt; {\n        if (!this.isWorkTimerPaused) {\n          if (this.remainingWorkSeconds &gt; 0) {\n            this.remainingWorkSeconds--;\n          } else {\n            this.stopTimerInterval();\n            this.isWorkTimerActive = false;\n            this.isWorkTimerPaused = false;\n            this.sendTimerEndStatus(\"work\");\n            alert(\"\u4f5c\u696d\u6642\u9593\u7d42\u4e86\uff01\u4f11\u61a9\u3092\u958b\u59cb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\n            this.breakTimerStartButton = true; \/\/ \u2190 \u3053\u3053\u3092\u8ffd\u52a0\n            \/\/ this.startBreakTimerInternal(); \/\/ \u81ea\u52d5\u958b\u59cb\u3067\u306f\u306a\u304f\u30dc\u30bf\u30f3\u8868\u793a\n          }\n        }\n      }, 1000);\n    },<\/code><\/pre>\n\n\n\n<p>\u7d50\u679c\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u9023\u52d5\u3057\u3066\u52d5\u3044\u3066\u3057\u307e\u3046\u30bf\u30a4\u30de\u30fc\u304c\u751f\u6210\u3055\u308c\u308b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"760\" height=\"914\" src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-21-15.50.43.png\" alt=\"\" class=\"wp-image-157\" srcset=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-21-15.50.43.png 760w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-21-15.50.43-249x300.png 249w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<p>\u4f55\u5ea6\u304b\u7de8\u96c6\u3057\u3066\u3082\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081<br>\u305d\u308c\u305e\u308c\u306e\u72b6\u614b\u3092\u307e\u3068\u3081\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f<br><a href=\"https:\/\/suyasuyahirohiro.com\/?p=172\">https:\/\/suyasuyahirohiro.com\/?p=172<\/a><br><br>\u305d\u306e\u7d50\u679c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4e00\u6642\u505c\u6b62\u3082\u3046\u307e\u304f\u4f5c\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u753b\u9762\u53ce\u9332-2025-04-26-19.20.53.mov\"><\/video><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u5ea6\u52d5\u3044\u305f\u30bf\u30a4\u30de\u30fc\u3092\u6b62\u3081\u3089\u308c\u306a\u3044\u306e\u3067\u4e00\u6642\u505c\u6b62\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3053\u306e\u90e8\u5206\u3067\u306f\u8a18\u8f09\u3057\u305f\u306f\u305a\u306e\u4e00\u6642\u505c\u6b62\u30bf\u30a4\u30de\u30fc\u304c\u51fa\u529b\u3055\u308c\u306a\u3044\u3001\u30bf\u30b9\u30af\u7d42\u4e86\u5f8c\u4f11\u61a9\u30bf\u30a4\u30de\u30fc\u306b\u9077\u79fb\u3057\u306a\u304b\u3063\u305f\u308a\u3068\u5927\u5909\u3067\u3057\u305f 1. data \u30aa\u30d7\u30b7\u30e7\u30f3 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":3,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":176,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions\/176"}],"wp:attachment":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}