{"id":385,"date":"2023-03-08T12:49:07","date_gmt":"2023-03-08T09:49:07","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=385"},"modified":"2023-03-29T15:19:45","modified_gmt":"2023-03-29T12:19:45","slug":"switch","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/switch\/385\/","title":{"rendered":"Switch"},"content":{"rendered":"<figure class=\"wp-block-video\"><video height=\"641\" style=\"aspect-ratio: 1172 \/ 641;\" width=\"1172\" controls src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/03\/vokoscreenng-2023-03-08_10-44-57.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;colorful-switch&quot;&gt;\n  &lt;input type=&quot;checkbox&quot; class=&quot;colorful-switch__checkbox&quot; id=&quot;colorful-switch-cb&quot; \/&gt;\n  &lt;label class=&quot;colorful-switch__label&quot; for=&quot;colorful-switch-cb&quot;&gt;\n    &lt;span class=&quot;colorful-switch__bg&quot;&gt;&lt;\/span&gt;\n    &lt;span class=&quot;colorful-switch__dot&quot;&gt;&lt;\/span&gt;\n    &lt;span class=&quot;colorful-switch__on&quot;&gt;\n      &lt;span class=&quot;colorful-switch__on__inner&quot;&gt;&lt;\/span&gt;\n    &lt;\/span&gt;\n    &lt;span class=&quot;colorful-switch__off&quot;&gt;&lt;\/span&gt;\n  &lt;\/label&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;}\">*, *:before, *:after {\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0;\n}\n\nbody {\n  background: #24282C;\n}\n\n.colorful-switch {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 280px;\n  height: 120px;\n  margin-left: -140px;\n  margin-top: -60px;\n  border-radius: 50px;\n  background: #cfcfcf;\n}\n.colorful-switch:before {\n  content: &quot;&quot;;\n  z-index: -1;\n  position: absolute;\n  left: -5px;\n  top: -5px;\n  width: 290px;\n  height: 130px;\n  border-radius: 55px;\n  background: #314239;\n  transition: background-color 0.3s;\n}\n.colorful-switch:hover:before {\n  background: #4C735F;\n}\n.colorful-switch__checkbox {\n  z-index: -10;\n  position: absolute;\n  left: 0;\n  top: 0;\n  opacity: 0;\n}\n.colorful-switch__label {\n  z-index: 1;\n  overflow: hidden;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  border-radius: 50px;\n  cursor: pointer;\n}\n.colorful-switch__bg {\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 840px;\n  height: 100%;\n  background: linear-gradient(90deg, #14DCD6 0, #10E7BD 280px, #EF9C29 560px, #E76339 100%);\n  transition: transform 0.5s;\n  transform: translate3d(-560px, 0, 0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__bg {\n  transform: translate3d(0, 0, 0);\n}\n.colorful-switch__dot {\n  position: absolute;\n  left: 204px;\n  top: 50%;\n  width: 8px;\n  height: 8px;\n  margin-left: -4px;\n  margin-top: -4px;\n  border-radius: 50%;\n  background: #fff;\n  transition: transform 0.5s;\n  transform: translate3d(0, 0, 0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__dot {\n  transform: translate3d(-125px, 0, 0);\n}\n.colorful-switch__on {\n  position: absolute;\n  left: 177px;\n  top: 35px;\n  width: 30px;\n  height: 56px;\n  transition: transform 0.5s;\n  transform: translate3d(0, 0, 0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__on {\n  transform: translate3d(-125px, 0, 0);\n}\n.colorful-switch__on__inner {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  transition: transform 0.25s 0s cubic-bezier(0.52, -0.96, 0.51, 1.28);\n  transform-origin: 100% 50%;\n  transform: rotate(45deg) scale(0) translateZ(0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__on__inner {\n  transition: transform 0.25s 0.25s cubic-bezier(0.67, -0.16, 0.47, 1.61);\n  transform: rotate(45deg) scale(1) translateZ(0);\n}\n.colorful-switch__on__inner:before, .colorful-switch__on__inner:after {\n  content: &quot;&quot;;\n  position: absolute;\n  border-radius: 4px;\n  background: #fff;\n}\n.colorful-switch__on__inner:before {\n  left: 0;\n  bottom: 0;\n  width: 100%;\n  height: 9px;\n}\n.colorful-switch__on__inner:after {\n  right: 0;\n  top: 0;\n  width: 9px;\n  height: 100%;\n}\n.colorful-switch__off {\n  position: absolute;\n  left: 204px;\n  top: 50%;\n  width: 64px;\n  height: 64px;\n  margin-left: -32px;\n  margin-top: -32px;\n  transition: transform 0.5s;\n  transform: translate3d(0, 0, 0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__off {\n  transform: translate3d(-125px, 0, 0);\n}\n.colorful-switch__off:before, .colorful-switch__off:after {\n  content: &quot;&quot;;\n  position: absolute;\n  left: 0;\n  top: 50%;\n  width: 100%;\n  height: 8px;\n  margin-top: -4px;\n  border-radius: 4px;\n  background: #fff;\n  transition: transform 0.25s 0.25s;\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__off:before, .colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__off:after {\n  transition-delay: 0s;\n}\n.colorful-switch__off:before {\n  transform: rotate(45deg) scaleX(1) translateZ(0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__off:before {\n  transform: rotate(45deg) scaleX(0) translateZ(0);\n}\n.colorful-switch__off:after {\n  transition-timing-function: cubic-bezier(0.67, -0.16, 0.47, 1.61);\n  transform: rotate(-45deg) scaleX(1) translateZ(0);\n}\n.colorful-switch__checkbox:checked ~ .colorful-switch__label .colorful-switch__off:after {\n  transition-timing-function: ease;\n  transform: rotate(-45deg) scaleX(0) translateZ(0);\n}<\/pre><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":388,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[16,29],"class_list":["post-385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-switch","tag-htmlcss","tag-switch"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/385","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=385"}],"version-history":[{"count":0,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/385\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/388"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}