{"id":1345,"date":"2023-05-01T11:27:15","date_gmt":"2023-05-01T08:27:15","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=1345"},"modified":"2023-05-01T11:27:18","modified_gmt":"2023-05-01T08:27:18","slug":"menu-switcher","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/switch\/1345\/","title":{"rendered":"Menu Switcher"},"content":{"rendered":"<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Menu Switcher\" width=\"640\" height=\"480\" src=\"https:\/\/www.youtube.com\/embed\/_dalc2PaA1w?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">  &lt;link\n  rel=&quot;stylesheet&quot;\n  href=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/6.1.1\/css\/all.min.css&quot;\n  integrity=&quot;sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==&quot;\n  crossorigin=&quot;anonymous&quot;\n  referrerpolicy=&quot;no-referrer&quot;\n\/&gt;\n&lt;div class=&quot;menu-switcher-container&quot; id=&quot;menuSwitcher&quot;&gt;\n  &lt;div class=&quot;menu&quot; id=&quot;menu&quot;&gt;\n    &lt;div class=&quot;item&quot;&gt;CSS&lt;\/div&gt;\n    &lt;div class=&quot;item&quot;&gt;HTML&lt;\/div&gt;\n    &lt;div class=&quot;item&quot;&gt;JavaScript&lt;\/div&gt;\n    &lt;div class=&quot;item&quot;&gt;BootStrap&lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;down-arrow&quot;&gt;\n    &lt;i class=&quot;fa-solid fa-angle-down&quot;&gt;&lt;\/i&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;css&quot;,&quot;mime&quot;:&quot;text\/css&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;CSS&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;css&quot;}\">*,\n::before,\n::after {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n}\n\nbody {\n  height: 100vh;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  background-color: #e5e5e5;\n}\n\n.menu-switcher-container {\n  position: relative;\n  width: 12.5em;\n  height: 5em;\n  border-radius: 7em;\n  background-color: #f5f5f5;\n  box-shadow: 0 0 0.5em rgb(190, 190, 190);\n  cursor: pointer;\n  overflow: hidden;\n  \n  transition: all 350ms ease-in-out;\n}\n\n.menu-switcher-container:hover {\n  box-shadow: 0 0 1em rgb(190, 190, 190);\n  transform: scale(0.97);\n}\n\n.down-arrow {\n  position: absolute;\n  height: 100%;\n  width: 3em;\n  \/* border: 1px solid red; *\/\n  right: 0;\n  display: grid;\n  place-items: center;\n  font-size: 1.55em;\n  color: #aaa;\n}\n\n.menu-switcher-container:hover .down-arrow {\n  color: #444444;\n}\n\n.menu {\n  position: absolute;\n  \/* border: 1px solid red; *\/\n  width: 5em;\n  height: 5em;\n  border-radius: 50%;\n  left: -2.5em;\n  transition: transform 500ms ease-in-out;\n}\n\n.menu .item {\n  position: absolute;\n  font-family: sans-serif;\n  font-size: 1.25rem;\n}\n\n.menu .item:nth-child(1) {\n  top: 50%;\n  right: -2em;\n  transform: translateY(-50%);\n}\n\n.menu .item:nth-child(2) {\n  top: -2em;\n  left: 50%;\n  transform: translateX(-50%) rotate(-90deg);\n}\n\n.menu .item:nth-child(3) {\n  left: -120%;\n  top: 50%;\n  transform: translateY(-50%) rotate(-180deg);\n}\n\n.menu .item:nth-child(4) {\n  left: 50%;\n  top: 140%;\n  transform: translateX(-50%) rotate(90deg);\n}<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const menuSwitcher = document.getElementById(&quot;menuSwitcher&quot;);\nconst menu = document.getElementById(&quot;menu&quot;);\nlet rotation = 0;\nmenuSwitcher.addEventListener(&quot;click&quot;, () =&gt; {\n  rotation += 90;\n  menu.style.transform = `rotate(${rotation}deg)`;\n});<\/pre><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-1345","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-switch"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/comments?post=1345"}],"version-history":[{"count":1,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1345\/revisions"}],"predecessor-version":[{"id":1347,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1345\/revisions\/1347"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/1346"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=1345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=1345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=1345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}