{"id":411756,"date":"2024-06-29T22:09:07","date_gmt":"2024-06-29T22:09:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=411756"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=411756","title":{"rendered":"<span>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0435 3D-\u043c\u0435\u043d\u044e \u043d\u0430 CSS<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bc0\/a12\/742\/bc0a1274268669705cbb4c73172ee154.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bc0\/a12\/742\/bc0a1274268669705cbb4c73172ee154.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043d\u043e\u0432\u044b\u0445 AR\/VR-\u0438\u0433\u0440\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u0435\u043d\u044e \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043f\u0430\u0440\u0438\u0442\u044c \u0432 \u0432\u043e\u0437\u0434\u0443\u0445\u0435. \u0412\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u0443 \u044d\u0442\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u0443\u044e \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0438 \u0443\u0447\u0442\u0451\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041c\u0435\u043d\u044e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043a\u0440\u0438\u043d\u0440\u0438\u0434\u0435\u0440\u043e\u043c, \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u043e\u043c, \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043a \u0441\u0442\u0430\u0440\u0442\u0443 <a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_301121&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/a>.<\/p>\n<hr\/>\n<h2>\u041e\u0431\u0437\u043e\u0440<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 CSS @custom-media \u0438 @nest \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043c\u0435\u0434\u0438\u0430\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PostCSS \u0438 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432: postcss-custom-media \u0438 postcss-nesting.<\/p>\n<h2>HTML<\/h2>\n<p>\u0418\u0433\u0440\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e \u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u043e\u043f\u043e\u043a. \u0412 HTML \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;ul class=\"threeD-button-set\">   &lt;li>&lt;button>New Game&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Continue&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Online&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Settings&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Quit&lt;\/button>&lt;\/li> &lt;\/ul><\/code><\/pre>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u043e\u043f\u043e\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 JavaScript \u0438\u043b\u0438 CSS.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/862\/e20\/ad4\/862e20ad46b3d6361e6a95b28a05b920.png\" width=\"845\" height=\"461\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/862\/e20\/ad4\/862e20ad46b3d6361e6a95b28a05b920.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>CSS<\/h2>\n<p>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<\/li>\n<li>\n<p>flex-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 3D.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0431\u0437\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/h2>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u0430\u0432\u0430\u044f \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0435\u0437 \u043d\u0438\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043c\u0435\u0434\u0438\u0430\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043c\u0435\u0434\u0438\u0430. \u041e\u043d\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 CSS. \u041e\u043d\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b \u0438 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 prefers-reduced-motion, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u044f:<\/p>\n<pre><code class=\"css\">@custom-media --motionOK (prefers-reduced-motion: no-preference); @custom-media --dark (prefers-color-scheme: dark); @custom-media --HDcolor (dynamic-range: high);<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b\u0448\u0438, \u043f\u0440\u0438\u0434\u0430\u044e\u0449\u0438\u0435 \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0435\u043d\u044e \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. \u0418\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u043e\u0434, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0438 \u043e\u0431 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <a href=\"https:\/\/lea.verou.me\/2021\/10\/custom-properties-with-defaults\/\">\u044d\u0442\u043e\u043c<\/a> \u043f\u043e\u0441\u0442\u0435 \u041b\u0435\u0430 \u0412\u0435\u0440\u043e\u0443:<\/p>\n<\/blockquote>\n<pre><code class=\"css\">.threeD-button-set {   --y:;   --x:;   --distance: 1px;   --theme: hsl(180 100% 50%);   --theme-bg: hsl(180 100% 50% \/ 25%);   --theme-bg-hover: hsl(180 100% 50% \/ 40%);   --theme-text: white;   --theme-shadow: hsl(180 100% 10% \/ 25%);    --_max-rotateY: 10deg;   --_max-rotateX: 15deg;   --_btn-bg: var(--theme-bg);   --_btn-bg-hover: var(--theme-bg-hover);   --_btn-text: var(--theme-text);   --_btn-text-shadow: var(--theme-shadow);   --_bounce-ease: cubic-bezier(.5, 1.75, .75, 1.25);    @media (--dark) {     --theme: hsl(255 53% 50%);     --theme-bg: hsl(255 53% 71% \/ 25%);     --theme-bg-hover: hsl(255 53% 50% \/ 40%);     --theme-shadow: hsl(255 53% 10% \/ 25%);   }    @media (--HDcolor) {     @supports (color: color(display-p3 0 0 0)) {       --theme: color(display-p3 .4 0 .9);     }   } }<\/code><\/pre>\n<h2>\u0422\u0435\u043c\u044b \u0438 \u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/h2>\n<p>\u0421\u0432\u0435\u0442\u043b\u0430\u044f \u0442\u0435\u043c\u0430 \u0438\u043c\u0435\u0435\u0442 \u044f\u0440\u043a\u0438\u0439 <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/CSS\/gradient\/conic-gradient()\">\u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/a> \u043e\u0442 \u0433\u043e\u043b\u0443\u0431\u043e\u0433\u043e \u0434\u043e \u043b\u0438\u043b\u043e\u0432\u043e\u0433\u043e, \u0430 \u0442\u0451\u043c\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0438\u043c\u0435\u0435\u0442 \u0442\u0451\u043c\u043d\u044b\u0439 \u0442\u043e\u043d\u043a\u0438\u0439 \u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442. \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/www.conic.style\/\">conic.style<\/a>:<\/p>\n<pre><code class=\"xml\">html {   background: conic-gradient(at -10% 50%, deeppink, cyan);    @media (--dark) {     background: conic-gradient(at -10% 50%, #212529, 50%, #495057, #212529);   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61dcead041b3b9bfdc829\" data-style=\"\" id=\"61a61dcead041b3b9bfdc829\" width=\"\"><\/div>\n<h2>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c viewport \u0441 <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/CSS\/perspective\">\u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043e\u0439<\/a>. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0443 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 body \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0435\u0434\u0438\u043d\u0438\u0446\u044b viewport:<\/p>\n<pre><code class=\"css\">body {   perspective: 40vw; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61e0e6ea11f3bbbaf206c\" data-style=\"\" id=\"61a61e0e6ea11f3bbbaf206c\" width=\"\"><\/div>\n<h2>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a &lt;ul><\/h2>\n<p>\u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0431\u0449\u0443\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0443 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439, \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u043e\u0439.<\/p>\n<h3>\u041c\u0430\u043a\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043d\u043e\u043f\u043e\u043a<\/h3>\n<p>Flexbox \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u043a\u0435\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 flex \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e \u0441\u0442\u0440\u043e\u043a \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e flex-direction \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 align-items: flex-start:<\/p>\n<pre><code class=\"css\">.threeD-button-set {   \/* remove &lt;ul> margins *\/   margin: 0;    \/* vertical rag-right layout *\/   display: flex;   flex-direction: column;   align-items: flex-start;   gap: 2.5vh; }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61eaaabb378f6450d1acb\" data-style=\"\" id=\"61a61eaaabb378f6450d1acb\" width=\"\"><\/div>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 CSS-\u0444\u0443\u043d\u043a\u0446\u0438\u044e clamp(), \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u043d\u0435 \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f clamp \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (&#8212;x \u0438 &#8212;y) \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0438\u0437 JavaScript \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u043c\u044b\u0448\u044c\u044e:<\/p>\n<pre><code class=\"css\">.threeD-button-set {   \u2026    \/* create 3D space context *\/   transform-style: preserve-3d;    \/* clamped menu rotation to not be too extreme *\/   transform:     rotateY(       clamp(         calc(var(--_max-rotateY) * -1),         var(--y),         var(--_max-rotateY)       )     )     rotateX(       clamp(         calc(var(--_max-rotateX) * -1),         var(--x),         var(--_max-rotateX)       )     )   ; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f \u0441\u0430\u0439\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u0447\u0442\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/CSS\/will-change\">will-change<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0439.\u00a0<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043c\u044b\u0448\u0438 \u0441 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u043e\u0439, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043f\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b\u0448\u044c \u043d\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c:<\/p>\n<pre><code class=\"css\">@media (--motionOK) {   .threeD-button-set {     \/* browser hint so it can be prepared and optimized *\/     will-change: transform;      \/* transition transform style changes and run an infinite animation *\/     transition: transform .1s ease;     animation: rotate-y 5s ease-in-out infinite;   } }<\/code><\/pre>\n<p>\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f rotate-y \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u0439 keyframe \u043d\u0430 50 %, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 0 \u0438 100 % \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0442\u0438\u043b\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.\u00a0<\/p>\n<p>\u042d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0447\u0435\u0440\u0435\u0434\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041e\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0441 \u0447\u0435\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"css\">@keyframes rotate-y {   50% {     transform: rotateY(15deg) rotateX(-6deg);   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61f26cd09f7f6552eb45b\" data-style=\"\" id=\"61a61f26cd09f7f6552eb45b\" width=\"\"><\/div>\n<h2>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 &lt;li><\/h2>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 (&lt;li>) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0435\u0451 \u0433\u0440\u0430\u043d\u0438\u0446\u044b. \u0421\u0442\u0438\u043b\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b <a href=\"https:\/\/web.dev\/css-marker-pseudo-element\/\">::marker<\/a>. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e position \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430 relative, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0432\u0441\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0430:<\/p>\n<pre><code class=\"css\">.threeD-button-set > li {   \/* change display type from list-item *\/   display: inline-flex;    \/* create context for button pseudos *\/   position: relative;    \/* create 3D space context *\/   transform-style: preserve-3d; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c89\/297\/0bb\/c892970bb076f0ab40f27f18a375d07c.png\" width=\"845\" height=\"730\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c89\/297\/0bb\/c892970bb076f0ab40f27f18a375d07c.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 &lt;button><\/h2>\n<p>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u2014 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 &lt;button>\u00a0<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \/* strip out default button styles *\/   appearance: none;   outline: none;   border: none;    \/* bring in brand styles via props *\/   background-color: var(--_btn-bg);   color: var(--_btn-text);   text-shadow: 0 1px 1px var(--_btn-text-shadow);    \/* large text rounded corner and padded*\/   font-size: 5vmin;   font-family: Audiowide;   padding-block: .75ch;   padding-inline: 2ch;   border-radius: 5px 20px; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b07\/4d0\/d83\/b074d0d83e63f56a2006edc83ea86bb0.png\" width=\"845\" height=\"522\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b07\/4d0\/d83\/b074d0d83e63f56a2006edc83ea86bb0.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043d\u043e\u043f\u043e\u043a\u00a0<\/h3>\n<p>\u0413\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441 position: absolute \u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f55\/525\/b62\/f55525b62b42b307b1afa38af4bd472d.png\" width=\"1600\" height=\"608\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f55\/525\/b62\/f55525b62b42b307b1afa38af4bd472d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u043e\u0434\u0432\u0438\u043d\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043d\u043e\u043f\u043a\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u043c\u0443. \u042d\u0444\u0444\u0435\u043a\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0435\u043d \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0438 \u043d\u0438\u0436\u043d\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0430\u0445:<\/p>\n<pre><code class=\"css\">.threeD-button button {   \u2026    &amp;::after,   &amp;::before {     \/* create empty element *\/     content: '';     opacity: .8;      \/* cover the parent (button) *\/     position: absolute;     inset: 0;      \/* style the element for border accents *\/     border: 1px solid var(--theme);     border-radius: 5px 20px;   }    \/* exceptions for one of the pseudo elements *\/   \/* this will be pushed back (3x) and have a thicker border *\/   &amp;::before {     border-width: 3px;      \/* in dark mode, it glows! *\/     @media (--dark) {       box-shadow:         0 0 25px var(--theme),         inset 0 0 25px var(--theme);     }   } }<\/code><\/pre>\n<h3>\u0421\u0442\u0438\u043b\u0438 3D-transform<\/h3>\n<p>\u041d\u0438\u0436\u0435 transform-style \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 preserve-3d, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043e\u0441\u0438 z. \u0414\u043b\u044f transform \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e &#8212;distance. \u042d\u0442\u0430 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 <a href=\"https:\/\/web.dev\/building-a-3d-game-menu-component\/#hover-and-focus-interaction-styles\">\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0435<\/a>:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \u2026    transform: translateZ(var(--distance));   transform-style: preserve-3d;    &amp;::after {     \/* pull forward in Z space with a 3x multiplier *\/     transform: translateZ(calc(var(--distance) \/ 3));   }    &amp;::before {     \/* push back in Z space with a 3x multiplier *\/     transform: translateZ(calc(var(--distance) \/ 3 * -1));   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a6204dedd610f626b80d76\" data-style=\"\" id=\"61a6204dedd610f626b80d76\" width=\"\"><\/div>\n<h3>\u0421\u0442\u0438\u043b\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435, \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e transform \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e: \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 transform \u0438 background-color \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f transition. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438: \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0430\u0451\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0439, \u0442\u043e\u043d\u043a\u0438\u0439 \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \u2026    @media (--motionOK) {     will-change: transform;     transition:       transform .2s ease,       background-color .5s ease     ;      &amp;::before,     &amp;::after {       transition: transform .1s ease-out;     }      &amp;::after    { transition-duration: .5s }     &amp;::before { transition-duration: .3s }   } }<\/code><\/pre>\n<h3>\u0421\u0442\u0438\u043b\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Hover \u0438 Focus<\/h3>\n<p>\u0426\u0435\u043b\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u2014 \u0440\u0430\u0437\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0441\u043b\u043e\u0438, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043f\u043b\u043e\u0441\u043a\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430. \u041e\u043d\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#8212;distance, \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u043e\u0439 1px. \u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0434\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0444\u043e\u043a\u0443\u0441 \u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0418, \u0435\u0441\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0430 \u0432 \u0444\u043e\u043a\u0443\u0441\u0435 \u0438\u043b\u0438 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430\u0432\u0435\u0434\u0451\u043d \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 CSS, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u043a\u043e\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0430\u0440\u0438\u0430\u0446\u0438\u044f transition-duration \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438, \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438. \u041f\u0440\u0438 \u0441\u043d\u044f\u0442\u0438\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0444\u043e\u043a\u0443\u0441\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \u2026    &amp;:is(:hover, :focus-visible):not(:active) {     \/* subtle distance plus bg color change on hover\/focus *\/     --distance: 15px;     background-color: var(--_btn-bg-hover);      \/* if motion is OK, setup transitions and increase distance *\/     @media (--motionOK) {       --distance: 3vmax;        transition-timing-function: var(--_bounce-ease);       transition-duration: .4s;        &amp;::after  { transition-duration: .5s }       &amp;::before { transition-duration: .3s }     }   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a6209e6ea11f3bbbaf206d\" data-style=\"\" id=\"61a6209e6ea11f3bbbaf206d\" width=\"\"><\/div>\n<p>3D-\u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430 \u0445\u043e\u0440\u043e\u0448\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u0412\u0435\u0440\u0445\u043d\u0438\u0439 \u0438 \u043d\u0438\u0436\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.<\/p>\n<h2>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JavaScript<\/h2>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u0441\u043a\u0440\u0438\u043d\u0440\u0438\u0434\u0435\u0440\u043e\u0432, \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430, \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0438 \u043c\u044b\u0448\u0438, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0451\u0433\u043a\u0438\u0445 \u0448\u0442\u0440\u0438\u0445\u043e\u0432 JavaScript.<\/p>\n<h3>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043b\u0430\u0432\u0438\u0448 \u0441\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438<\/h3>\n<p>\u041a\u043b\u0430\u0432\u0438\u0448\u0430 \u0442\u0430\u0431\u0443\u043b\u044f\u0446\u0438\u0438 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u043c\u0435\u043d\u044e, \u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0435 \u0444\u043e\u043a\u0443\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u043b\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u0434\u0436\u043e\u0439\u0441\u0442\u0438\u043a\u043e\u0432. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 roving-ux, \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 GUI Challenge, \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0441\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438. \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441 \u0432\u043d\u0443\u0442\u0440\u0438 .threeD-button-set \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"javascript\">import {rovingIndex} from 'roving-ux'  rovingIndex({   element: document.querySelector('.threeD-button-set'),   target: 'button', })<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a620f36ea11f3bbbaf206e\" data-style=\"\" id=\"61a620f36ea11f3bbbaf206e\" width=\"\"><\/div>\n<h3>\u041f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u044b\u0448\u0438<\/h3>\n<p>\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u044b\u0448\u0438 \u0438 \u043d\u0430\u043a\u043b\u043e\u043d \u043c\u0435\u043d\u044e \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u044b \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440 AR \u0438 VR, \u0433\u0434\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u044b\u0448\u0438 \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u0441\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u044b \u043e\u0431 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a6211df61f533babdf2f68\" data-style=\"\" id=\"61a6211df61f533babdf2f68\" width=\"\"><\/div>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043c\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\u0445. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e querySelector \u0438 \u043a\u0435\u0448\u0438\u0440\u0443\u0439\u0442\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 menuRect. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043a \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b\u0448\u0438.<\/p>\n<pre><code class=\"javascript\">const menu = document.querySelector('.threeD-button-set') const menuRect = menu.getBoundingClientRect()  const { matches:motionOK } = window.matchMedia(   '(prefers-reduced-motion: no-preference)' )<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u044b\u0448\u0438 <em>x<\/em> \u0438 <em>y<\/em> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u044b\u0448\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0431\u043b\u043e\u043a\u0430 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0414\u0435\u043b\u044c\u0442\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"javascript\">const getAngles = (clientX, clientY) => {   const { x, y, width, height } = menuRect    const dx = clientX - (x + 0.5 * width)   const dy = clientY - (y + 0.5 * height)    return {dx,dy} }<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u043c\u044b\u0448\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e getAngles() \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u044c\u0442\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u042f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u043d\u0430 20, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u043b\u0430\u0434\u0438\u0442\u044c \u0434\u0435\u043b\u044c\u0442\u0443 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u043c\u0435\u043d\u0435\u0435 \u0434\u0451\u0440\u0433\u0430\u043d\u043e\u0439, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e. \u041a\u0430\u043a \u0432\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b &#8212;x \u0438 &#8212;y \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 clamp(), \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0432 \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"javascript\">if (motionOK) {   window.addEventListener('mousemove', ({target, clientX, clientY}) => {     const {dx,dy} = getAngles(clientX, clientY)      menu.attributeStyleMap.set('--x', `${dy \/ 20}deg`)     menu.attributeStyleMap.set('--y', `${dx \/ 20}deg`)   }) }<\/code><\/pre>\n<h2>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0438\u0441\u044c\u043c\u0430<\/h2>\n<p>\u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u044f\u0437\u044b\u043a\u0430\u0445 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0434\u043d\u0430 \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a62170edd610f626b80d77\" data-style=\"\" id=\"61a62170edd610f626b80d77\" width=\"\"><\/div>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b &lt;button> \u0438\u043c\u0435\u044e\u0442 \u0441\u0442\u0438\u043b\u044c !important \u0434\u043b\u044f writing-mode \u0432 \u0441\u0442\u0438\u043b\u044f\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e, \u0447\u0442\u043e HTML \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u0438\u0442\u044c \u0435\u0433\u043e \u043a \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u043c\u0443 \u0434\u0438\u0437\u0430\u0439\u043d\u0443. \u0417\u0430\u043c\u0435\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b &lt;a> \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u0441\u0442\u0438\u043b\u044f !important.<\/p>\n<p><a href=\"https:\/\/github.com\/GoogleChrome\/web.dev\/blob\/main\/src\/site\/content\/en\/blog\/building-a-3d-game-menu-component\/index.md\">\u041a\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043d\u0430 Github.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u0438\u0434\u0435\u043e-\u0432\u0435\u0440\u0441\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a654631370783b8bf9315a\" data-style=\"\" id=\"61a654631370783b8bf9315a\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0451. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 CSS \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043a\u0443\u0440\u0441\u0430\u0445:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a19\/226\/946\/a192269468afeca5e6013ca4036d483c.png\" width=\"1000\" height=\"200\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a19\/226\/946\/a192269468afeca5e6013ca4036d483c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0423\u0437\u043d\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 <a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_301121&amp;utm_term=conc\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python (15 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (7 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>Data Science \u0438 Machine Learning<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Data Engineering<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438 Deep Learning\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Java \u0438 C#<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430 JAVA<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041e\u0442 \u043e\u0441\u043d\u043e\u0432 \u2014 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_301121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410 \u0442\u0430\u043a\u0436\u0435:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_301121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_301121&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/592549\/\"> https:\/\/habr.com\/ru\/articles\/592549\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043d\u043e\u0432\u044b\u0445 AR\/VR-\u0438\u0433\u0440\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u0435\u043d\u044e \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043f\u0430\u0440\u0438\u0442\u044c \u0432 \u0432\u043e\u0437\u0434\u0443\u0445\u0435. \u0412\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u0443 \u044d\u0442\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u0443\u044e \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0438 \u0443\u0447\u0442\u0451\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041c\u0435\u043d\u044e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043a\u0440\u0438\u043d\u0440\u0438\u0434\u0435\u0440\u043e\u043c, \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u043e\u043c, \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043a \u0441\u0442\u0430\u0440\u0442\u0443 <a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_301121&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/a>.<\/p>\n<hr\/>\n<h2>\u041e\u0431\u0437\u043e\u0440<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 CSS @custom-media \u0438 @nest \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043c\u0435\u0434\u0438\u0430\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PostCSS \u0438 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432: postcss-custom-media \u0438 postcss-nesting.<\/p>\n<h2>HTML<\/h2>\n<p>\u0418\u0433\u0440\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e \u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u043e\u043f\u043e\u043a. \u0412 HTML \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;ul class=\"threeD-button-set\">   &lt;li>&lt;button>New Game&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Continue&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Online&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Settings&lt;\/button>&lt;\/li>   &lt;li>&lt;button>Quit&lt;\/button>&lt;\/li> &lt;\/ul><\/code><\/pre>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u043e\u043f\u043e\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 JavaScript \u0438\u043b\u0438 CSS.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>CSS<\/h2>\n<p>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<\/li>\n<li>\n<p>flex-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 3D.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0431\u0437\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/h2>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u0430\u0432\u0430\u044f \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0435\u0437 \u043d\u0438\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043c\u0435\u0434\u0438\u0430\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043c\u0435\u0434\u0438\u0430. \u041e\u043d\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 CSS. \u041e\u043d\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b \u0438 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 prefers-reduced-motion, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u044f:<\/p>\n<pre><code class=\"css\">@custom-media --motionOK (prefers-reduced-motion: no-preference); @custom-media --dark (prefers-color-scheme: dark); @custom-media --HDcolor (dynamic-range: high);<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b\u0448\u0438, \u043f\u0440\u0438\u0434\u0430\u044e\u0449\u0438\u0435 \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0435\u043d\u044e \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. \u0418\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u043e\u0434, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0438 \u043e\u0431 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <a href=\"https:\/\/lea.verou.me\/2021\/10\/custom-properties-with-defaults\/\">\u044d\u0442\u043e\u043c<\/a> \u043f\u043e\u0441\u0442\u0435 \u041b\u0435\u0430 \u0412\u0435\u0440\u043e\u0443:<\/p>\n<\/blockquote>\n<pre><code class=\"css\">.threeD-button-set {   --y:;   --x:;   --distance: 1px;   --theme: hsl(180 100% 50%);   --theme-bg: hsl(180 100% 50% \/ 25%);   --theme-bg-hover: hsl(180 100% 50% \/ 40%);   --theme-text: white;   --theme-shadow: hsl(180 100% 10% \/ 25%);    --_max-rotateY: 10deg;   --_max-rotateX: 15deg;   --_btn-bg: var(--theme-bg);   --_btn-bg-hover: var(--theme-bg-hover);   --_btn-text: var(--theme-text);   --_btn-text-shadow: var(--theme-shadow);   --_bounce-ease: cubic-bezier(.5, 1.75, .75, 1.25);    @media (--dark) {     --theme: hsl(255 53% 50%);     --theme-bg: hsl(255 53% 71% \/ 25%);     --theme-bg-hover: hsl(255 53% 50% \/ 40%);     --theme-shadow: hsl(255 53% 10% \/ 25%);   }    @media (--HDcolor) {     @supports (color: color(display-p3 0 0 0)) {       --theme: color(display-p3 .4 0 .9);     }   } }<\/code><\/pre>\n<h2>\u0422\u0435\u043c\u044b \u0438 \u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/h2>\n<p>\u0421\u0432\u0435\u0442\u043b\u0430\u044f \u0442\u0435\u043c\u0430 \u0438\u043c\u0435\u0435\u0442 \u044f\u0440\u043a\u0438\u0439 <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/CSS\/gradient\/conic-gradient()\">\u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/a> \u043e\u0442 \u0433\u043e\u043b\u0443\u0431\u043e\u0433\u043e \u0434\u043e \u043b\u0438\u043b\u043e\u0432\u043e\u0433\u043e, \u0430 \u0442\u0451\u043c\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0438\u043c\u0435\u0435\u0442 \u0442\u0451\u043c\u043d\u044b\u0439 \u0442\u043e\u043d\u043a\u0438\u0439 \u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442. \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/www.conic.style\/\">conic.style<\/a>:<\/p>\n<pre><code class=\"xml\">html {   background: conic-gradient(at -10% 50%, deeppink, cyan);    @media (--dark) {     background: conic-gradient(at -10% 50%, #212529, 50%, #495057, #212529);   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61dcead041b3b9bfdc829\" data-style=\"\" id=\"61a61dcead041b3b9bfdc829\" width=\"\"><\/div>\n<h2>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c viewport \u0441 <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/CSS\/perspective\">\u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043e\u0439<\/a>. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0443 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 body \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0435\u0434\u0438\u043d\u0438\u0446\u044b viewport:<\/p>\n<pre><code class=\"css\">body {   perspective: 40vw; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61e0e6ea11f3bbbaf206c\" data-style=\"\" id=\"61a61e0e6ea11f3bbbaf206c\" width=\"\"><\/div>\n<h2>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a &lt;ul><\/h2>\n<p>\u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0431\u0449\u0443\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0443 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u043e\u043f\u043e\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439, \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u043e\u0439.<\/p>\n<h3>\u041c\u0430\u043a\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043d\u043e\u043f\u043e\u043a<\/h3>\n<p>Flexbox \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u043a\u0435\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 flex \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e \u0441\u0442\u0440\u043e\u043a \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e flex-direction \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 align-items: flex-start:<\/p>\n<pre><code class=\"css\">.threeD-button-set {   \/* remove &lt;ul> margins *\/   margin: 0;    \/* vertical rag-right layout *\/   display: flex;   flex-direction: column;   align-items: flex-start;   gap: 2.5vh; }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61eaaabb378f6450d1acb\" data-style=\"\" id=\"61a61eaaabb378f6450d1acb\" width=\"\"><\/div>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 CSS-\u0444\u0443\u043d\u043a\u0446\u0438\u044e clamp(), \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u043d\u0435 \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f clamp \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (&#8212;x \u0438 &#8212;y) \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0438\u0437 JavaScript \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u043c\u044b\u0448\u044c\u044e:<\/p>\n<pre><code class=\"css\">.threeD-button-set {   \u2026    \/* create 3D space context *\/   transform-style: preserve-3d;    \/* clamped menu rotation to not be too extreme *\/   transform:     rotateY(       clamp(         calc(var(--_max-rotateY) * -1),         var(--y),         var(--_max-rotateY)       )     )     rotateX(       clamp(         calc(var(--_max-rotateX) * -1),         var(--x),         var(--_max-rotateX)       )     )   ; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f \u0441\u0430\u0439\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u0447\u0442\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/CSS\/will-change\">will-change<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0439.\u00a0<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043c\u044b\u0448\u0438 \u0441 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u043e\u0439, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043f\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b\u0448\u044c \u043d\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c:<\/p>\n<pre><code class=\"css\">@media (--motionOK) {   .threeD-button-set {     \/* browser hint so it can be prepared and optimized *\/     will-change: transform;      \/* transition transform style changes and run an infinite animation *\/     transition: transform .1s ease;     animation: rotate-y 5s ease-in-out infinite;   } }<\/code><\/pre>\n<p>\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f rotate-y \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u0439 keyframe \u043d\u0430 50 %, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 0 \u0438 100 % \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0442\u0438\u043b\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.\u00a0<\/p>\n<p>\u042d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0447\u0435\u0440\u0435\u0434\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041e\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0441 \u0447\u0435\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"css\">@keyframes rotate-y {   50% {     transform: rotateY(15deg) rotateX(-6deg);   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a61f26cd09f7f6552eb45b\" data-style=\"\" id=\"61a61f26cd09f7f6552eb45b\" width=\"\"><\/div>\n<h2>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 &lt;li><\/h2>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 (&lt;li>) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0435\u0451 \u0433\u0440\u0430\u043d\u0438\u0446\u044b. \u0421\u0442\u0438\u043b\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b <a href=\"https:\/\/web.dev\/css-marker-pseudo-element\/\">::marker<\/a>. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e position \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430 relative, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0432\u0441\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0430:<\/p>\n<pre><code class=\"css\">.threeD-button-set > li {   \/* change display type from list-item *\/   display: inline-flex;    \/* create context for button pseudos *\/   position: relative;    \/* create 3D space context *\/   transform-style: preserve-3d; }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 &lt;button><\/h2>\n<p>\u0421\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u2014 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 &lt;button>\u00a0<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \/* strip out default button styles *\/   appearance: none;   outline: none;   border: none;    \/* bring in brand styles via props *\/   background-color: var(--_btn-bg);   color: var(--_btn-text);   text-shadow: 0 1px 1px var(--_btn-text-shadow);    \/* large text rounded corner and padded*\/   font-size: 5vmin;   font-family: Audiowide;   padding-block: .75ch;   padding-inline: 2ch;   border-radius: 5px 20px; }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043d\u043e\u043f\u043e\u043a\u00a0<\/h3>\n<p>\u0413\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441 position: absolute \u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0441\u0435\u0432\u0434\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u043e\u0434\u0432\u0438\u043d\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043d\u043e\u043f\u043a\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u043c\u0443. \u042d\u0444\u0444\u0435\u043a\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0435\u043d \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0438 \u043d\u0438\u0436\u043d\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0430\u0445:<\/p>\n<pre><code class=\"css\">.threeD-button button {   \u2026    &amp;::after,   &amp;::before {     \/* create empty element *\/     content: '';     opacity: .8;      \/* cover the parent (button) *\/     position: absolute;     inset: 0;      \/* style the element for border accents *\/     border: 1px solid var(--theme);     border-radius: 5px 20px;   }    \/* exceptions for one of the pseudo elements *\/   \/* this will be pushed back (3x) and have a thicker border *\/   &amp;::before {     border-width: 3px;      \/* in dark mode, it glows! *\/     @media (--dark) {       box-shadow:         0 0 25px var(--theme),         inset 0 0 25px var(--theme);     }   } }<\/code><\/pre>\n<h3>\u0421\u0442\u0438\u043b\u0438 3D-transform<\/h3>\n<p>\u041d\u0438\u0436\u0435 transform-style \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 preserve-3d, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043e\u0441\u0438 z. \u0414\u043b\u044f transform \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e &#8212;distance. \u042d\u0442\u0430 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 <a href=\"https:\/\/web.dev\/building-a-3d-game-menu-component\/#hover-and-focus-interaction-styles\">\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0435<\/a>:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \u2026    transform: translateZ(var(--distance));   transform-style: preserve-3d;    &amp;::after {     \/* pull forward in Z space with a 3x multiplier *\/     transform: translateZ(calc(var(--distance) \/ 3));   }    &amp;::before {     \/* push back in Z space with a 3x multiplier *\/     transform: translateZ(calc(var(--distance) \/ 3 * -1));   } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61a6204dedd610f626b80d76\" data-style=\"\" id=\"61a6204dedd610f626b80d76\" width=\"\"><\/div>\n<h3>\u0421\u0442\u0438\u043b\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435, \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e transform \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e: \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 transform \u0438 background-color \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f transition. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438: \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0430\u0451\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0439, \u0442\u043e\u043d\u043a\u0438\u0439 \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442:<\/p>\n<pre><code class=\"css\">.threeD-button-set button {   \u2026    @media (--motionOK) {     will-change: transform;     transition:       transform .2s ease,       background-color .5s ease     ;      &amp;::before,     &amp;::after {       transition: transform .1s ease-out;     }      &amp;::after    { transition-duration: .5s }     &amp;::before { transition-duration: .3s }   } }<\/code><\/pre>\n<h3>\u0421\u0442\u0438\u043b\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Hover \u0438 Focus<\/h3>\n<p>\u0426\u0435\u043b\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-411756","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/411756","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=411756"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/411756\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=411756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=411756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=411756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}