{"id":294,"date":"2023-03-07T19:09:04","date_gmt":"2023-03-07T16:09:04","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=294"},"modified":"2023-03-28T23:44:25","modified_gmt":"2023-03-28T20:44:25","slug":"slajder-6","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/slider\/294\/","title":{"rendered":"Slider"},"content":{"rendered":"<figure class=\"wp-block-video\"><video height=\"865\" style=\"aspect-ratio: 1747 \/ 865;\" width=\"1747\" controls src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/03\/vokoscreenng-2023-03-07_17-04-45.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;slider&quot;&gt;\n  &lt;!-- slides --&gt;\n  &lt;div class=&quot;slider__slides&quot;&gt;\n    &lt;div class=&quot;slide s--active&quot;&gt;\n      &lt;div class=&quot;slide__inner&quot;&gt;\n        &lt;div class=&quot;slide__content&quot;&gt;\n          &lt;h2 class=&quot;slide__heading&quot;&gt;Clip-Path Revealing Slider&lt;\/h2&gt;\n          &lt;p class=&quot;slide__text&quot;&gt;Greetings, Traveler!&lt;\/p&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;slide&quot;&gt;\n      &lt;div class=&quot;slide__inner&quot;&gt;\n        &lt;div class=&quot;slide__content&quot;&gt;\n          &lt;h2 class=&quot;slide__heading&quot;&gt;Simple Animation&lt;\/h2&gt;\n          &lt;p class=&quot;slide__text&quot;&gt;Clip-path magic!&lt;\/p&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;slide&quot;&gt;\n      &lt;div class=&quot;slide__inner&quot;&gt;\n        &lt;div class=&quot;slide__content&quot;&gt;\n          &lt;h2 class=&quot;slide__heading&quot;&gt;Very Stylish Effect!&lt;\/h2&gt;\n          &lt;p class=&quot;slide__text&quot;&gt;It looks cool, isn&#039;t it?&lt;\/p&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;slide&quot;&gt;\n      &lt;div class=&quot;slide__inner&quot;&gt;\n        &lt;div class=&quot;slide__content&quot;&gt;\n          &lt;h2 class=&quot;slide__heading&quot;&gt;Limited browser support&lt;\/h2&gt;\n          &lt;p class=&quot;slide__text&quot;&gt;Forget about IE\/Edge and FF&lt;\/p&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;slide s--prev&quot;&gt;\n      &lt;div class=&quot;slide__inner&quot;&gt;\n        &lt;div class=&quot;slide__content&quot;&gt;\n          &lt;h2 class=&quot;slide__heading&quot;&gt;Check my other stuff!&lt;\/h2&gt;\n \n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;!-- slides end --&gt;\n  &lt;div class=&quot;slider__control&quot;&gt;\n    &lt;div class=&quot;slider__control-line&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;slider__control-line&quot;&gt;&lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;slider__control slider__control--right m--right&quot;&gt;\n    &lt;div class=&quot;slider__control-line&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;slider__control-line&quot;&gt;&lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\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\nbody {\n  overflow: hidden;\n  font-family: Helvetica, Arial, sans-serif;\n}\n\n.slider {\n  position: relative;\n  height: 100vh;\n}\n.slider__slides {\n  z-index: 1;\n  position: relative;\n  height: 100%;\n}\n.slider__control {\n  z-index: 2;\n  position: absolute;\n  top: 50%;\n  left: 5%;\n  width: 60px;\n  height: 60px;\n  margin-left: -30px;\n  margin-top: -30px;\n  border-radius: 50%;\n  background: #fff;\n  transition: background-color 0.3s;\n  cursor: pointer;\n}\n.slider__control--right {\n  left: 95%;\n}\n.slider__control:hover {\n  background-color: #2da6ff;\n}\n.slider__control-line {\n  position: absolute;\n  left: 23px;\n  top: 50%;\n  width: 3px;\n  height: 14px;\n  transform-origin: 50% 0;\n  transform: rotate(-45deg);\n}\n.slider__control-line:nth-child(2) {\n  transform: translateY(1px) rotate(-135deg);\n}\n.slider__control--right .slider__control-line {\n  left: 37px;\n  transform-origin: 1px 0;\n  transform: rotate(45deg);\n}\n.slider__control--right .slider__control-line:nth-child(2) {\n  transform: translateY(1px) rotate(135deg);\n}\n.slider__control-line:after {\n  content: &quot;&quot;;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #e2e2e2;\n  transition: background-color 0.3s;\n}\n.slider__control:hover .slider__control-line:after {\n  background-color: #fff;\n}\n.slider__control.a--rotation .slider__control-line:after {\n  -webkit-animation: arrowLineRotation 0.49s;\n          animation: arrowLineRotation 0.49s;\n}\n.slider__control.a--rotation .slider__control-line:nth-child(1):after {\n  -webkit-animation: arrowLineRotationRev 0.49s;\n          animation: arrowLineRotationRev 0.49s;\n}\n\n@-webkit-keyframes arrowLineRotation {\n  to {\n    transform: rotate(180deg);\n  }\n}\n\n@keyframes arrowLineRotation {\n  to {\n    transform: rotate(180deg);\n  }\n}\n@-webkit-keyframes arrowLineRotationRev {\n  to {\n    transform: rotate(-180deg);\n  }\n}\n@keyframes arrowLineRotationRev {\n  to {\n    transform: rotate(-180deg);\n  }\n}\n.slide {\n  overflow: hidden;\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 150vmax;\n  height: 150vmax;\n  transform: translate(-50%, -50%);\n  border-radius: 50%;\n  transition: -webkit-clip-path 0s 0.91s;\n  transition: clip-path 0s 0.91s;\n  transition: clip-path 0s 0.91s, -webkit-clip-path 0s 0.91s;\n  -webkit-clip-path: circle(30px at 120vw 50%);\n          clip-path: circle(30px at 120vw 50%);\n}\n.slide.s--prev {\n  -webkit-clip-path: circle(30px at 30vw 50%);\n          clip-path: circle(30px at 30vw 50%);\n}\n.slide.s--active {\n  z-index: 1;\n  transition: -webkit-clip-path 1.3s;\n  transition: clip-path 1.3s;\n  transition: clip-path 1.3s, -webkit-clip-path 1.3s;\n  -webkit-clip-path: circle(120vmax at 120vw 50%);\n          clip-path: circle(120vmax at 120vw 50%);\n}\n.slide.s--active.s--active-prev {\n  -webkit-clip-path: circle(120vmax at 30vw 50%);\n          clip-path: circle(120vmax at 30vw 50%);\n}\n.slide:nth-child(1) .slide__inner {\n  background-image: url(&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/onepgscr-2.jpg&quot;);\n}\n.slide:nth-child(2) .slide__inner {\n  background-image: url(&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/onepgscr-3.jpg&quot;);\n}\n.slide:nth-child(3) .slide__inner {\n  background-image: url(&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/onepgscr-4.jpg&quot;);\n}\n.slide:nth-child(4) .slide__inner {\n  background-image: url(&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/onepgscr-5.jpg&quot;);\n}\n.slide:nth-child(5) .slide__inner {\n  background-image: url(&quot;https:\/\/s3-us-west-2.amazonaws.com\/s.cdpn.io\/142996\/onepgscr-6.jpg&quot;);\n}\n.slide__inner {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 100vw;\n  height: 100vh;\n  margin-left: -50vw;\n  margin-top: -50vh;\n  background-size: cover;\n  background-position: center center;\n}\n.slide__inner:before {\n  content: &quot;&quot;;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  background: rgba(0, 0, 0, 0.3);\n}\n.slide__content {\n  position: absolute;\n  left: 5%;\n  top: 50%;\n  margin-left: -30px;\n  margin-top: 48px;\n  max-width: 480px;\n  color: #fff;\n}\n.slide__heading {\n  margin-bottom: 20px;\n  font-size: 60px;\n}\n.slide__text {\n  font-size: 25px;\n}\n.slide__text a {\n  color: inherit;\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;}\">(function () {\n  var $slides = document.querySelectorAll(&quot;.slide&quot;);\n  var $controls = document.querySelectorAll(&quot;.slider__control&quot;);\n  var numOfSlides = $slides.length;\n  var slidingAT = 1300; \/\/ sync this with scss variable\n  var slidingBlocked = false;\n\n  [].slice.call($slides).forEach(function ($el, index) {\n    var i = index + 1;\n    $el.classList.add(&quot;slide-&quot; + i);\n    $el.dataset.slide = i;\n  });\n\n  [].slice.call($controls).forEach(function ($el) {\n    $el.addEventListener(&quot;click&quot;, controlClickHandler);\n  });\n\n  function controlClickHandler() {\n    if (slidingBlocked) return;\n    slidingBlocked = true;\n\n    var $control = this;\n    var isRight = $control.classList.contains(&quot;m--right&quot;);\n    var $curActive = document.querySelector(&quot;.slide.s--active&quot;);\n    var index = +$curActive.dataset.slide;\n    isRight ? index++ : index--;\n    if (index &lt; 1) index = numOfSlides;\n    if (index &gt; numOfSlides) index = 1;\n    var $newActive = document.querySelector(&quot;.slide-&quot; + index);\n\n    $control.classList.add(&quot;a--rotation&quot;);\n    $curActive.classList.remove(&quot;s--active&quot;, &quot;s--active-prev&quot;);\n    document.querySelector(&quot;.slide.s--prev&quot;).classList.remove(&quot;s--prev&quot;);\n\n    $newActive.classList.add(&quot;s--active&quot;);\n    if (!isRight) $newActive.classList.add(&quot;s--active-prev&quot;);\n\n    var prevIndex = index - 1;\n    if (prevIndex &lt; 1) prevIndex = numOfSlides;\n\n    document.querySelector(&quot;.slide-&quot; + prevIndex).classList.add(&quot;s--prev&quot;);\n\n    setTimeout(function () {\n      $control.classList.remove(&quot;a--rotation&quot;);\n      slidingBlocked = false;\n    }, slidingAT * 0.75);\n  }\n})();<\/pre><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":296,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-slider"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/294","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=294"}],"version-history":[{"count":0,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/296"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}