{"id":2016,"date":"2025-06-10T01:03:54","date_gmt":"2025-06-10T01:03:54","guid":{"rendered":"https:\/\/satokotadesign.com\/blog\/?p=2016"},"modified":"2025-06-10T01:03:54","modified_gmt":"2025-06-10T01:03:54","slug":"reading-progress-bar","status":"publish","type":"post","link":"https:\/\/satokotadesign.com\/blog\/reading-progress-bar\/","title":{"rendered":"\u8aad\u3080\u9032\u6357\u30d0\u30fc\u3092CSS\uff0bJavaScript\u3067\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\uff5c\u30b9\u30af\u30ed\u30fc\u30eb\u9023\u52d5\u306eUX\u6539\u5584\u30c6\u30af\u30cb\u30c3\u30af"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067WEB\u30c7\u30b6\u30a4\u30ca\u30fc\u3092\u3057\u3066\u3044\u307e\u3059\u5c0f\u7027\u3067\u3059\u3002<\/p>\n<p>\u300c\u8a18\u4e8b\u304c\u3069\u3053\u307e\u3067\u8aad\u307e\u308c\u3066\u3044\u308b\u306e\u304b\u300d<br \/>\n\u300c\u3042\u3068\u3069\u308c\u304f\u3089\u3044\u3067\u8aad\u307f\u7d42\u308f\u308b\u306e\u304b\u300d<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u304cWeb\u30b5\u30a4\u30c8\u3067\u9577\u6587\u8a18\u4e8b\u3092\u8aad\u3080\u3068\u304d\u3001\u5b9f\u306f<span class=\"sc_marker\">\u3053\u306e\u4f53\u611f<\/span>\u3063\u3066\u610f\u5916\u3068\u5927\u4e8b\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u6d3b\u8e8d\u3059\u308b\u306e\u304c\u3001\u753b\u9762\u4e0a\u90e8\u306b\u8868\u793a\u3055\u308c\u308b<span class=\"sc_marker-animation\">\u300c\u8aad\u3080\u9032\u6357\u30d0\u30fc\uff08Reading Progress Bar\uff09\u300d<\/span>\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u88c5\u306f\u610f\u5916\u3068\u30b7\u30f3\u30d7\u30eb\u3002<br \/>\nJavaScript\u3068CSS\u3060\u3051\u3067\u3001<span class=\"sc_marker\">\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u5fdc\u3058\u3066\u6a2a\u306b\u4f38\u3073\u3066\u3044\u304f\u9032\u884c\u5ea6\u30d0\u30fc<\/span>\u304c\u4f5c\u308c\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u3001\u305d\u3093\u306a\u8aad\u3080\u9032\u6357\u30d0\u30fc\u3092\u6700\u5c0f\u69cb\u6210\u304b\u3064\u30b3\u30d4\u30da\u3067\u5c0e\u5165\u53ef\u80fd\u306a\u5f62\u3067\u4e01\u5be7\u306b\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">\u8aad\u3080\u9032\u6357\u30d0\u30fc\u3068\u306f\uff1fUX\u3078\u306e\u52b9\u679c<\/span><\/h2>\n<p>\u9032\u6357\u30d0\u30fc\u3068\u306f\u3001\u753b\u9762\u306e\u6700\u4e0a\u90e8\uff08\u307e\u305f\u306f\u4efb\u610f\u306e\u4f4d\u7f6e\uff09\u306b\u914d\u7f6e\u3055\u308c\u3001\u30da\u30fc\u30b8\u306e\u8aad\u307f\u9032\u3081\u5177\u5408\u306b\u5fdc\u3058\u3066\u6a2a\u306b\u4f38\u3073\u3066\u3044\u304f\u30d0\u30fc\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u4e3b\u306a\u30e1\u30ea\u30c3\u30c8\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"sc_designlist ul fa_check blue\">\n<ul>\n<li>\u8aad\u4e86\u307e\u3067\u306e\u76ee\u5b89\u304c\u8996\u899a\u7684\u306b\u5206\u304b\u308b<\/li>\n<li>\u300c\u8aad\u3080\u3053\u3068\u306b\u96c6\u4e2d\u3057\u3084\u3059\u3044\u300d\u5fc3\u7406\u72b6\u614b\u3092\u4f5c\u308b<\/li>\n<li>\u8a18\u4e8b\u306e\u96e2\u8131\u7387\u3084\u76f4\u5e30\u7387\u306e\u6539\u5584\u306b\u3064\u306a\u304c\u308b<\/li>\n<\/ul>\n<\/div>\n<p>\u30d6\u30ed\u30b0\u8a18\u4e8b\u3084\u30ce\u30a6\u30cf\u30a6\u30da\u30fc\u30b8\u3001\u7e26\u9577\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u3074\u3063\u305f\u308a\u306e\u6f14\u51fa\u3067\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">\u5b9f\u969b\u306e\u30b3\u30fc\u30c9<\/span><\/h2>\n<p class=\"codepen\" data-height=\"300\" data-default-tab=\"html,result\" data-slug-hash=\"MYwONmE\" data-pen-title=\"Untitled\" data-user=\"ekwwawpb-the-styleful\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\/pen\/MYwONmE\"><br \/>\n  Untitled<\/a> by \u5c0f\u7027\u8ce2 (<a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\">@ekwwawpb-the-styleful<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">HTML\u69cb\u9020\u306f\u305f\u3063\u305f1\u884c<\/span><\/h2>\n<p>\u307e\u305a\u306f\u3001\u30d0\u30fc\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306eHTML\u8981\u7d20\u3092\u3072\u3068\u3064\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u3053\u308c\u3092 <span class=\"fontbackground\" style=\"background:;\">body<\/span>\u306e\u76f4\u4e0b\u3001\u307e\u305f\u306f <span class=\"fontbackground\" style=\"background:;\">header<\/span>\u306e\u4e2d\u306b\u8a2d\u7f6e\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<pre class=\"line-numbers\" ><code class=\"language-markup\">&lt;div id=&quot;progressBar&quot;&gt;&lt;\/div&gt;<\/code><\/pre>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">CSS\u3067\u30d0\u30fc\u306e\u898b\u305f\u76ee\u3092\u4f5c\u308b<\/span><\/h2>\n<p>\u6b21\u306b\u3001\u30b9\u30bf\u30a4\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u30d0\u30fc\u306e\u898b\u305f\u76ee\u3092\u6574\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\" ><code class=\"language-css\">#progressBar {\r\n  position: fixed;\r\n  top: 0;\r\n  left: 0;\r\n  width: 0%;\r\n  height: 4px;\r\n  background-color: #03a9f4;\r\n  z-index: 9999;\r\n  transition: width 0.2s ease-out;\r\n}<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001<span class=\"sc_marker-animation\">\u300c\u5e450\uff05\u304b\u3089\u5f90\u3005\u306b\u4f38\u3073\u308b\u9752\u3044\u30e9\u30a4\u30f3\u300d<\/span>\u304c\u51fa\u6765\u4e0a\u304c\u308a\u307e\u3059\u3002<br \/>\n\u56fa\u5b9a\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u3066\u3082\u5e38\u306b\u4e0a\u90e8\u306b\u8868\u793a\u3055\u308c\u7d9a\u3051\u307e\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">JavaScript\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u9023\u52d5\u3055\u305b\u308b<\/span><\/h2>\n<p>\u305d\u3057\u3066\u809d\u5fc3\u306e\u300c\u30b9\u30af\u30ed\u30fc\u30eb\u91cf\u306b\u5fdc\u3058\u3066\u4f38\u3073\u308b\u300d\u52d5\u4f5c\u3092\u3001JavaScript\u3067\u5236\u5fa1\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\" ><code class=\"language-js\">window.addEventListener(&#039;scroll&#039;, () =&gt; {\r\n  const scrollTop = window.scrollY;\r\n  const docHeight = document.documentElement.scrollHeight - window.innerHeight;\r\n  const scrollPercent = (scrollTop \/ docHeight) * 100;\r\n  document.getElementById(&#039;progressBar&#039;).style.width = scrollPercent + &#039;%&#039;;\r\n});<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u30da\u30fc\u30b8\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u3092\u5e38\u306b\u76e3\u8996\u3057\u3066\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u5168\u4f53\u306e\u9ad8\u3055\u306b\u5bfe\u3059\u308b\u30b9\u30af\u30ed\u30fc\u30eb\u7387\u3092\u30d0\u30fc\u306e\u6a2a\u5e45\u306b\u53cd\u6620\u3057\u307e\u3059\u3002<br \/>\n\u5b9f\u306b\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u304c\u3001UX\u306e\u8cea\u3092\u3050\u3063\u3068\u5f15\u304d\u4e0a\u3052\u308b\u6f14\u51fa\u304c\u3053\u308c\u3060\u3051\u3067\u5b8c\u6210\u3059\u308b\u3093\u3067\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">\u5fdc\u7528\uff1a\u8272\u306e\u5909\u5316\u3084\u30d5\u30a7\u30fc\u30c9\u6f14\u51fa\u3082<\/span><\/h2>\n<p>\u3088\u308a\u5370\u8c61\u7684\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6f14\u51fa\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"sc_designlist ul fa_check blue\">\n<ul>\n<li>\u30ab\u30e9\u30fc\u3092\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306b\u3059\u308b<\/li>\n<li>\u8aad\u307f\u5207\u308a\u6642\u306b\u30d0\u30fc\u304c\u6d88\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<li>\u4e0a\u306b\u5c0f\u3055\u306a\u6570\u5b57\u3067\u300c\u25cb\u25cb\uff05\u300d\u8868\u793a\u3092\u52a0\u3048\u308b<\/li>\n<\/ul>\n<\/div>\n<p>CSS\u306e linear-gradient \u3084 JavaScript\u306e innerText \u64cd\u4f5c\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u8996\u899a\u6027\u3068\u6f14\u51fa\u306e\u5e45\u3092\u5e83\u3052\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">\u307e\u3068\u3081\uff1a\u305f\u3063\u305f1\u884c\u306e\u8981\u7d20\u3068\u6570\u5341\u884c\u306e\u30b3\u30fc\u30c9\u3067UX\u304c\u9032\u5316\u3059\u308b<\/span><\/h2>\n<p>\u8aad\u3080\u9032\u6357\u30d0\u30fc\u306f\u3001\u898b\u305f\u76ee\u3068\u3057\u3066\u306f\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u8981\u7d20\u3067\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3001\u305d\u306e\u52b9\u679c\u306f\u8a08\u308a\u77e5\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u306b\u3068\u3063\u3066\u300c\u3053\u306e\u30da\u30fc\u30b8\u306f\u3061\u3083\u3093\u3068\u8a2d\u8a08\u3055\u308c\u3066\u3044\u308b\u300d\u3068\u3044\u3046\u5b89\u5fc3\u611f\u3084\u3001<br \/>\n<span class=\"sc_marker\">\u300c\u3042\u3068\u5c11\u3057\u3067\u8aad\u307f\u7d42\u308f\u308b\u306a\u300d\u3068\u3044\u3046\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3<\/span>\u3092\u4e0e\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u88c5\u3082\u96e3\u3057\u304f\u306a\u304f\u3001\u6570\u884c\u306eCSS\u3068JavaScript\u3067\u5b8c\u7d50\u3059\u308b\u306e\u304c\u6700\u5927\u306e\u9b45\u529b\u3002<br \/>\n\u305c\u3072\u3001\u3042\u306a\u305f\u306eWeb\u30b5\u30a4\u30c8\u3084\u30d6\u30ed\u30b0\u306b\u3082\u53d6\u308a\u5165\u308c\u3066\u3001UX\u5411\u4e0a\u3092\u5b9f\u611f\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<p>&nbsp;<\/p>\n<p><figure id=\"attachment_475\" aria-describedby=\"caption-attachment-475\" style=\"width: 1500px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/satokotadesign.com\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr.jpg\" alt=\"\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u5236\u4f5c\u306a\u3089satokotadesign\" width=\"1500\" height=\"500\" class=\"size-full wp-image-475\" srcset=\"https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr.jpg 1500w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr-500x167.jpg 500w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr-1024x341.jpg 1024w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr-768x256.jpg 768w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/a><figcaption id=\"caption-attachment-475\" class=\"wp-caption-text\"><a href=\"https:\/\/satokotadesign.com\/contact\/\" target=\"_blank\" rel=\"noopener\">\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u5236\u4f5c\u306a\u3089satokotadesign<\/a><\/figcaption><\/figure><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067WEB\u30c7\u30b6\u30a4\u30ca\u30fc\u3092\u3057\u3066\u3044\u307e\u3059\u5c0f\u7027\u3067\u3059\u3002 \u300c\u8a18\u4e8b\u304c\u3069\u3053\u307e\u3067\u8aad\u307e\u308c\u3066\u3044\u308b\u306e\u304b\u300d \u300c\u3042\u3068\u3069\u308c\u304f\u3089\u3044\u3067\u8aad\u307f\u7d42\u308f\u308b\u306e\u304b\u300d \u30e6\u30fc\u30b6\u30fc\u304cWeb\u30b5\u30a4\u30c8\u3067\u9577\u6587\u8a18\u4e8b\u3092\u8aad\u3080\u3068\u304d\u3001\u5b9f\u306f\u3053\u306e\u4f53\u611f\u3063\u3066\u610f\u5916\u3068\u5927\u4e8b\u3067\u3059\u3002 \u305d\u3053\u3067\u6d3b\u8e8d\u3059\u308b\u306e\u304c\u3001\u753b\u9762\u2026<\/p>\n","protected":false},"author":1,"featured_media":2018,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[8],"class_list":["post-2016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","tag-javascript"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts\/2016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/comments?post=2016"}],"version-history":[{"count":2,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts\/2016\/revisions"}],"predecessor-version":[{"id":2019,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts\/2016\/revisions\/2019"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/media\/2018"}],"wp:attachment":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/media?parent=2016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/categories?post=2016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/tags?post=2016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}