{"id":9076,"date":"2021-10-22T20:52:16","date_gmt":"2021-10-22T17:52:16","guid":{"rendered":"https:\/\/elzero.org\/?p=9076"},"modified":"2022-09-28T18:15:36","modified_gmt":"2022-09-28T15:15:36","slug":"tutorials-fullscreen-navigation","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/tutorials-fullscreen-navigation\/","title":{"rendered":"Fullscreen Navigation"},"content":{"rendered":"<h3>\u0627\u0644 Code<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-html\">\r\n<span class=\"toggle\">\r\n  <span><\/span>\r\n  <span><\/span>\r\n  <span><\/span>\r\n<\/span>\r\n<nav>\r\n  <span class=\"close\">X<\/span>\r\n  <a href=\"#\">Home<\/a>\r\n  <a href=\"#\">About<\/a>\r\n  <a href=\"#\">Services<\/a>\r\n  <a href=\"#\">Contact<\/a>\r\n<\/nav>\r\n<\/script>\r\n\r\n<script type=\"text\/plain\" class=\"language-css\">\r\n* {\r\n  box-sizing: border-box;\r\n}\r\nbody {\r\n  font-family: \"Trebuchet MS\", \"Lucida Sans Unicode\", sans-serif;\r\n}\r\n.toggle {\r\n  width: 50px;\r\n  height: 50px;\r\n  display: flex;\r\n  background-color: #eee;\r\n  cursor: pointer;\r\n  \/* flex-direction: column;\r\n  justify-content: space-around;\r\n  padding: 8px; *\/\r\n  flex-wrap: wrap;\r\n  align-items: center;\r\n  padding: 8px;\r\n}\r\n.toggle span {\r\n  width: 100%;\r\n  background-color: #777;\r\n  height: 4px;\r\n  transition: 0.5s;\r\n}\r\n.toggle:hover span {\r\n  background-color: #333;\r\n}\r\nnav {\r\n  position: fixed;\r\n  z-index: 99999;\r\n  left: 0;\r\n  top: 0;\r\n  width: 100%;\r\n  height: 100%;\r\n  background-color: #333;\r\n  display: flex;\r\n  flex-direction: column;\r\n  justify-content: center;\r\n  transition: 0.5s;\r\n  transform: translateY(-100%);\r\n}\r\nnav.open {\r\n  transform: translateY(0);\r\n}\r\nnav .close {\r\n  position: fixed;\r\n  top: 20px;\r\n  right: 20px;\r\n  color: white;\r\n  border: 2px solid white;\r\n  width: 50px;\r\n  height: 50px;\r\n  display: flex;\r\n  justify-content: center;\r\n  align-items: center;\r\n  font-size: 30px;\r\n  border-radius: 50%;\r\n  transition: 0.5s;\r\n  cursor: pointer;\r\n}\r\nnav .close:hover {\r\n  color: indianred;\r\n  border-color: indianred;\r\n}\r\nnav a {\r\n  color: #eee;\r\n  text-decoration: none;\r\n  font-size: 35px;\r\n  display: flex;\r\n  justify-content: center;\r\n  align-items: center;\r\n  flex-basis: 80px;\r\n  transition: 0.5s;\r\n}\r\nnav a:hover {\r\n  background-color: rgb(0 0 0 \/ 50%);\r\n}\r\n<\/script>\r\n\r\n<script type=\"text\/plain\" class=\"language-javascript\">\r\nlet toggler = document.querySelector(\".toggle\");\r\nlet nav = document.querySelector(\"nav\");\r\nlet close = document.querySelector(\".close\");\r\n\r\ntoggler.onclick = function () {\r\n  nav.classList.add(\"open\");\r\n};\r\n\r\nclose.onclick = function () {\r\n  this.parentElement.classList.remove(\"open\");\r\n};\r\n\r\ndocument.onkeyup = function (e) {\r\n  \/\/ console.log(e);\r\n  if (e.key === \"Escape\") {\r\n    nav.classList.remove(\"open\");\r\n  }\r\n};\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>\u0627\u0644 Code<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[879],"tags":[],"class_list":["post-9076","post","type-post","status-publish","format-standard","hentry","category-front-end-tutorials"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/9076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=9076"}],"version-history":[{"count":1,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/9076\/revisions"}],"predecessor-version":[{"id":9077,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/9076\/revisions\/9077"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=9076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=9076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=9076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}