{"id":64,"date":"2026-05-26T08:51:07","date_gmt":"2026-05-25T23:51:07","guid":{"rendered":"https:\/\/toirolifecare.com\/app\/?page_id=64"},"modified":"2026-05-26T09:02:34","modified_gmt":"2026-05-26T00:02:34","slug":"price","status":"publish","type":"page","link":"https:\/\/toirolifecare.com\/app\/price\/","title":{"rendered":""},"content":{"rendered":"\n<!doctype html>\n<html lang=\"ja\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>\u8a2a\u554f\u6599\u91d1\u8a08\u7b97\u6a5f<\/title>\n\n<style>\nbody{\n  font-family:sans-serif;\n  background:#eef5ff;\n  margin:0;\n  padding:20px;\n}\n\n.card{\n  background:white;\n  border-radius:14px;\n  padding:16px;\n  margin-bottom:16px;\n  box-shadow:0 4px 10px rgba(0,0,0,0.05);\n}\n\nh1{ margin-top:0; }\n\nlabel{\n  font-weight:bold;\n  display:block;\n  margin-top:8px;\n}\n\nselect{\n  width:100%;\n  padding:10px;\n  margin-top:6px;\n  margin-bottom:12px;\n  font-size:16px;\n  box-sizing:border-box;\n}\n\n.time-group{\n  display:flex;\n  gap:8px;\n}\n\n.time-group select{\n  flex:1;\n}\n\n.checkline{\n  display:flex;\n  align-items:center;\n  gap:8px;\n  margin-top:8px;\n}\n\n.checkline input{\n  width:auto;\n  margin:0;\n}\n\n.total{\n  font-size:34px;\n  font-weight:bold;\n  margin-top:10px;\n}\n\n.formula{\n  white-space:pre-wrap;\n  background:#f6f8ff;\n  padding:10px;\n  border-radius:10px;\n  line-height:1.7;\n}\n<\/style>\n<\/head>\n\n<body>\n\n<div class=\"card\">\n  <h1>\u8a2a\u554f\u6599\u91d1\u8a08\u7b97\u6a5f<\/h1>\n\n  <label>\u30b5\u30fc\u30d3\u30b9<\/label>\n  <select id=\"service\">\n    <option value=\"7000\">\u770b\u8b77\u30b9\u30dd\u30c3\u30c8<\/option>\n    <option value=\"4000\">\u4ecb\u8b77\u30b9\u30dd\u30c3\u30c8<\/option>\n    <option value=\"3500\">\u751f\u6d3b\u30b9\u30dd\u30c3\u30c8<\/option>\n    <option value=\"6000\">\u770b\u8b77\u5b9a\u671f<\/option>\n    <option value=\"3500\">\u4ecb\u8b77\u5b9a\u671f<\/option>\n    <option value=\"3000\">\u5bb6\u4e8b\u5b9a\u671f<\/option>\n    <option value=\"1000\">\u6253\u3061\u5408\u308f\u305b<\/option>\n  <\/select>\n\n  <label>\u958b\u59cb\u6642\u9593<\/label>\n  <div class=\"time-group\">\n    <select id=\"startH\"><\/select>\n    <select id=\"startM\"><\/select>\n  <\/div>\n\n  <label>\u7d42\u4e86\u6642\u9593<\/label>\n  <div class=\"time-group\">\n    <select id=\"endH\"><\/select>\n    <select id=\"endM\"><\/select>\n  <\/div>\n\n  <label class=\"checkline\">\n    <input type=\"checkbox\" id=\"holiday\">\n    <span>\u5e74\u672b\u5e74\u59cb<\/span>\n  <\/label>\n<\/div>\n\n<div class=\"card\">\n  <div>\u5408\u8a08<\/div>\n  <div id=\"total\" class=\"total\">&#8211;<\/div>\n  <div id=\"formula\" class=\"formula\"><\/div>\n<\/div>\n\n<script>\nfunction createHourOptions(id){\n  const el = document.getElementById(id);\n  for(let h = 0; h < 24; h++){\n    const text = String(h).padStart(2, \"0\") + \"\u6642\";\n    const opt = document.createElement(\"option\");\n    opt.value = h;\n    opt.textContent = text;\n    el.appendChild(opt);\n  }\n}\n\nfunction createMinuteOptions(id){\n  const el = document.getElementById(id);\n  for(let m = 0; m < 60; m += 5){\n    const text = String(m).padStart(2, \"0\") + \"\u5206\";\n    const opt = document.createElement(\"option\");\n    opt.value = m;\n    opt.textContent = text;\n    el.appendChild(opt);\n  }\n}\n\ncreateHourOptions(\"startH\");\ncreateHourOptions(\"endH\");\ncreateMinuteOptions(\"startM\");\ncreateMinuteOptions(\"endM\");\n\ndocument.getElementById(\"startH\").value = 9;\ndocument.getElementById(\"startM\").value = 0;\ndocument.getElementById(\"endH\").value = 10;\ndocument.getElementById(\"endM\").value = 0;\n\nfunction yen(n){\n  return Math.round(n).toLocaleString() + \"\u5186\";\n}\n\nfunction toMin(h, m){\n  return h * 60 + m;\n}\n\nfunction formatHour(min){\n  return (min \/ 60).toFixed(1).replace(\/\\.0$\/, \"\");\n}\n\nfunction roundTo30(min){\n  const hours = Math.floor(min \/ 60);\n  const remain = min % 60;\n\n  if(remain < 15){\n    return hours * 60;\n  }else if(remain < 45){\n    return hours * 60 + 30;\n  }else{\n    return (hours + 1) * 60;\n  }\n}\n\nfunction isNight(min){\n  const t = ((min % 1440) + 1440) % 1440;\n  return t >= 18 * 60 && t < 22 * 60;\n}\n\nfunction calculate(){\n  const price = Number(document.getElementById(\"service\").value);\n\n  let start = toMin(\n    Number(document.getElementById(\"startH\").value),\n    Number(document.getElementById(\"startM\").value)\n  );\n\n  let end = toMin(\n    Number(document.getElementById(\"endH\").value),\n    Number(document.getElementById(\"endM\").value)\n  );\n\n  const holiday = document.getElementById(\"holiday\").checked;\n\n  if(end <= start){\n    end += 1440;\n  }\n\n  const rawMinutes = end - start;\n  const billedMinutes = roundTo30(rawMinutes);\n\n  let normalMinutes = 0;\n  let nightMinutes = 0;\n\n  for(let t = start; t < start + billedMinutes; t += 30){\n    if(isNight(t)){\n      nightMinutes += 30;\n    }else{\n      normalMinutes += 30;\n    }\n  }\n\n  const holidayRate = holiday ? 1.2 : 1;\n  const nightRate = 1.25;\n\n  const normalTotal = price * (normalMinutes \/ 60) * holidayRate;\n  const nightTotal = price * (nightMinutes \/ 60) * nightRate * holidayRate;\n  const total = normalTotal + nightTotal;\n\n  let formula = \"\";\n\n  formula += \"\u30b5\u30fc\u30d3\u30b9\u5358\u4fa1 = \" + yen(price) + \" \/ \u6642\u9593\\n\";\n  formula += \"\u5b9f\u5229\u7528\u6642\u9593 = \" + formatHour(rawMinutes) + \"\u6642\u9593\\n\";\n  formula += \"\u8acb\u6c42\u6642\u9593 = \" + formatHour(billedMinutes) + \"\u6642\u9593\\n\\n\";\n\n  formula += \"\u3010\u901a\u5e38\u6642\u9593\u3011\\n\";\n  formula += formatHour(normalMinutes) + \"\u6642\u9593\\n\";\n  formula += yen(price) + \" \u00d7 \" + formatHour(normalMinutes);\n  if(holiday){\n    formula += \" \u00d7 1.2\";\n  }\n  formula += \" = \" + yen(normalTotal) + \"\\n\\n\";\n\n  formula += \"\u3010\u591c\u9593\u6642\u9593\uff0818:00\u301c22:00\uff09\u3011\\n\";\n  formula += formatHour(nightMinutes) + \"\u6642\u9593\\n\";\n  formula += yen(price) + \" \u00d7 \" + formatHour(nightMinutes) + \" \u00d7 1.25\";\n  if(holiday){\n    formula += \" \u00d7 1.2\";\n  }\n  formula += \" = \" + yen(nightTotal) + \"\\n\";\n\n  if(holiday){\n    formula += \"\\n\u203b\u5e74\u672b\u5e74\u59cb\u52a0\u7b97\u3042\u308a\";\n  }\n\n  formula += \"\\n\\n\u5408\u8a08 = \" + yen(total);\n\n  document.getElementById(\"total\").innerText = yen(total);\n  document.getElementById(\"formula\").innerText = formula;\n}\n\ndocument.querySelectorAll(\"select,input\").forEach(el => {\n  el.addEventListener(\"change\", calculate);\n});\n\ncalculate();\n<\/script>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>\u8a2a\u554f\u6599\u91d1\u8a08\u7b97\u6a5f \u8a2a\u554f\u6599\u91d1\u8a08\u7b97\u6a5f \u30b5\u30fc\u30d3\u30b9 \u770b\u8b77\u30b9\u30dd\u30c3\u30c8\u4ecb\u8b77\u30b9\u30dd\u30c3\u30c8\u751f\u6d3b\u30b9\u30dd\u30c3\u30c8\u770b\u8b77\u5b9a\u671f\u4ecb\u8b77\u5b9a\u671f\u5bb6\u4e8b\u5b9a\u671f\u6253\u3061\u5408\u308f\u305b \u958b\u59cb\u6642\u9593 \u7d42\u4e86\u6642\u9593 \u5e74\u672b\u5e74\u59cb \u5408\u8a08 &#8211;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-64","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":2,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages\/64\/revisions"}],"predecessor-version":[{"id":66,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages\/64\/revisions\/66"}],"wp:attachment":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/media?parent=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}