{"id":4667,"date":"2025-12-27T16:28:12","date_gmt":"2025-12-27T07:28:12","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=4667"},"modified":"2026-01-05T19:59:31","modified_gmt":"2026-01-05T10:59:31","slug":"%e3%83%8f%e3%83%b3%e3%83%90%e3%83%bc%e3%82%ac%e3%83%bc%e3%82%a2%e3%82%a4%e3%82%b3%e3%83%b3%e3%81%ae%e5%8b%95%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=4667","title":{"rendered":"\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u306e\u52d5\u4f5c"},"content":{"rendered":"\n<p>\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3082\u3001\u305d\u306e\u307e\u307e\u3067\u306f\u5229\u7528\u4fa1\u5024\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u4eca\u56de\u306f\u30af\u30ea\u30c3\u30af\u3057\u305f\u3089\u3001\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u306e\u5f62\u3092\u5909\u5f62\u3055\u305b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001\u524d\u56de\u306e\u7d9a\u304d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u524d\u56de<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=4634\" rel=\"noopener\" target=\"_blank\">\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\n<\/a><\/p>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u3084\u308a\u305f\u3044\u4e8b<\/h1>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u304c\u52d5\u304f\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n.box_test {\n  position: relative;\n  width: 50px;\n  height: 34px;\n}\n\n.box_test span {\n  position: absolute;\n  width: 100%;\n  height: 4px;\n  background-color: black;\n}\n\n\/* hamburger icon *\/\n.box_test span:nth-child(1) {\n  top: 0;\n}\n\n.box_test span:nth-child(2) {\n  top: 15px;\n}\n\n.box_test span:nth-child(3) {\n  bottom: 0;\n}\n\n\/* hamburger icon click *\/\n.box_test.active span:nth-child(1) {\n  transform: translateY(15px) rotate(-45deg);\n}\n\n.box_test.active span:nth-child(2) {\n  opacity: 0;\n}\n\n.box_test.active span:nth-child(3) {\n  transform: translateY(-15px) rotate(45deg);\n}\n<\/style>\n\n    <div class=\"box_test\">\n        <span> <\/span>\n        <span> <\/span>\n        <span> <\/span>\n    <\/div>\n\n<script>\nconst elements = document.getElementsByClassName('box_test');\nfor (let element of elements) {\n  element.addEventListener('click', function (e) {\n    element.classList.toggle('active');\n  });\n}\n<\/script>\n\n\n\n<h1 class=\"wp-block-heading\">JavaScript\u306e\u8ffd\u52a0<\/h1>\n\n\n\n<p>\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u306e\u3067\u3001\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u306b\u30af\u30ea\u30c3\u30af\u3067\u52d5\u4f5c\u3059\u308b\u70ba\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br>\u4eca\u56de\u306f\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068 &#8220;active&#8221; \u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3057\u305f\u308a\u524a\u9664\u3057\u305f\u308a\u3059\u308bjavascript\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002\u3053\u308c\u306f&#8221;active&#8221; \u30af\u30e9\u30b9\u306e\u6709\u7121\u306b\u3088\u308a\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u5909\u5f62\u3055\u305b\u308b\u70ba\u306e\u5b9f\u88c5\u306b\u306a\u308a\u307e\u3059\u3002<br>&#8220;active&#8221; \u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u3068\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u304c\u30d0\u30c4\u306b\u5909\u5316\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>&#8220;active&#8221; \u30af\u30e9\u30b9\u304c\u524a\u9664\u3055\u308c\u308b\u3068\u901a\u5e38\u306e\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u306b\u623b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>const elements = document.getElementsByClassName(&#39;box_test&#39;);\nfor (let element of elements) {\n  element.addEventListener(&#39;click&#39;, function (e) {\n    element.classList.toggle(&#39;active&#39;);\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u30a4\u30d9\u30f3\u30c8\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u3082\u53c2\u8003\u306b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u53c2\u8003<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=4654\" rel=\"noopener\" target=\"_blank\">\u30a4\u30d9\u30f3\u30c8\u5165\u9580\n<\/a><\/p>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">HTML<\/h1>\n\n\n\n<p>HTML\u306f\u524d\u56de\u3068\u5909\u308f\u3089\u306a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>    &lt;div class=&quot;box_test&quot;&gt;\n        &lt;span&gt; &lt;\/span&gt;\n        &lt;span&gt; &lt;\/span&gt;\n        &lt;span&gt; &lt;\/span&gt;\n    &lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">CSS<\/h1>\n\n\n\n<p>css\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u524d\u56de\u306b\u8ffd\u52a0\u3057\u3066\u3044\u308b\u90e8\u5206\u306f\u30b3\u30e1\u30f3\u30c8\u306e\u8a18\u8f09\u306b\u3042\u308b <strong>hamburger icon click<\/strong> \u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>.box_test {\n  position: relative;\n  width: 50px;\n  height: 34px;\n}\n\n.box_test span {\n  position: absolute;\n  width: 100%;\n  height: 4px;\n  background-color: black;\n}\n\n\/* hamburger icon *\/\n.box_test span:nth-child(1) {\n  top: 0;\n}\n\n.box_test span:nth-child(2) {\n  top: 15px;\n}\n\n.box_test span:nth-child(3) {\n  bottom: 0;\n}\n\n\/* hamburger icon click *\/\n.box_test.active span:nth-child(1) {\n  transform: translateY(15px) rotate(-45deg);\n}\n\n.box_test.active span:nth-child(2) {\n  opacity: 0;\n}\n\n.box_test.active span:nth-child(3) {\n  transform: translateY(-15px) rotate(45deg);\n}\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u8aac\u660e<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>\/* hamburger icon click *\/\n.box_test.active span:nth-child(1) {\n  transform: translateY(15px) rotate(-45deg);\n}\n\n.box_test.active span:nth-child(2) {\n  opacity: 0;\n}\n\n.box_test.active span:nth-child(3) {\n  transform: translateY(-15px) rotate(45deg);\n}\n<\/code><\/pre><\/div>\n\n\n\n<p>javascript\u306e\u52d5\u4f5c\u306f\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068 &#8220;active&#8221; \u3068\u3044\u3046\u30af\u30e9\u30b9\u306e\u3064\u3051\u5916\u3057\u3092\u3057\u3066\u3044\u307e\u3059\u3002<br>&#8220;active&#8221; \u30af\u30e9\u30b9\u304c\u8ffd\u52a0\u3055\u308c\u305f\u5834\u5408\u30011\u3064\u76ee\u306espan\u8981\u7d20\u306f transform \u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u3063\u3066\u79fb\u52d5\u3068\u56de\u8ee2\u3092\u3057\u3066\u3044\u307e\u3059\u30023\u3064\u76ee\u306espan\u8981\u7d20\u3082\u540c\u69d8\u3067\u3059\u3002<br>transform\u30d7\u30ed\u30d1\u30c6\u30a3\u306e rotate \u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\"><span class=\"box-title\">\u53c2\u8003<\/span>\n<p><a href=\"https:\/\/dennie.tokyo\/it\/?p=4693\" rel=\"noopener\" target=\"_blank\">\u3010CSS\u3011transform rotate\n<\/a><\/p>\n<\/div>\n\n\n\n<p>2\u3064\u76ee\u306espan\u8981\u7d20\u306f\u3001opacity: 0 \u306b\u306a\u308a\u898b\u3048\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p>\u7279\u306b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30a2\u30a4\u30b3\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3082\u3001\u305d\u306e\u307e\u307e\u3067\u306f\u5229\u7528\u4fa1\u5024\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"author":1,"featured_media":4723,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,25],"tags":[],"class_list":["post-4667","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","category-http"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4667"}],"version-history":[{"count":16,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4667\/revisions"}],"predecessor-version":[{"id":4722,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4667\/revisions\/4722"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/4723"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}