{"id":1317,"date":"2023-04-18T11:19:12","date_gmt":"2023-04-18T08:19:12","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=1317"},"modified":"2023-04-14T11:22:33","modified_gmt":"2023-04-14T08:22:33","slug":"rating-counter","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/elements\/1317\/","title":{"rendered":"Rating &#038; Counter"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video height=\"384\" style=\"aspect-ratio: 717 \/ 384;\" width=\"717\" controls src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/04\/vokoscreenng-2023-04-14_10-18-41.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;rating-stars&quot;&gt;\n    &lt;input type=&quot;radio&quot; name=&quot;rating&quot; id=&quot;rs0&quot; checked&gt;&lt;label for=&quot;rs0&quot;&gt;&lt;\/label&gt;\n    &lt;input type=&quot;radio&quot; name=&quot;rating&quot; id=&quot;rs1&quot;&gt;&lt;label for=&quot;rs1&quot;&gt;&lt;\/label&gt;\n    &lt;input type=&quot;radio&quot; name=&quot;rating&quot; id=&quot;rs2&quot;&gt;&lt;label for=&quot;rs2&quot;&gt;&lt;\/label&gt;\n    &lt;input type=&quot;radio&quot; name=&quot;rating&quot; id=&quot;rs3&quot;&gt;&lt;label for=&quot;rs3&quot;&gt;&lt;\/label&gt;\n    &lt;input type=&quot;radio&quot; name=&quot;rating&quot; id=&quot;rs4&quot;&gt;&lt;label for=&quot;rs4&quot;&gt;&lt;\/label&gt;\n    &lt;input type=&quot;radio&quot; name=&quot;rating&quot; id=&quot;rs5&quot;&gt;&lt;label for=&quot;rs5&quot;&gt;&lt;\/label&gt;\n    &lt;span class=&quot;rating-counter&quot;&gt;&lt;\/span&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;}\">body {\n\tmargin: 0;\n\twidth: 100vw;\n\theight: 100vh;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground-color: #11114e;\n\tbackground: radial-gradient( circle at 50% 100%, #1d659f, #11114e);\t\n}\n\nbody * {\n    box-sizing: border-box;\n}\n\n.rating-stars {\n\tdisplay: block;\n\twidth: 50vmin;\n\tpadding: 1.75vmin 10vmin 2vmin 3vmin;\n\tbackground: linear-gradient(90deg, #ffffff90 40vmin, #fff0 40vmin 100%);\n\tborder-radius: 5vmin;\n\tposition: relative;\n}\n\n.rating-counter {\n\tfont-size: 5.5vmin;\n    font-family: Arial, Helvetica, serif;\n    color: #9aacc6;\n    width: 10vmin;\n    text-align: center;\n    background: #0006;\n    position: absolute;\n    top: 0;\n    right: 0;\n    height: 100%;\n    border-radius: 0 5vmin 5vmin 0;\n    line-height: 10vmin;\n}\n\n.rating-counter:before {\n\tcontent: &quot;0&quot;;\n\ttransition: all 0.25s ease 0s;\t\n}\n\ninput { display: none; }\n\nlabel {\n\twidth: 5vmin;\n\theight: 5vmin;\n\tbackground: #000b;\n\tdisplay: inline-flex;\n\tcursor: pointer;\n\tmargin: 0.5vmin 0.65vmin;\n\ttransition: all 1s ease 0s;\t\n\tclip-path: polygon(50% 0%, 66% 32%, 100% 38%, 78% 64%, 83% 100%, 50% 83%, 17% 100%, 22% 64%, 0 38%, 34% 32%);\n}\n\nlabel[for=rs0] {\n\tdisplay: none;\n}\n\nlabel:before {\n\twidth: 90%;\n\theight: 90%;\n\tcontent: &quot;&quot;;\n\tbackground: orange;\n\tz-index: -1;\n\tdisplay: block;\n\tmargin-left: 5%;\n\tmargin-top: 5%;\n\tclip-path: polygon(50% 0%, 66% 32%, 100% 38%, 78% 64%, 83% 100%, 50% 83%, 17% 100%, 22% 64%, 0 38%, 34% 32%);\n\tbackground: linear-gradient(90deg, yellow, orange 30% 50%, #184580 50%, 70%, #173a75 100%);\n\tbackground-size: 205% 100%;\n\tbackground-position: 0 0;\n}\n\nlabel:hover:before {\n\ttransition: all 0.25s ease 0s;\t\t\n}\n\ninput:checked + label ~ label:before {\n\tbackground-position: 100% 0;\n\ttransition: all 0.25s ease 0s;\t\n}\n\ninput:checked + label ~ label:hover:before {\n\tbackground-position: 0% 0\n}\n\n#rs1:checked ~ .rating-counter:before {\n\tcontent: &quot;1&quot;;\n}\n\n#rs2:checked ~ .rating-counter:before {\n\tcontent: &quot;2&quot;;\n}\n\n#rs3:checked ~ .rating-counter:before {\n\tcontent: &quot;3&quot;;\n}\n\n#rs4:checked ~ .rating-counter:before {\n\tcontent: &quot;4&quot;;\n}\n\n#rs5:checked ~ .rating-counter:before {\n\tcontent: &quot;5&quot;;\n}\n\nlabel + input:checked ~ .rating-counter:before {\n\tcolor: #ffab00 !important;\n\ttransition: all 0.25s ease 0s;\n}\n\n\nlabel:hover ~ .rating-counter:before {\n\tcolor: #9aacc6 !important;\n\ttransition: all 0.5s ease 0s;\t\n\tanimation: pulse 1s ease 0s infinite;\n}\n\n@keyframes pulse {\n\t  50% { font-size: 6.25vmin; }\n}\n\nlabel[for=rs1]:hover ~ .rating-counter:before {\n\tcontent: &quot;1&quot; !important;\n}\n\nlabel[for=rs2]:hover ~ .rating-counter:before {\n\tcontent: &quot;2&quot; !important;\n}\n\nlabel[for=rs3]:hover ~ .rating-counter:before {\n\tcontent: &quot;3&quot; !important;\n}\n\nlabel[for=rs4]:hover ~ .rating-counter:before {\n\tcontent: &quot;4&quot; !important;\n}\n\nlabel[for=rs5]:hover ~ .rating-counter:before {\n\tcontent: &quot;5&quot; !important;\n}\n\n\ninput:checked:hover ~ .rating-counter:before {\n\tanimation: none !important;\n\tcolor: #ffab00 !important ;\n}\n\nlabel + input + label:before {\n    animation: start 0.5s ease 0s 1;\n}\n\n.rating-stars:hover label + input + label:before {\n    animation: none;\n}\n\nlabel[for=rs2]:before {\n\tanimation-delay: 0.1s;\n}\n\nlabel[for=rs3]:before {\n\tanimation-delay: 0.2s;\n}\n\nlabel[for=rs4]:before {\n\tanimation-delay: 0.3s;\n}\n\nlabel[for=rs5]:before {\n\tanimation-delay: 0.4s;\n}\n\n@keyframes start {\n\t10%, 90% { background-position: 0% 0; }\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1318,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[16,77],"class_list":["post-1317","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-elements","tag-htmlcss","tag-rating"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1317","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=1317"}],"version-history":[{"count":1,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1317\/revisions"}],"predecessor-version":[{"id":1320,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1317\/revisions\/1320"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/1318"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=1317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=1317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=1317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}