{"id":302959,"date":"2020-05-03T21:00:19","date_gmt":"2020-05-03T21:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302959"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302959","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c front-end, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0418\u043b\u0438 \u043a\u0430\u043a \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u0442\u0430\u0442\u044c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u043c. \u0427\u0430\u0441\u0442\u044c 2"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500254\/\">\u0418\u0442\u0430\u043a, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439. \u042f \u0432\u044b\u0431\u0438\u0440\u0430\u044e \u0432\u0435\u0431-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0430\u043f\u0438, \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c.<\/p>\n<h3>\u0428\u0430\u0433 1 \u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>  \u0422\u0435\u0433 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f custom-viewport. \u0418\u0442\u0430\u043a, \u0441\u043f\u0435\u0440\u0432\u0430 \u043e\u043f\u0438\u0448\u0435\u043c \u043e\u0431\u0449\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430:  <\/p>\n<pre><code class=\"css\">custom-viewport { min-height: 50vh; max-height: 100vh; width: 100%; position: absolute; bottom: 0; overflow: hidden; transform-origin: 50% 100% 0; } <\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0438\u0446\u0438\u044f inited:  <\/p>\n<pre><code class=\"css\">custom-viewport[data-mode = &quot;inited&quot;] { transform: translateY(calc(100% - 50vh)); transition: transform 1s; }<\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0438\u0446\u0438\u044f opened:  <\/p>\n<pre><code class=\"css\">custom-viewport[data-mode = &quot;opened&quot;] { transform: translateY(0); transition: transform 1s; overflow-y: scroll; }<\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0438\u0446\u0438\u044f deleted:  <\/p>\n<pre><code class=\"css\">custom-viewport[data-mode = &quot;deleted&quot;] { transform: translateY(100%); transition: transform 1s; }<\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0428\u0430\u0433 2 \u2014 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 custom-viewport<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">class CustomViewport extends HTMLElement {  constructor() {   super();  } } <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f dragUp\/dragDown  <\/p>\n<pre><code class=\"javascript\">class CustomViewport extends HTMLElement {  constructor() {   super();  }  connectedCallback() {   this.addEventListener(&quot;touchstart&quot;, ev =&gt; {    this.firstTouch = ev.touches[0];   });   this.addEventListener(&quot;touchmove&quot;, ev =&gt; {    this.deltaY = ev.touches[0].clientY - this.firstTouch.clientY;    return this.deltaY &gt; 0 ? this.dragDown(ev) : this.dragUp(ev);   });  }  dragUp(ev) {}  dragDown(ev) {} } <\/code><\/pre>\n<p>  \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043a\u043e\u0434 \u0432\u044b\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ya\/tp\/4m\/yatp4mzqxfwzyepfp98rkaigmpc.jpeg\"><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f dragUp\/dragDown. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u2014 \u0440\u0430\u0441\u0447\u0435\u0442 \u0437\u0430\u043f\u0430\u0441\u0430 \u0445\u043e\u0434\u0430.  <\/p>\n<pre><code class=\"javascript\">class CustomViewport extends HTMLElement {  constructor() {   super();   this.VIEWPORT_HEIGHT = window.innerHeight; \/\/ +  }  connectedCallback() {   this.addEventListener(&quot;touchstart&quot;, ev =&gt; {    this.firstTouch = ev.touches[0];    const rect = this.getBoundingClientRect(); \/\/ +    const { height, top } = rect; \/\/ +    this.bottomOffsetBeforeDragging = (height + top) - this.VIEWPORT_HEIGHT; \/\/ +   });   this.addEventListener(&quot;touchmove&quot;, ev =&gt; {    this.deltaY = ev.touches[0].clientY - this.firstTouch.clientY;    return this.deltaY &gt; 0 ? this.dragDown() : this.dragUp();   });  }  dragUp() {}  dragDown() {}  isBottomOffset() { \/\/ +    return (this.bottomOffsetBeforeDragging + this.deltaY) &gt; 0; \/\/ +  } \/\/ + } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0430\u0441\u0430 \u0445\u043e\u0434\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u044d\u0442\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e deltaY \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c: \u043c\u043e\u0436\u0435\u043c \u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0432\u0432\u0435\u0440\u0445 \u0438\u043b\u0438 \u043d\u0435\u0442.<br \/>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 dragUp:  <\/p>\n<pre><code class=\"javascript\">... dragUp() {  if(this.isBottomOffset()) {   \/\/ \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0432\u0435\u0440\u0445   return;  }  this.style.transform = 'translateY(0)'; } ... <\/code><\/pre>\n<p>  \u041f\u0438\u0448\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u0432\u044c\u044e\u043f\u043e\u0440\u0442:  <\/p>\n<pre><code class=\"javascript\">class CustomViewport extends HTMLElement {  constructor() {   super();   this.VIEWPORT_HEIGHT = window.innerHeight;  }  connectedCallback() {   this.addEventListener(&quot;touchstart&quot;, ev =&gt; {    this.firstTouch = ev.touches[0];    const rect = this.getBoundingClientRect();    const { height, top } = rect;    this.bottomOffsetBeforeDragging = (height + top) - this.VIEWPORT_HEIGHT;    this.lastPosY = this.bottomOffsetBeforeDragging - this.scrollTop; \/\/ +   });    ...  } translateY() { \/\/ +   const pixels = this.deltaY + this.lastPosY; \/\/ +   this.style.transform = `translateY(${pixels}px)`; \/\/ +   this.style.transition = 'none'; \/\/ +  } \/\/ + ... } <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 this.lastPosY \u0438 \u043a\u0430\u043a \u043e\u043d \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0432 css \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 transform: translateY(calc(100% \u2014 50vh)); \u0433\u0434\u0435 100% \u2014 \u044d\u0442\u043e \u0432\u044b\u0441\u043e\u0442\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430, \u0430 50vh \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0432\u044b\u0441\u043e\u0442\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430, \u0438 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0445\u043e\u0440\u043e\u0448\u043e, \u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c.<br \/>  \u0418\u0442\u0430\u043a this.lastPosY \u2014 \u044d\u0442\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430 \u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u0445 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u043d\u0435\u043c\u0443 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c this.deltaY \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430.<br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430:  <\/p>\n<pre><code class=\"css\">bottom: 0; transform-origin: 50% 100% 0; <\/code><\/pre>\n<p>  \u0442\u043e \u043d\u0430\u0448\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kz\/wx\/kh\/kzwxkhv9m76qmrgmtbvjgglf3fu.jpeg\"><\/p>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c dragDown:  <\/p>\n<pre><code class=\"javascript\">... dragDown() {  if(this.lastPosY &lt; 0) {   return;  }  this.translateY(); } ... <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 dragEnd:  <\/p>\n<pre><code class=\"javascript\">class CustomViewport extends HTMLElement {  constructor() {   super();   this.VIEWPORT_HEIGHT = window.innerHeight;  }  connectedCallback() {   this.addEventListener(&quot;touchend&quot;, ev =&gt; { \/\/ +    const { mode: currentMode } = this.dataset; \/\/ +    this.style = null; \/\/ +    if (Math.abs(deltaY) &lt; 10) { \/\/ +     this.dataset.mode = currentMode; \/\/ +     return; \/\/ +    } \/\/ +     if (deltaY &gt; 0) { \/\/ +      if (currentMode === &quot;inited&quot;) { \/\/ +        this.dataset.mode = &quot;deleted&quot;; \/\/ +        return; \/\/ +       } \/\/ +       this.dataset.mode = &quot;inited&quot;; \/\/ +       return; \/\/ +     } \/\/ +     this.dataset.mode = &quot;opened&quot;; \/\/ +   }); \/\/ +    ... <\/code><\/pre>\n<p>  \u0412 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 if (Math.abs(deltaY) &lt; 10) \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u043d\u0443\u043b\u0438\u0441\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u043d\u0430 10 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u2014 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">class CustomViewport extends HTMLElement {  constructor() {   super();   this.VIEWPORT_HEIGHT = window.innerHeight;  }  connectedCallback() {   this.addEventListener(&quot;touchstart&quot;, ev =&gt; {    this.firstTouch = ev.touches[0];    const rect = this.getBoundingClientRect();    const { height, top } = rect;    this.bottomOffsetBeforeDragging = (height + top) - this.VIEWPORT_HEIGHT;    this.lastPosY = this.bottomOffsetBeforeDragging - this.scrollTop;   });   this.addEventListener(&quot;touchmove&quot;, ev =&gt; {    this.deltaY = ev.touches[0].clientY - this.firstTouch.clientY;    return this.deltaY &gt; 0 ? this.dragDown() : this.dragUp();   });   this.addEventListener(&quot;touchend&quot;, ev =&gt; {    const { mode: currentMode } = this.dataset;    this.style = null;    if (Math.abs(this.deltaY) &lt; 10) {     this.dataset.mode = currentMode;     return;    }     if (this.deltaY &gt; 0) {      if (currentMode === &quot;inited&quot;) {        this.dataset.mode = &quot;deleted&quot;;        return;       }       this.dataset.mode = &quot;inited&quot;;       return;     }     this.dataset.mode = &quot;opened&quot;;   });  }  dragUp() {   if(this.isBottomOffset()) {    this.translateY();    return;   }   this.style.transform = 'translateY(0)'; }  dragDown() {    if(this.lastPosY &lt; 0) {    return;   }   this.translateY(); } translateY() {   const pixels = this.deltaY + this.lastPosY;   this.style.transform = `translateY(${pixels}px)`;   this.style.transition = 'none';  }  isBottomOffset() {    return (this.bottomOffsetBeforeDragging + this.deltaY) &gt; 0;  } }  customElements.define('custom-viewport', CustomViewport); <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0430 \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u043c. \u0411\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043a\u0440\u043e\u043b\u0430, \u0434\u0435\u0431\u043e\u0443\u043d\u0441\u044b, \u0435\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, touchcancel \u2014 \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043e\u0442\u043a\u0443\u043f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/500254\/\"> https:\/\/habr.com\/ru\/post\/500254\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500254\/\">\u0418\u0442\u0430\u043a, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439. \u042f \u0432\u044b\u0431\u0438\u0440\u0430\u044e \u0432\u0435\u0431-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0430\u043f\u0438, \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c.<\/p>\n<h3>\u0428\u0430\u0433 1 \u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>  \u0422\u0435\u0433 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f custom-viewport. \u0418\u0442\u0430\u043a, \u0441\u043f\u0435\u0440\u0432\u0430 \u043e\u043f\u0438\u0448\u0435\u043c \u043e\u0431\u0449\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0432\u044c\u044e\u043f\u043e\u0440\u0442\u0430:  <\/p>\n<pre><code class=\"css\">custom-viewport { min-height: 50vh; max-height: 100vh; width: 100%; position: absolute; bottom: 0; overflow: hidden; transform-origin: 50% 100% 0; } <\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0438\u0446\u0438\u044f inited:  <\/p>\n<pre><code class=\"css\">custom-viewport[data-mode = &quot;inited&quot;] { transform: translateY(calc(100% - 50vh)); transition: transform 1s; }<\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0438\u0446\u0438\u044f opened:  <\/p>\n<pre><code class=\"css\">custom-viewport[data-mode = &quot;opened&quot;] { transform: translateY(0); transition: transform 1s; overflow-y: scroll; }<\/code><\/pre>\n<p>  \u041f\u043e\u0437\u0438\u0446\u0438\u044f deleted:  <\/p>\n<pre><code class=\"css\">custom-viewport[data-mode = &quot;deleted&quot;] { transform: translateY(100%); transition: transform 1s; }<\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302959","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302959"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302959\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}