{"id":1555,"date":"2023-06-14T11:03:00","date_gmt":"2023-06-14T08:03:00","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=1555"},"modified":"2023-06-12T00:24:19","modified_gmt":"2023-06-11T21:24:19","slug":"navigation-menu","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/headermenu\/1555\/","title":{"rendered":"Navigation menu"},"content":{"rendered":"<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"548\" height=\"268\" src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/06\/peek-2023-06-10-22-00.gif\" alt=\"Navigation menu\" class=\"wp-image-1556 size-full\"\/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\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 href=&quot;https:\/\/fonts.googleapis.com\/css?family=Heebo:100,300,400,500,700,800,900&quot; rel=&quot;stylesheet&quot;&gt;\n \n  &lt;main id=&quot;app&quot;&gt;\n \n    &lt;nav&gt;\n      &lt;!-- gooey menu background --&gt;\n      &lt;aside class=&quot;goo&quot;&gt;\n        &lt;ul&gt;\n          &lt;li&gt;&lt;\/li&gt;\n          &lt;li&gt;&lt;\/li&gt;\n          &lt;li&gt;&lt;\/li&gt;\n          &lt;li&gt;&lt;\/li&gt;\n        &lt;\/ul&gt;\n      &lt;\/aside&gt;\n      &lt;!-- actual menu, cannot be inside gooey due to svg filter --&gt;\n      &lt;ul class=&quot;menu&quot;&gt;\n        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;\n          &lt;svg viewbox=&quot;0 0 24 24&quot;&gt;&lt;use href=&quot;#home&quot; \/&gt;&lt;\/svg&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;\n          &lt;svg viewbox=&quot;0 0 24 24&quot;&gt;&lt;use href=&quot;#heart&quot; \/&gt;&lt;\/svg&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;\n          &lt;svg viewbox=&quot;0 0 24 24&quot;&gt;&lt;use href=&quot;#bag&quot; \/&gt;&lt;\/svg&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;\n          &lt;svg viewbox=&quot;0 0 24 24&quot;&gt;&lt;use href=&quot;#settings&quot; \/&gt;&lt;\/svg&gt;&lt;\/a&gt;&lt;\/li&gt;\n      &lt;\/ul&gt;\n    &lt;\/nav&gt;\n    \n  &lt;\/main&gt;\n  \n  &lt;svg viewbox=&quot;0 0 24 24&quot;&gt;\n    \n    &lt;!-- filter to make gooey effect --&gt;\n    &lt;filter id=&quot;schlurp&quot;&gt;\n      &lt;fegaussianblur id=&quot;SourceGraphic&quot; stddeviation=&quot;10&quot; \/&gt;\n      &lt;fecolormatrix values=&quot;         1 0 0 0 0         0 1 0 0 0         0 0 1 0 0          0 0 0 20 -10      &quot; \/&gt;\n    &lt;\/filter&gt;\n    \n    &lt;defs&gt;\n      &lt;g id=&quot;home&quot;&gt;\n        &lt;path d=&quot;M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z&quot; \/&gt;\n        &lt;polyline points=&quot;9 22 9 12 15 12 15 22&quot; \/&gt;\n      &lt;\/g&gt;\n      &lt;g id=&quot;heart&quot;&gt;\n        &lt;path d=&quot;M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z&quot; \/&gt;\n      &lt;\/g&gt;\n      &lt;g id=&quot;bag&quot;&gt;\n        &lt;path d=&quot;M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z&quot; \/&gt;\n        &lt;line x1=&quot;3&quot; y1=&quot;6&quot; x2=&quot;21&quot; y2=&quot;6&quot; \/&gt;\n        &lt;path d=&quot;M16 10a4 4 0 0 1-8 0&quot; \/&gt;\n      &lt;\/g&gt;\n      &lt;g id=&quot;settings&quot;&gt;\n        &lt;line x1=&quot;4&quot; y1=&quot;21&quot; x2=&quot;4&quot; y2=&quot;14&quot; \/&gt;\n        &lt;line x1=&quot;4&quot; y1=&quot;10&quot; x2=&quot;4&quot; y2=&quot;3&quot; \/&gt;\n        &lt;line x1=&quot;12&quot; y1=&quot;21&quot; x2=&quot;12&quot; y2=&quot;12&quot; \/&gt;\n        &lt;line x1=&quot;12&quot; y1=&quot;8&quot; x2=&quot;12&quot; y2=&quot;3&quot; \/&gt;\n        &lt;line x1=&quot;20&quot; y1=&quot;21&quot; x2=&quot;20&quot; y2=&quot;16&quot; \/&gt;\n        &lt;line x1=&quot;20&quot; y1=&quot;12&quot; x2=&quot;20&quot; y2=&quot;3&quot; \/&gt;\n        &lt;line x1=&quot;1&quot; y1=&quot;14&quot; x2=&quot;7&quot; y2=&quot;14&quot; \/&gt;\n        &lt;line x1=&quot;9&quot; y1=&quot;8&quot; x2=&quot;15&quot; y2=&quot;8&quot; \/&gt;\n        &lt;line x1=&quot;17&quot; y1=&quot;16&quot; x2=&quot;23&quot; y2=&quot;16&quot; \/&gt;\n      &lt;\/g&gt;\n    &lt;\/defs&gt;\n    \n  &lt;\/svg&gt;\n\n  &lt;script src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/3.6.0\/jquery.min.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;}\">:root {\n  --default: #00ffc3;\n  --hover: #efceff;\n  --size: 80px;\n  --distance: calc(var(--size)*-1.1);\n}\n\n.goo,\n.goo ul {\n  background: inherit;\n  filter: url(&quot;#schlurp&quot;);\n}\n\nul {\n  display: flex;\n  justify-content: center;\n  background: inherit;\n  padding: 0 calc(var(--size) \/ 2);\n}\nul li {\n  width: var(--size);\n  height: var(--size);\n  background: var(--default);\n  margin: 0 3px;\n  color: black;\n  position: relative;\n}\n\n.goo ul li:before {\n  content: &quot;&quot;;\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  border-radius: 100%;\n  background: inherit;\n  transition: all 0.85s ease;\n  transform: translate3d(0, 0, 0);\n  will-change: transform;\n  -webkit-backface-visibility: hidden;\n          backface-visibility: hidden;\n}\n.goo ul li.hover:before {\n  transition: all 0.5s cubic-bezier(0.09, 1.98, 0.41, 0.71);\n  transform: translate3d(0, var(--distance), 0);\n  background: var(--hover);\n}\n\n.menu {\n  position: absolute;\n  z-index: 1;\n  background: transparent;\n  text-align: center;\n}\n\n.menu li {\n  background: transparent;\n  display: flex;\n  align-items: flex-start;\n  justify-content: center;\n  transition: all 0.85s ease;\n  height: calc(var(--size) * 2);\n}\n.menu li:hover {\n  transition: all 0.5s cubic-bezier(0.09, 1.98, 0.41, 0.71);\n  transform: translateY(-53%);\n  color: white;\n}\n.menu li a {\n  display: grid;\n  grid-template-rows: 1fr 1fr;\n  align-items: center;\n  justify-content: center;\n  cursor: pointer;\n  color: rgba(0, 0, 0, 0.6);\n  transition: color 0.5s ease;\n  width: 100%;\n  height: 100%;\n}\n.menu li:hover a {\n  color: rgba(0, 0, 0, 0.9);\n}\n\nnav {\n  display: flex;\n  justify-content: center;\n  margin: 50px;\n  background: var(--default);\n  border-radius: 120px;\n  position: fixed;\n  bottom: 20px;\n  left: 20px;\n  right: 20px;\n}\n\n\/* unimportant styles *\/\nbody {\n  color: white;\n  background: #333844;\n  padding: 20px;\n  font-family: &quot;Heebo&quot;, sans-serif;\n  display: flex;\n  justify-content: center;\n  text-align: center;\n}\n\np {\n  max-width: 70ch;\n  font-weight: 200;\n}\n\nul {\n  list-style: none;\n  margin: 0;\n}\n\nsvg {\n  width: calc(var(--size)\/3);\n  height: calc(var(--size)\/3);\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 2;\n  stroke-linecap: round;\n  stroke-linejoin: round;\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;}\">$(&quot;.menu li&quot;).on(&quot;mouseover touchstart&quot;, function() {\n  let idx = $(this).index();\n  $(&quot;.goo li&quot;).removeClass(&quot;hover&quot;);\n  $(&quot;nav li&quot;).eq(idx).addClass(&quot;hover&quot;);\n}).on(&quot;mouseout touchend&quot;, function() {\n  $(&quot;nav li&quot;).removeClass(&quot;hover&quot;);\n});<\/pre><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1556,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[17],"class_list":["post-1555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-headermenu","tag-jquery"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1555","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=1555"}],"version-history":[{"count":1,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1555\/revisions"}],"predecessor-version":[{"id":1557,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1555\/revisions\/1557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/1556"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=1555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=1555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=1555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}