{"id":1124,"date":"2023-04-01T17:58:48","date_gmt":"2023-04-01T14:58:48","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=1124"},"modified":"2023-04-01T17:58:50","modified_gmt":"2023-04-01T14:58:50","slug":"pure-css-sidebar-toggle-menu","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/sidebar\/1124\/","title":{"rendered":"Pure CSS sidebar toggle menu"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video height=\"524\" style=\"aspect-ratio: 868 \/ 524;\" width=\"868\" controls src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/04\/vokoscreenng-2023-04-01_16-54-51.webm\"><\/video><\/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;div class=&quot;header&quot;&gt;&lt;\/div&gt;\n  &lt;input type=&quot;checkbox&quot; class=&quot;openSidebarMenu&quot; id=&quot;openSidebarMenu&quot;&gt;\n  &lt;label for=&quot;openSidebarMenu&quot; class=&quot;sidebarIconToggle&quot;&gt;\n    &lt;div class=&quot;spinner diagonal part-1&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;spinner horizontal&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;spinner diagonal part-2&quot;&gt;&lt;\/div&gt;\n  &lt;\/label&gt;\n  &lt;div id=&quot;sidebarMenu&quot;&gt;\n    &lt;ul class=&quot;sidebarMenuInner&quot;&gt;\n      &lt;li&gt;Lorem&lt;span&gt;Lorem ipsum &lt;\/span&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=&quot;#&quot; target=&quot;_blank&quot;&gt;Company&lt;\/a&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=&quot;#&quot; target=&quot;_blank&quot;&gt;Instagram&lt;\/a&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=&quot;#&quot; target=&quot;_blank&quot;&gt;Twitter&lt;\/a&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=&quot;#&quot; target=&quot;_blank&quot;&gt;YouTube&lt;\/a&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=&quot;#&quot; target=&quot;_blank&quot;&gt;Linkedin&lt;\/a&gt;&lt;\/li&gt;\n    &lt;\/ul&gt;\n  &lt;\/div&gt;\n  &lt;div id='center' class=&quot;main center&quot;&gt;\n    &lt;div class=&quot;mainInner&quot;&gt;\n      &lt;div&gt;PURE CSS SIDEBAR TOGGLE MENU&lt;\/div&gt;\n  &lt;\/div&gt;\n\n&lt;script src=&quot; https:\/\/unpkg.co\/gsap@3\/dist\/gsap.min.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- Autor  JELENA JOVANOVIC --&gt;\n&lt;script src=&quot;script.js&quot;&gt;&lt;\/script&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;}\">@import url('https:\/\/fonts.googleapis.com\/css?family=Varela+Round');\nhtml, body {\n    overflow-x: hidden;\n    height: 100%;\n}\nbody {\n    background: #fff;\n    padding: 0;\n    margin: 0;\n    font-family: 'Varela Round', sans-serif;\n}\n.header {\n    display: block;\n    margin: 0 auto;\n    width: 100%;\n    max-width: 100%;\n    box-shadow: none;\n    background-color: #FC466B;\n    position: fixed;\n    height: 60px!important;\n    overflow: hidden;\n    z-index: 10;\n}\n.main {\n    margin: 0 auto;\n    display: block;\n    height: 100%;\n    margin-top: 60px;\n}\n.mainInner{\n    display: table;\n    height: 100%;\n    width: 100%;\n    text-align: center;\n}\n.mainInner div{\n    display:table-cell;\n    vertical-align: middle;\n    font-size: 3em;\n    font-weight: bold;\n    letter-spacing: 1.25px;\n}\n#sidebarMenu {\n    height: 100%;\n    position: fixed;\n    left: 0;\n    width: 250px;\n    margin-top: 60px;\n    transform: translateX(-250px);\n    transition: transform 250ms ease-in-out;\n    background: linear-gradient(180deg, #FC466B 0%, #3F5EFB 100%);\n}\n.sidebarMenuInner{\n    margin:0;\n    padding:0;\n    border-top: 1px solid rgba(255, 255, 255, 0.10);\n}\n.sidebarMenuInner li{\n    list-style: none;\n    color: #fff;\n    text-transform: uppercase;\n    font-weight: bold;\n    padding: 20px;\n    cursor: pointer;\n    border-bottom: 1px solid rgba(255, 255, 255, 0.10);\n}\n.sidebarMenuInner li span{\n    display: block;\n    font-size: 14px;\n    color: rgba(255, 255, 255, 0.50);\n}\n.sidebarMenuInner li a{\n    color: #fff;\n    text-transform: uppercase;\n    font-weight: bold;\n    cursor: pointer;\n    text-decoration: none;\n}\ninput[type=&quot;checkbox&quot;]:checked ~ #sidebarMenu {\n    transform: translateX(0);\n}\n\ninput[type=checkbox] {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    display: none;\n}\n.sidebarIconToggle {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    cursor: pointer;\n    position: absolute;\n    z-index: 99;\n    height: 100%;\n    width: 100%;\n    top: 22px;\n    left: 15px;\n    height: 22px;\n    width: 22px;\n}\n.spinner {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    position: absolute;\n    height: 3px;\n    width: 100%;\n    background-color: #fff;\n}\n.horizontal {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    position: relative;\n    float: left;\n    margin-top: 3px;\n}\n.diagonal.part-1 {\n    position: relative;\n    transition: all 0.3s;\n    box-sizing: border-box;\n    float: left;\n}\n.diagonal.part-2 {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    position: relative;\n    float: left;\n    margin-top: 3px;\n}\ninput[type=checkbox]:checked ~ .sidebarIconToggle &gt; .horizontal {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    opacity: 0;\n}\ninput[type=checkbox]:checked ~ .sidebarIconToggle &gt; .diagonal.part-1 {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    transform: rotate(135deg);\n    margin-top: 8px;\n}\ninput[type=checkbox]:checked ~ .sidebarIconToggle &gt; .diagonal.part-2 {\n    transition: all 0.3s;\n    box-sizing: border-box;\n    transform: rotate(-135deg);\n    margin-top: -9px;\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1126,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[16],"class_list":["post-1124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sidebar","tag-htmlcss"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1124","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=1124"}],"version-history":[{"count":1,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1124\/revisions"}],"predecessor-version":[{"id":1127,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1124\/revisions\/1127"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/1126"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=1124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=1124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=1124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}