{"id":448,"date":"2023-03-08T15:57:26","date_gmt":"2023-03-08T12:57:26","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=448"},"modified":"2023-03-29T00:08:09","modified_gmt":"2023-03-28T21:08:09","slug":"bokovoj-sidebar","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/elements\/448\/","title":{"rendered":"Sidebar"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video height=\"662\" style=\"aspect-ratio: 600 \/ 662;\" width=\"600\" controls src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/03\/vokoscreenng-2023-03-08_13-52-58.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;demo&quot;&gt;\n  &lt;svg class=&quot;sidebar&quot; viewBox=&quot;0 0 300 500&quot;&gt;\n    &lt;path class=&quot;s-path&quot; fill=&quot;#fff&quot; d=&quot;M0,0 50,0 a0,250 0 1,1 0,500 L0,500&quot; \/&gt;\n  &lt;\/svg&gt;\n  &lt;div class=&quot;static&quot;&gt;\n    &lt;div class=&quot;static__text&quot;&gt;Pull white sidebar to the right&lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;sidebar-content&quot;&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-man.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Ethan Hawke&lt;\/span&gt;\n      &lt;span class=&quot;contact__status online&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-girl.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Natalie Portman&lt;\/span&gt;\n      &lt;span class=&quot;contact__status online&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-man.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Kevin Spacey&lt;\/span&gt;\n      &lt;span class=&quot;contact__status online&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-girl.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Rosamund Pike&lt;\/span&gt;\n      &lt;span class=&quot;contact__status online&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-man.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Robert Redford&lt;\/span&gt;\n      &lt;span class=&quot;contact__status online&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-girl.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Scarlett Johansson&lt;\/span&gt;\n      &lt;span class=&quot;contact__status online&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-man.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Tom Cruise&lt;\/span&gt;\n      &lt;span class=&quot;contact__status&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-girl.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Eva Green&lt;\/span&gt;\n      &lt;span class=&quot;contact__status&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;contact&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-man.png&quot; alt=&quot;&quot; class=&quot;contact__photo&quot; \/&gt;\n      &lt;span class=&quot;contact__name&quot;&gt;Paul Newman&lt;\/span&gt;\n      &lt;span class=&quot;contact__status&quot;&gt;&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;search&quot;&gt;\n      &lt;img src=&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-srch.png&quot; alt=&quot;&quot; class=&quot;search__img&quot; \/&gt;\n      &lt;input type=&quot;text&quot; class=&quot;search__input&quot; placeholder=&quot;Search&quot; \/&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;chat&quot;&gt;\n    &lt;span class=&quot;chat__back&quot;&gt;&lt;\/span&gt;\n    &lt;span class=&quot;chat__status&quot;&gt;status&lt;\/span&gt;\n    &lt;div class=&quot;chat__person&quot;&gt;\n      &lt;span class=&quot;chat__online active&quot;&gt;&lt;\/span&gt;\n      &lt;span class=&quot;chat__name&quot;&gt;Huehue Huehue&lt;\/span&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;chat__messages&quot;&gt;\n      &lt;div class=&quot;chat__msgRow&quot;&gt;\n        &lt;div class=&quot;chat__message mine&quot;&gt;Such SVG, much Javascript, very CSS!&lt;\/div&gt;\n      &lt;\/div&gt;\n      &lt;div class=&quot;chat__msgRow&quot;&gt;\n        &lt;div class=&quot;chat__message notMine&quot;&gt;Wow!&lt;\/div&gt;\n      &lt;\/div&gt;\n      &lt;div class=&quot;chat__msgRow&quot;&gt;\n        &lt;div class=&quot;chat__message notMine&quot;&gt;Very elastic! Such easings!&lt;\/div&gt;\n      &lt;\/div&gt;\n      &lt;div class=&quot;chat__msgRow&quot;&gt;\n        &lt;div class=&quot;chat__message mine&quot;&gt;\n          Check out my other &lt;a href=&quot;https:\/\/codepen.io\/suez\/public\/&quot; target=&quot;_blank&quot;&gt;pens&lt;\/a&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;input type=&quot;text&quot; class=&quot;chat__input&quot; placeholder=&quot;Your message&quot; \/&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n\n&lt;script src=&quot;\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/2.1.3\/jquery.min.js&quot;&gt;&lt;\/script&gt;\n\/\/\u0421\u043a\u0440\u0438\u043f\u0442 js \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c\n\/\/\u0410\u0432\u0442\u043e\u0440: Nikolay Talanov. @suez<\/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;}\">*, *:before, *:after {\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0;\n}\n\nhtml, body {\n  font-size: 62.5%;\n  height: 100%;\n}\n\nbutton, input {\n  border: 0;\n  outline: none;\n}\n\nbody {\n  background: linear-gradient(45deg, #636f85, #6960a0);\n}\n\n.demo {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  margin-top: -25rem;\n  margin-left: -15rem;\n  width: 30rem;\n  height: 50rem;\n  box-shadow: 0 1rem 5rem rgba(0, 0, 0, 0.3);\n}\n\n.static {\n  height: 100%;\n  font-size: 1.8rem;\n  font-family: &quot;Open Sans&quot;, Helvetica, Arial, sans-serif;\n  background: #6D7ADA;\n}\n.static:before, .static:after {\n  content: &quot;&quot;;\n  position: absolute;\n  left: 7rem;\n  width: 2rem;\n  height: 2rem;\n  margin-left: -1rem;\n  margin-top: -1rem;\n  border: 2px solid #fff;\n  border-left: none;\n  border-bottom: none;\n  transform: rotate(45deg);\n  -webkit-animation: arrows 1.5s infinite;\n          animation: arrows 1.5s infinite;\n}\n.static:before {\n  top: 15rem;\n}\n.static:after {\n  top: 35rem;\n}\n.static__text {\n  width: 9rem;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  margin-left: -5rem;\n  transform: translate3d(0, -50%, 0);\n  color: #fff;\n  perspective: 1px;\n  -webkit-backface-visibility: hidden;\n          backface-visibility: hidden;\n}\n\n.sidebar-content {\n  z-index: -1;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 20rem;\n  height: 100%;\n  padding-top: 1rem;\n  opacity: 0;\n  transition: opacity 200ms, z-index 0s 0s;\n  background-color: #E9EAF3;\n  overflow: hidden;\n}\n.sidebar-content.active {\n  z-index: 2;\n  opacity: 1;\n}\n\n.contact {\n  position: relative;\n  width: 100%;\n  height: 5rem;\n  padding-left: 1.7rem;\n  display: flex;\n  align-items: center;\n  cursor: pointer;\n  overflow: hidden;\n}\n.contact__photo {\n  border-radius: 50%;\n  margin-right: 1.5rem;\n}\n.contact__name {\n  font-size: 1.2rem;\n  font-family: &quot;Open Sans&quot;, Helvetica, Arial, sans-serif;\n}\n.contact__status {\n  position: absolute;\n  top: 2.1rem;\n  right: 1.5rem;\n  width: 8px;\n  height: 8px;\n  border: 2px solid #00B570;\n  border-radius: 50%;\n  opacity: 0;\n  transition: opacity 0.3s;\n}\n.contact__status.online {\n  opacity: 1;\n}\n\n.search {\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 5.5rem;\n  padding-left: 1.5rem;\n  background: #fff;\n  display: flex;\n  align-items: center;\n}\n\nsvg {\n  overflow: visible;\n}\n\n.sidebar {\n  z-index: 1;\n  position: absolute;\n  top: 0;\n  left: 0;\n  display: block;\n  width: 100%;\n  height: 100%;\n}\n\n.s-path {\n  cursor: -webkit-grab;\n  cursor: grab;\n}\n\n.cloned {\n  position: absolute;\n  z-index: 10;\n  transition: top 0.3s, left 0.3s;\n  transition-delay: 0.2s;\n  transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);\n}\n.cloned.removed {\n  transition: opacity 0.2s 0;\n  opacity: 0;\n}\n\n.chat {\n  display: none;\n  z-index: 5;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  padding: 2.5rem 0 5.5rem 2.5rem;\n  transition: opacity 200ms;\n  opacity: 0;\n}\n.chat.active {\n  opacity: 1;\n}\n.chat.active:before {\n  width: 100%;\n}\n.chat:before {\n  content: &quot;&quot;;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 0.5rem;\n  background: #1CC6AE;\n  width: 0;\n  transition: width 0.2s;\n}\n.chat__back {\n  position: relative;\n  display: inline-block;\n  width: 2rem;\n  height: 2rem;\n  margin-top: 0.5rem;\n  margin-left: -0.6rem;\n  cursor: pointer;\n}\n.chat__back:hover:before {\n  transform: translateX(-0.3rem) rotate(-45deg);\n}\n.chat__back:before {\n  content: &quot;&quot;;\n  position: absolute;\n  display: block;\n  top: 0.4rem;\n  left: 0.6rem;\n  width: 1.2rem;\n  height: 1.2rem;\n  border: 2px solid #545675;\n  border-right: none;\n  border-bottom: none;\n  transform: rotate(-45deg);\n  transition: transform 0.3s;\n}\n.chat__status {\n  position: absolute;\n  top: 2rem;\n  right: 6.5rem;\n  font-size: 1.2rem;\n  font-family: &quot;Open Sans&quot;, Helvetica, Arial, sans-serif;\n  text-transform: uppercase;\n  color: #B1A9A9;\n}\n.chat__person {\n  display: inline-block;\n  position: absolute;\n  top: 3rem;\n  right: 6.5rem;\n  font-size: 2rem;\n  font-family: &quot;Open Sans&quot;, Helvetica, Arial, sans-serif;\n  color: #36343D;\n}\n.chat__online {\n  position: absolute;\n  top: 50%;\n  left: -1.5rem;\n  margin-top: -3px;\n  width: 8px;\n  height: 8px;\n  border: 2px solid #00B570;\n  border-radius: 50%;\n  opacity: 0;\n  transition: opacity 0.3s;\n}\n.chat__online.active {\n  opacity: 1;\n}\n.chat__messages {\n  position: absolute;\n  top: 7.5rem;\n  left: 2.5rem;\n  width: 27.5rem;\n  height: 37rem;\n  padding-right: 2.5rem;\n  overflow-y: auto;\n}\n.chat__msgRow {\n  margin-bottom: 0.5rem;\n}\n.chat__msgRow:after {\n  content: &quot;&quot;;\n  display: table;\n  clear: both;\n}\n.chat__message {\n  display: inline-block;\n  max-width: 60%;\n  padding: 1rem;\n  font-size: 1.4rem;\n  font-family: &quot;Open Sans&quot;, Helvetica, Arial, sans-serif;\n}\n.chat__message.mine {\n  color: #2B2342;\n  border: 1px solid #DFDFDF;\n}\n.chat__message.notMine {\n  float: right;\n  color: #23244E;\n  background: #E9EAF3;\n}\n.chat__input {\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 5.5rem;\n  padding: 1rem 1rem 1rem 4rem;\n  background-image: url(&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/elastic-search.png&quot;);\n  background-repeat: no-repeat;\n  background-position: 1rem 1.5rem;\n  background-color: #E9EAF3;\n  color: #2B2342;\n  font-size: 1.4rem;\n  font-family: &quot;Open Sans&quot;, Helvetica, Arial, sans-serif;\n}\n\n.ripple {\n  position: absolute;\n  width: 10rem;\n  height: 10rem;\n  margin-left: -5rem;\n  margin-top: -5rem;\n  background: rgba(0, 0, 0, 0.4);\n  transform: scale(0);\n  -webkit-animation: animRipple 0.3s;\n          animation: animRipple 0.3s;\n  border-radius: 50%;\n}\n\n@-webkit-keyframes animRipple {\n  to {\n    transform: scale(2.5);\n    opacity: 0;\n  }\n}\n\n@keyframes animRipple {\n  to {\n    transform: scale(2.5);\n    opacity: 0;\n  }\n}\n@-webkit-keyframes arrows {\n  to {\n    transform: translateX(100%) rotate(45deg);\n    opacity: 0;\n  }\n}\n@keyframes arrows {\n  to {\n    transform: translateX(100%) rotate(45deg);\n    opacity: 0;\n  }\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;}\">$(document).ready(function() {\n  var $svg = $(&quot;.sidebar&quot;),\n      $demo = $(&quot;.demo&quot;),\n      $path = $(&quot;.s-path&quot;),\n      $sCont = $(&quot;.sidebar-content&quot;),\n      $chat = $(&quot;.chat&quot;),\n      demoTop = $demo.offset().top,\n      demoLeft = $demo.offset().left,\n      diffX = 0,\n      curX = 0,\n      finalX = 0,\n      frame = 1000 \/ 60,\n      animTime = 600,\n      sContTrans = 200,\n      animating = false;\n\n  var easings = {\n    smallElastic: function(t,b,c,d) {\n      var ts = (t\/=d)*t;\n      var tc = ts*t;\n      return b+c*(33*tc*ts + -106*ts*ts + 126*tc + -67*ts + 15*t);\n    },\n    inCubic: function(t,b,c,d) {\n      var tc = (t\/=d)*t*t;\n      return b+c*(tc);\n    }\n  };\n\n  function createD(top, ax, dir) {\n    return &quot;M0,0 &quot;+top+&quot;,0 a&quot;+ax+&quot;,250 0 1,&quot;+dir+&quot; 0,500 L0,500&quot;;\n  }\n\n  var startD = createD(50,0,1),\n      midD = createD(125,75,0),\n      finalD = createD(200,0,1),\n      clickMidD = createD(300,80,0),\n      clickMidDRev = createD(200,100,1),\n      clickD = createD(300,0,1),\n      currentPath = startD;\n\n  function newD(num1, num2) {\n    var d = $path.attr(&quot;d&quot;),\n        num2 = num2 || 250,\n        nd = d.replace(\/\\ba(\\d+),(\\d+)\\b\/gi, &quot;a&quot; + num1 + &quot;,&quot; + num2);\n    return nd;\n  }\n\n  function animatePathD(path, d, time, handlers, callback, easingTop, easingX) {\n    var steps = Math.floor(time \/ frame),\n        curStep = 0,\n        oldArr = currentPath.split(&quot; &quot;),\n        newArr = d.split(&quot; &quot;),\n        oldLen = oldArr.length,\n        newLen = newArr.length,\n        oldTop = +oldArr[1].split(&quot;,&quot;)[0],\n        topDiff = +newArr[1].split(&quot;,&quot;)[0] - oldTop,\n        nextTop,\n        nextX,\n        easingTop = easings[easingTop] || easings.smallElastic,\n        easingX = easings[easingX] || easingTop;\n\n    $(document).off(&quot;mousedown mouseup&quot;);\n\n    function animate() {\n      curStep++;\n      nextTop = easingTop(curStep, oldTop, topDiff, steps);\n      nextX = easingX(curStep, curX, finalX-curX, steps);\n      oldArr[1] = nextTop + &quot;,0&quot;;\n      oldArr[2] = &quot;a&quot; + Math.abs(nextX) + &quot;,250&quot;;\n      oldArr[4] = (nextX &gt;= 0) ? &quot;1,1&quot; : &quot;1,0&quot;;\n      $path.attr(&quot;d&quot;, oldArr.join(&quot; &quot;));\n      if (curStep &gt; steps) {\n        curX = 0;\n        diffX = 0;\n        $path.attr(&quot;d&quot;, d);\n        currentPath = d;\n        if (handlers) handlers1();\n        if (callback) callback();\n        return;\n      }\n      requestAnimationFrame(animate);\n    }\n    animate();\n  }\n\n  function handlers1() {\n\n    $(document).on(&quot;mousedown touchstart&quot;, &quot;.s-path&quot;, function(e) {\n      var startX =  e.pageX || e.originalEvent.touches[0].pageX;\n\n      $(document).on(&quot;mousemove touchmove&quot;, function(e) {\n        var x = e.pageX || e.originalEvent.touches[0].pageX;\n        diffX = x - startX;\n        if (diffX &lt; 0) diffX = 0;\n        if (diffX &gt; 300) diffX = 300;\n        curX = Math.floor(diffX\/2);\n        $path.attr(&quot;d&quot;, newD(curX));\n      });\n    });\n\n    $(document).on(&quot;mouseup touchend&quot;, function() {\n      $(document).off(&quot;mousemove touchmove&quot;);\n      if (animating) return;\n      if (!diffX) return;\n      if (diffX &lt; 40) {\n        animatePathD($path, newD(0), animTime, true);\n      } else {\n        animatePathD($path, finalD, animTime, false, function() {\n          $sCont.addClass(&quot;active&quot;);\n          setTimeout(function() {\n            $(document).on(&quot;click&quot;, closeSidebar);\n          }, sContTrans);\n        });\n      }\n    });\n\n  }\n\n  handlers1();\n\n  function closeSidebar(e) {\n    if ($(e.target).closest(&quot;.sidebar-content&quot;).length ||\n        $(e.target).closest(&quot;.chat&quot;).length) return;\n    if (animating) return;\n    animating = true;\n    $sCont.removeClass(&quot;active&quot;);\n    $chat.removeClass(&quot;active&quot;);\n    $(&quot;.cloned&quot;).addClass(&quot;removed&quot;);\n    finalX = -75;\n    setTimeout(function() {\n      animatePathD($path, midD, animTime\/3, false, function() {\n        $chat.hide();\n        $(&quot;.cloned&quot;).remove();\n        finalX = 0;\n        curX = -75;\n        animatePathD($path, startD, animTime\/3*2, true);\n        animating = false;\n      }, &quot;inCubic&quot;);\n    }, sContTrans);\n    $(document).off(&quot;click&quot;, closeSidebar);\n  }\n\n  function moveImage(that) {\n    var $img = $(that).find(&quot;.contact__photo&quot;),\n        top = $img.offset().top - demoTop,\n        left = $img.offset().left - demoLeft,\n        $clone = $img.clone().addClass(&quot;cloned&quot;);\n\n    $clone.css({top: top, left: left});\n    $demo.append($clone);\n    $clone.css(&quot;top&quot;);\n    $clone.css({top: &quot;1.8rem&quot;, left: &quot;25rem&quot;});\n  }\n\n  function ripple(elem, e) {\n    var elTop = elem.offset().top,\n        elLeft = elem.offset().left,\n        x = e.pageX - elLeft,\n        y = e.pageY - elTop;\n    var $ripple = $(&quot;&lt;div class='ripple'&gt;&lt;\/div&gt;&quot;);\n    $ripple.css({top: y, left: x});\n    elem.append($ripple);\n  }\n\n  $(document).on(&quot;click&quot;, &quot;.contact&quot;, function(e) {\n    if (animating) return;\n    animating = true;\n    $(document).off(&quot;click&quot;, closeSidebar);\n    var that = this,\n        name = $(this).find(&quot;.contact__name&quot;).text(),\n        online = $(this).find(&quot;.contact__status&quot;).hasClass(&quot;online&quot;);\n    $(&quot;.chat__name&quot;).text(name);\n    $(&quot;.chat__online&quot;).removeClass(&quot;active&quot;);\n    if (online) $(&quot;.chat__online&quot;).addClass(&quot;active&quot;);\n    ripple($(that),e);\n    setTimeout(function() {\n      $sCont.removeClass(&quot;active&quot;);\n      moveImage(that);\n      finalX = -80;\n      setTimeout(function() {\n        $(&quot;.ripple&quot;).remove();\n        animatePathD($path, clickMidD, animTime\/3, false, function() {\n          curX = -80;\n          finalX = 0;\n          animatePathD($path, clickD, animTime*2\/3, true, function() {\n            $chat.show();\n            $chat.css(&quot;top&quot;);\n            $chat.addClass(&quot;active&quot;);\n            animating = false;\n          });\n        }, &quot;inCubic&quot;);\n      }, sContTrans);\n    }, sContTrans);\n  });\n\n  $(document).on(&quot;click&quot;, &quot;.chat__back&quot;, function() {\n    if (animating) return;\n    animating = true;\n    $chat.removeClass(&quot;active&quot;);\n    $(&quot;.cloned&quot;).addClass(&quot;removed&quot;);\n    setTimeout(function() {\n      $(&quot;.cloned&quot;).remove();\n      $chat.hide();\n      finalX = 100;\n      animatePathD($path, clickMidDRev, animTime\/3, false, function() {\n        curX = 100;\n        finalX = 0;\n        animatePathD($path, finalD, animTime*2\/3, true, function() {\n          $sCont.addClass(&quot;active&quot;);\n          $(document).on(&quot;click&quot;, closeSidebar);\n          animating = false;\n        });\n      }, &quot;inCubic&quot;);\n    }, sContTrans);\n  });\n\n  $(window).on(&quot;resize&quot;, function() {\n    demoTop = $demo.offset().top;\n    demoLeft = $demo.offset().left;\n  });\n\n});<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":450,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[17,34],"class_list":["post-448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-elements","tag-jquery","tag-sidebar"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/448","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=448"}],"version-history":[{"count":0,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/450"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}