{"id":301802,"date":"2020-04-14T03:00:21","date_gmt":"2020-04-14T03:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301802"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-04-14T03:00:21","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301802","title":{"rendered":"\u0417\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 1 \u043a\u0443\u0440\u0441\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/497044\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yh\/ns\/ee\/yhnseey6nhd7bigoxveoezufe8k.png\"><\/p>\n<h3>\u041f\u0438\u0440\u0430\u043c\u0438\u0434\u0430 \u043d\u0430 SVG<\/h3>\n<p>  \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0437\u043d\u0430\u043d\u0438\u044e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c 1 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 SVG:<br \/>  &lt;polygon points=&#8217;0,0 10,20 10,20&#8242; fill=&#8217;blue&#8217;\/&gt;<br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043e\u0437\u0433\u0438 \u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u043c\u0435\u0442\u0440\u0438\u044e.<br \/>  \u0414\u043b\u044f 1 \u043a\u0443\u0440\u0441\u0430 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e.<br \/>  \u0422\u0430\u043a\u0438\u0445 \u0444\u0438\u0433\u0443\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043b\u0435\u0433\u043a\u043e.<br \/>  <a href=\"http:\/\/react-py.ru\/pyramid\" rel=\"nofollow\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u0443<\/a><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Html \u043a\u043e\u0434 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&lt;html&gt; &lt;head&gt; &lt;title&gt;pyramid&lt;\/title&gt; &lt;script&gt; window.onload = _ =&gt; {     let pi_3 = [0, -1*Math.PI\/3, -2*Math.PI\/3, -Math.PI, -4*Math.PI\/3, -5*Math.PI\/3, 0];     let _grad = Math.PI\/180;     let [_h, _r, _u, _cx, _cy] = [0, 0, 0.0, 125, 100];      let svg = document.getElementById('pyramid1');     let pyramid1 = Array.from(svg.children); \/\/ HTMLCollection to Array     svg = document.getElementById('pyramid2');     let pyramid2 = Array.from(svg.children); \/\/ HTMLCollection to Array      setInterval( _ =&gt; { \/\/ start of rotation         let [x1, y1, ug] = [ [], [], _u*_grad];          pi_3.forEach( (u, i) =&gt; {             let [x,y] = [Math.cos(u+ug), Math.sin(u+ug)];             [x1[i], y1[i]] = [0.87*(x-y), 0.25*(-x-y)];         });                  \/\/ *** *** ***                  let [r, h, cx, cy] = [50, 100, 125, 100];         pyramid1.forEach( (it, i) =&gt; {             let xy = [cx+r*x1[i], cy+r*y1[i], cx, cy-h, cx+r*x1[i+1], cy+r*y1[i+1]];             it.setAttribute(&quot;points&quot;, `${xy[0]},${xy[1]} ${xy[2]},${xy[3]} ${xy[4]},${xy[5]}`);         });                  \/\/ *** *** ***                  let ls = [];         let ir = 4 + Math.floor((_u+25.)\/60.);         let ib = 4 + Math.floor(_u\/60.);         if ( ir &gt;= 6 )             ir -= 6;          if ( ib &gt;= 6 )             ib -= 6;          for (let i = 0; i &lt; 6; i++) {             ls[i+6] = [_cx+_r*x1[i], _cy+_r*y1[i], _cx, _cy-_h, _cx+_r*x1[i+1], _cy+_r*y1[i+1], 'rgba(176, 0, 0, 0.7)', '#faa'];             ls[i]   = [_cx+_r*x1[i], _cy+_r*y1[i], _cx, _cy+_h, _cx+_r*x1[i+1], _cy+_r*y1[i+1], 'rgba(176, 229, 229, 0.7)', '#fff'];         }         pyramid2.forEach( (it,j) =&gt; {             let i = j;             if ( j &lt; 6 ) {                 i += ib;                 if ( i &gt;= 6 )                     i -= 6;             }             else {                 i += ir;                 if ( i &gt;= 12 )                     i -= 6;             }             it.setAttribute(&quot;points&quot;, `${ls[i][0]},${ls[i][1]} ${ls[i][2]},${ls[i][3]} ${ls[i][4]},${ls[i][5]}`);             it.setAttribute(&quot;fill&quot;, ls[i][6]);             it.setAttribute(&quot;stroke&quot;, ls[i][7]);         });          _h &lt; 100 &amp;&amp; _h++;         _r &lt; 60 &amp;&amp; _r++;         \/\/ *** *** ***                  _u += 0.5;         if (_u &gt;= 360)             _u = 0.0;     }, 50); } &lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; &lt;h3 style=&quot;width: 240px; margin: auto&quot;&gt;\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u0430.&lt;br&gt;\u041d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0443\u0434\u0430 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f. &lt;svg id=&quot;pyramid1&quot; width=&quot;200&quot; height=&quot;150&quot;&gt;     &lt;polygon stroke-width=&quot;1&quot; stroke=&quot;#555&quot; fill=&quot;rgba(0, 0, 0, 0.1)&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot; stroke=&quot;#555&quot; fill=&quot;rgba(0, 0, 0, 0.1)&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot; stroke=&quot;#555&quot; fill=&quot;rgba(0, 0, 0, 0.1)&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot; stroke=&quot;#555&quot; fill=&quot;rgba(0, 0, 0, 0.1)&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot; stroke=&quot;#555&quot; fill=&quot;rgba(0, 0, 0, 0.1)&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot; stroke=&quot;#555&quot; fill=&quot;rgba(0, 0, 0, 0.1)&quot;\/&gt; &lt;\/svg&gt; \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435 &lt;svg id=&quot;pyramid2&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;     &lt;polygon stroke-width=&quot;1&quot;\/&gt;&lt;polygon stroke-width=&quot;1&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot;\/&gt;&lt;polygon stroke-width=&quot;1&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot;\/&gt;&lt;polygon stroke-width=&quot;1&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot;\/&gt;&lt;polygon stroke-width=&quot;1&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot;\/&gt;&lt;polygon stroke-width=&quot;1&quot;\/&gt;     &lt;polygon stroke-width=&quot;1&quot;\/&gt;&lt;polygon stroke-width=&quot;1&quot;\/&gt; &lt;\/svg&gt; &lt;\/h3&gt; &lt;\/body&gt; &lt;\/html&gt;  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0432\u0441\u0435, \u0443\u0434\u0430\u0447\u0438.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/497044\/\"> https:\/\/habr.com\/ru\/post\/497044\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/497044\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yh\/ns\/ee\/yhnseey6nhd7bigoxveoezufe8k.png\"><\/p>\n<h3>\u041f\u0438\u0440\u0430\u043c\u0438\u0434\u0430 \u043d\u0430 SVG<\/h3>\n<p>  \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0437\u043d\u0430\u043d\u0438\u044e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c 1 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 SVG:<br \/>  &lt;polygon points=&#8217;0,0 10,20 10,20&#8242; fill=&#8217;blue&#8217;\/&gt;<br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043e\u0437\u0433\u0438 \u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u043c\u0435\u0442\u0440\u0438\u044e.<br \/>  \u0414\u043b\u044f 1 \u043a\u0443\u0440\u0441\u0430 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e.<br \/>  \u0422\u0430\u043a\u0438\u0445 \u0444\u0438\u0433\u0443\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043b\u0435\u0433\u043a\u043e.<br \/>  <a href=\"http:\/\/react-py.ru\/pyramid\" rel=\"nofollow\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u0443<\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301802","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301802","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=301802"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301802\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}