{"id":1522,"date":"2023-06-03T10:38:00","date_gmt":"2023-06-03T07:38:00","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=1522"},"modified":"2023-06-02T16:44:26","modified_gmt":"2023-06-02T13:44:26","slug":"tab-bar-interaction","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/buttons\/1522\/","title":{"rendered":"Tab Bar Interaction"},"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=\"627\" height=\"347\" src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/06\/peek-2023-06-02-15-38.gif\" alt=\"Tab Bar Interaction\" class=\"wp-image-1523 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;svg display=&quot;none&quot;&gt;\n  &lt;symbol id=&quot;icon-home&quot; viewbox=&quot;0 0 64 64&quot;&gt;\n     &lt;polygon points=&quot;6.1,58 6,18 32,6 58,18 58,58 &quot;\/&gt;\n  &lt;\/symbol&gt;\n  &lt;symbol id=&quot;icon-favourites&quot; viewbox=&quot;0 0 64 64&quot;&gt;\n     &lt;path d=&quot;M32 12.5c-6-6-15.7-6-21.7 0s-6 15.7 0 21.7L32 56l21.7-21.7c6-6 6-15.7 0-21.7C47.7 6.5 38 6.5 32 12.5z&quot;\/&gt;\n  &lt;\/symbol&gt;\n  &lt;symbol id=&quot;icon-settings&quot; viewbox=&quot;0 0 64 64&quot;&gt;\n     &lt;circle class=&quot;st0&quot; cx=&quot;17&quot; cy=&quot;20&quot; r=&quot;9&quot;\/&gt;\n     &lt;line class=&quot;st0&quot; x1=&quot;26&quot; y1=&quot;20&quot; x2=&quot;56&quot; y2=&quot;20&quot;\/&gt;\n     &lt;circle class=&quot;st0&quot; cx=&quot;47&quot; cy=&quot;44&quot; r=&quot;9&quot;\/&gt;\n     &lt;line class=&quot;st0&quot; x1=&quot;38&quot; y1=&quot;44&quot; x2=&quot;8&quot; y2=&quot;44&quot;\/&gt;\n  &lt;\/symbol&gt;\n&lt;\/svg&gt;\n\n&lt;div id=&quot;tab-bar&quot;&gt;\n  &lt;div class=&quot;tab active&quot;&gt;\n     &lt;div&gt;\n        &lt;svg viewbox=&quot;0 0 64 64&quot;&gt;\n           &lt;use xlink:href=&quot;#icon-home&quot;&gt;&lt;\/use&gt;\n        &lt;\/svg&gt;\n     &lt;\/div&gt;\n     &lt;div&gt;\n        &lt;svg viewbox=&quot;0 0 64 64&quot;&gt;\n           &lt;use xlink:href=&quot;#icon-home&quot;&gt;&lt;\/use&gt;\n        &lt;\/svg&gt;\n     &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;tab&quot;&gt;\n     &lt;div&gt;\n        &lt;svg viewbox=&quot;0 0 64 64&quot;&gt;\n           &lt;use xlink:href=&quot;#icon-favourites&quot;&gt;&lt;\/use&gt;\n        &lt;\/svg&gt;\n     &lt;\/div&gt;\n     &lt;div&gt;\n        &lt;svg viewbox=&quot;0 0 64 64&quot;&gt;\n           &lt;use xlink:href=&quot;#icon-favourites&quot;&gt;&lt;\/use&gt;\n        &lt;\/svg&gt;\n     &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;tab&quot;&gt;\n     &lt;div&gt;\n        &lt;svg viewbox=&quot;0 0 64 64&quot;&gt;\n           &lt;use xlink:href=&quot;#icon-settings&quot;&gt;&lt;\/use&gt;\n        &lt;\/svg&gt;\n     &lt;\/div&gt;\n     &lt;div&gt;\n        &lt;svg viewbox=&quot;0 0 64 64&quot;&gt;\n           &lt;use xlink:href=&quot;#icon-settings&quot;&gt;&lt;\/use&gt;\n        &lt;\/svg&gt;\n     &lt;\/div&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;}\">svg &gt; symbol * {\n  fill: none;\n  stroke: inherit;\n  stroke-width: 10;\n  stroke-miterlimit: 10;\n}\n\nbody {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  height: 100vh;\n  background-color: #F5F5F5;\n}\nbody #tab-bar {\n  display: flex;\n  transform: scale(1);\n  width: 440px;\n  height: 120px;\n  transition: transform 0.25s cubic-bezier(0.05, 0.61, 0.41, 0.95);\n}\nbody #tab-bar .tab {\n  flex-grow: 1;\n  position: relative;\n  overflow: hidden;\n  cursor: pointer;\n}\nbody #tab-bar .tab.active div:first-child {\n  background-color: #FFFFFF;\n  stroke: #333333;\n  fill: #333333;\n}\nbody #tab-bar .tab.active div:last-child {\n  background-color: #333333;\n  stroke: #FFFFFF;\n  fill: #FFFFFF;\n}\nbody #tab-bar .tab:not(.active) div:first-child {\n  background-color: #333333;\n  stroke: #FFFFFF;\n  fill: #FFFFFF;\n}\nbody #tab-bar .tab:not(.active) div:last-child {\n  background-color: #FFFFFF;\n  stroke: #333333;\n  fill: #333333;\n}\nbody #tab-bar .tab &gt; div {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  position: relative;\n  top: -120px;\n  height: 100%;\n}\nbody #tab-bar .tab &gt; div svg {\n  width: 32px;\n  height: 32px;\n}\nbody #tab-bar:active {\n  transform: scale(0.95);\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;}\">var phase = 0;\n$(&quot;#tab-bar .tab&quot;).mousedown(function(){\n   if(!$(this).is(&quot;.active&quot;) &amp;&amp; phase == 0) {\n      phase = 1;\n      $(&quot;.tab.active div&quot;).animate({top:0}, 250, function(){\n         $(&quot;.tab div&quot;).removeAttr(&quot;style&quot;);\n         $(&quot;.tab.active&quot;).removeClass(&quot;active&quot;);\n      });\n   }\n}).mouseup(function(){\n   $this = $(this);\n   if(!$(this).is(&quot;.active&quot;) &amp;&amp; phase == 1) {\n      phase = 2;\n      $(this).find(&quot;div&quot;).animate({top:0}, 250, function(){\n         $this.find(&quot;div&quot;).removeAttr(&quot;style&quot;);\n         $this.addClass(&quot;active&quot;);\n         phase=0;\n      });\n   }\n});\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1523,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[71],"class_list":["post-1522","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-buttons","tag-tab-bar"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1522","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=1522"}],"version-history":[{"count":1,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1522\/revisions"}],"predecessor-version":[{"id":1524,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1522\/revisions\/1524"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/1523"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=1522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=1522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=1522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}