{"id":176325,"date":"2013-04-12T12:58:03","date_gmt":"2013-04-12T08:58:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=176325"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=176325","title":{"rendered":"<span class=\"post_title\">\u0413\u0438\u043f\u0435\u0440\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430 JavaScript<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0425\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435! \u0421 \u0434\u043d\u0435\u043c \u043a\u043e\u0441\u043c\u043e\u043d\u0430\u0432\u0442\u0438\u043a\u0438!<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/4e7\/f83\/544\/4e7f83544bb315c1381e3a6d5edbbb5c.jpeg\"\/><\/p>\n<p>  \u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043f\u0440\u0438\u0443\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u043c \u043a \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u043c\u0443 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u0443 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u044e \u0433\u0438\u043f\u0435\u0440\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0430\u0437\u043c\u044b\u0441\u043b\u0438\u0432 \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Canvas \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 \u0434\u043b\u044f SVG \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u0430 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0440\u0435\u0434\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f, \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u043e\u043d, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0434\u043e\u043b\u0433\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. Canvas, \u043a \u0441\u043b\u043e\u0432\u0443, \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u043e\u043d \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435\u2026 <\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u043f\u0438\u0441\u044c \u043d\u0430 \u043f\u043e\u043b\u044f\u0445<\/b><\/p>\n<div class=\"spoiler_text\">\u0412 \u043a\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f reqestAnimFrame \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 requestAnimationFrame \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445, \u0430 \u0442\u0430 \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430. \u0412\u043e\u0442 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"javascript\">        window.requestAnimFrame = (function(){              return  window.requestAnimationFrame       ||                      window.webkitRequestAnimationFrame ||                      window.mozRequestAnimationFrame    ||                      window.oRequestAnimationFrame      ||                      window.msRequestAnimationFrame     ||                      function(\/* function *\/ callback, \/* DOMElement *\/ element){                          window.setTimeout(callback, 1000 \/ 60);                      };          })();           function getRandomInt(min, max){              return Math.floor( Math.random() * (max - min + 1) ) + min;          } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u041f\u043e\u0434\u0445\u043e\u0434 1. \u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. <\/h5>\n<p>  \u0412 \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u0431\u044b\u043b\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0437\u0432\u0435\u0437\u0434\u043d\u043e\u0433\u043e \u043d\u0435\u0431\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412\u0437\u044f\u043b, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b, \u043d\u0430\u043b\u043e\u0436\u0438\u043b \u043d\u0430 Canvas. \u041f\u043e\u0442\u043e\u043c \u043d\u0430\u043b\u043e\u0436\u0438\u043b \u0441 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0435\u0449\u0435 \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0438\u043a\u0441\u0435\u043b\u044c. \u041f\u043e\u0442\u043e\u043c \u0435\u0449\u0435. \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f, \u043d\u043e \u043a\u0430\u043a-\u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0451 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. <\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430 <a href=\"http:\/\/jsfiddle.net\/agegorin\/rK8Bx\/\">jsfiddle<\/a>. <\/p>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u0434. <\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0436\u0438\u0437\u043d\u0438 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c:   <\/p>\n<ul>\n<li>\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e. <\/li>\n<li>\u041c\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u044b. <\/li>\n<li>\u0421\u0442\u0438\u0440\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u0436\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e. <\/li>\n<li>\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0438\u0437\u043a\u043e\u0435. <\/li>\n<li>\u042d\u0442\u043e \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p>  <\/p>\n<h5>\u041f\u043e\u0434\u0445\u043e\u0434 2. \u0411\u043e\u0435\u0432\u043e\u0439.<\/h5>\n<p>  \u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0437\u0432\u0435\u0437\u0434\u0443 \u0438 \u0448\u043b\u0435\u0439\u0444 \u043e\u0442 \u043d\u0435\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. <\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430 <a href=\"http:\/\/jsfiddle.net\/agegorin\/sdMPZ\/\">jsfiddle<\/a>. \u0414\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0435\u0448\u0435\u043d\u043e \u043d\u0430 mousemove \u0441\u043e\u0431\u044b\u0442\u0438\u0435. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0432\u0435\u0437\u0434, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c x \u0438 y, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0434\u0435\u043b\u043e, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0437\u0432\u0435\u0437\u0434\u044b, currentLife \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u043b\u0438\u043d\u0430 \u0448\u043b\u0435\u0439\u0444\u0430 \u043e\u0442 \u0437\u0432\u0435\u0437\u0434\u044b, nx, ny \u0438 life \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0432\u0435\u0437\u0434\u044b, \u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. color \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 colors. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u043e\u0439 \u0446\u0432\u0435\u0442, \u043d\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0437\u0436\u0435. \u041c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0432\u0430, \u0442\u0430\u043a \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0442\u0443\u0445\u0430\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0438\u0433\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0438 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0435 \u0437\u0432\u0435\u0437\u0434\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e (\u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0434\u0430\u0436\u0435 \u043d\u0443\u0436\u043d\u043e) \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u0438\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0443 \u0437\u0432\u0435\u0437\u0434\u044b, \u043d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043b\u0435\u043d\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c. <\/p>\n<pre><code class=\"javascript\">      var colors = [&quot;white&quot;,&quot;rgb(200,200,255)&quot;];              function newStar(){               var life = getRandomInt(50,150);               var dx = getRandomInt(0,canvas.width);               var dy = getRandomInt(0,canvas.height);               return {                   x : dx,                   y : dy,                   nx : dx,                   ny : dy,                   life : life,                   currentLife : life,                   color : colors[getRandomInt(0,1)]               };           }              var stars = [];           var finStars = [];           var maxStars = 350;           for(var i = 0; i &lt; maxStars; i++){               finStars.push(newStar());           }   <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0432\u0435\u0437\u0434\u044b. \u0417\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/b41\/85d\/805\/b4185d80535f2ecb50289c4385e70900.png\"\/><\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u0447\u0442\u043e dx \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a dy \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 ax \u043a ay. \u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c dx \u0440\u0430\u0432\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e currentLife, \u0442\u043e dy = currentLife * ( y \u2014 cy ) \/ ( x \u2014 cx ). \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0432\u0435\u0437\u0434\u044b \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u2014 \u043a\u043e\u0433\u0434\u0430 \u0448\u043b\u0435\u0439\u0444 \u0440\u0430\u0441\u0442\u0435\u0442 \u0438 \u043a\u043e\u0433\u0434\u0430 \u0443\u0431\u044b\u0432\u0430\u0435\u0442. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0435\u0440\u0435\u0437 4 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f: 2 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0438 2 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0420\u0438\u0441\u0443\u0435\u043c \u043e\u0442 (var1 &gt; const1? var1: const1) \u0434\u043e (var2 &lt; const2? var2: const2). \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0442\u0443\u0449\u0443\u044e, \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0442\u0443\u0445\u0430\u044e\u0449\u0443\u044e \u0437\u0432\u0435\u0437\u0434\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ad1\/44f\/fc6\/ad144ffc6d28aa09243bb9351b948fc1.png\"\/><\/p>\n<p>  \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c: <\/p>\n<pre><code class=\"javascript\">                        var x = stars[j].x, \/\/ (x,y) - \u044d\u0442\u043e const1                               y = stars[j].y,                               dx = cx - stars[j].x,                                dy = cy - stars[j].y;                           if ( Math.abs(dx) &gt; Math.abs(dy) ){                               var xLife = dx &gt; 0 ? stars[j].life : - stars[j].life, \/\/ (xLife, yLife) - const2. \u0412\u043e\u043e\u0431\u0449\u0435 star.life \u044d\u0442\u043e \u0432\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c &quot;\u0436\u0438\u0437\u043d\u0438&quot; \u0437\u0432\u0435\u0437\u0434\u044b                                   yLife = xLife * dy \/ dx,                                   xCur = dx &gt; 0 ? - stars[j].currentLife :  stars[j].currentLife, \/\/ (xCur,yCur) -var1                                   yCur = xCur * dy \/ dx,                                   xLast = dx &gt; 0 ? xCur + stars[j].life : xCur - stars[j].life, \/\/ (xLast,yLast) - var2                                   yLast = xLast * dy \/ dx,                                   mod = &quot;x&quot;;                           } else {                               var yLife = dy &gt; 0 ? stars[j].life : - stars[j].life,                                   xLife = yLife * dx \/ dy,                                   yCur = dy &gt; 0 ? - stars[j].currentLife :  stars[j].currentLife,                                   xCur = yCur * dx \/ dy,                                   yLast = dy &gt; 0 ? yCur + stars[j].life : yCur - stars[j].life,                                   xLast = yLast * dx \/ dy,                                   mod = &quot;y&quot;;                           }                               if(dx &gt; 0 && dy &gt; 0)                           {                               var qx = x - ( xLife &lt; xLast ? xLife : xLast);                               var qy = y - ( yLife &lt; yLast ? yLife : yLast);                               ctx.moveTo( qx &lt; cx ? qx : cx, qy &lt; cy ? qy : cy);                               var sx = x - ( xCur &gt; 0 ? xCur : 0);                               var sy = y - ( yCur &gt; 0 ? yCur : 0);                               ctx.lineTo( sx &lt; cx ? sx : cx, sy &lt; cy ? sy : cy);                               if ( mod == &quot;x&quot;){                                   ctx.lineTo( qx &lt; cx ? qx : cx, (qy &lt; cy ? qy : cy) + 2);                               } else {                                   ctx.lineTo( (qx &lt; cx ? qx : cx) + 2, qy &lt; cy ? qy : cy);                               }                               ctx.lineTo( qx &lt; cx ? qx : cx, qy &lt; cy ? qy : cy);                               ctx.closePath();                               stars[j].nx = sx &lt; cx ? sx : cx;                               stars[j].ny = sy &lt; cy ? sy : cy;                           }                           if(dx &lt; 0 && dy &lt; 0)                           {                               var qx = x - ( xLife &gt; xLast ? xLife : xLast);                               var qy = y - ( yLife &gt; yLast ? yLife : yLast);                               ctx.moveTo( qx &gt; cx ? qx : cx, qy &gt; cy ? qy : cy);                               var sx = x - ( xCur &lt; 0 ? xCur : 0);                               var sy = y - ( yCur &lt; 0 ? yCur : 0);                               ctx.lineTo( sx &gt; cx ? sx : cx, sy &gt; cy ? sy : cy);                               if ( mod == &quot;x&quot; ){                                   ctx.lineTo( qx &gt; cx ? qx : cx, (qy &gt; cy ? qy : cy) + 2);                               } else {                                   ctx.lineTo( (qx &gt; cx ? qx : cx) + 2, qy &gt; cy ? qy : cy);                               }                               ctx.lineTo( qx &gt; cx ? qx : cx, qy &gt; cy ? qy : cy);                               ctx.closePath();                               stars[j].nx = sx &gt; cx ? sx : cx;                               stars[j].ny = sy &gt; cy ? sy : cy;                           }                           if(dx &lt; 0 && dy &gt; 0)                           {                               var qx = x - ( xLife &gt; xLast ? xLife : xLast);                               var qy = y - ( yLife &lt; yLast ? yLife : yLast);                               ctx.moveTo( qx &gt; cx ? qx : cx, qy &lt; cy ? qy : cy);                               var sx = x - ( xCur &lt; 0 ? xCur : 0);                               var sy = y - ( yCur &gt; 0 ? yCur : 0);                               ctx.lineTo( sx &gt; cx ? sx : cx, sy &lt; cy ? sy : cy);                               if ( mod == &quot;x&quot; ){                                   ctx.lineTo( qx &gt; cx ? qx : cx, (qy &lt; cy ? qy : cy) + 2);                               } else {                                   ctx.lineTo( (qx &gt; cx ? qx : cx) + 2, qy &lt; cy ? qy : cy);                               }                               ctx.lineTo( qx &gt; cx ? qx : cx, qy &lt; cy ? qy : cy);                               ctx.closePath();                               stars[j].nx = sx &gt; cx ? sx : cx;                               stars[j].ny = sy &lt; cy ? sy : cy;                           }                           if(dx &gt; 0 && dy &lt; 0)                           {                               var qx = x - ( xLife &lt; xLast ? xLife : xLast);                               var qy = y - ( yLife &gt; yLast ? yLife : yLast);                               ctx.moveTo( qx &lt; cx ? qx : cx, qy &gt; cy ? qy : cy);                               var sx = x - ( xCur &gt; 0 ? xCur : 0);                               var sy = y - ( yCur &lt; 0 ? yCur : 0);                               ctx.lineTo( sx &lt; cx ? sx : cx, sy &gt; cy ? sy : cy);                               if ( mod == &quot;x&quot; ){                                   ctx.lineTo( qx &lt; cx ? qx : cx, (qy &gt; cy ? qy : cy) + 2);                               } else {                                   ctx.lineTo( (qx &lt; cx ? qx : cx) + 2, qy &gt; cy ? qy : cy);                               }                               ctx.lineTo( qx &lt; cx ? qx : cx, qy &gt; cy ? qy : cy);                               ctx.closePath();                               stars[j].nx = sx &lt; cx ? sx : cx;                               stars[j].ny = sy &gt; cy ? sy : cy;                           }   <\/code><\/pre>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432 \u043a\u0430\u043a\u0443\u044e \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430\u0448\u0430 \u0437\u0432\u0435\u0437\u0434\u0430, \u0437\u043d\u0430\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c \u043a\u043e\u0434 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f 4 \u0440\u0430\u0437\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 mod \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u043a\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0435\u0434\u0443\u0449\u0435\u0439 ( \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c dx \u043a currentLife \u0438\u043b\u0438 dy). \u0411\u0435\u0437 mod-\u0430 \u0437\u0432\u0435\u0437\u0434\u044b \u0432 \u0431\u043b\u0438\u0437\u0438 \u043e\u0441\u0438 \u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0431\u0443\u0434\u0443\u0442 \u00ab\u043f\u0440\u043e\u043b\u0435\u0442\u0430\u0442\u044c\u00bb \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u044b\u0441\u0442\u0440\u043e, \u0438\u0437 \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0443\u0433\u043b\u0430. <\/p>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u2013 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0446\u0432\u0435\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043d\u0430 Canvas \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 (\u0442\u0430\u043a \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0434\u0432\u0430 \u0446\u0432\u0435\u0442\u0430). \u0412\u0441\u0435 \u0437\u0432\u0435\u0437\u0434\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 Canvas. <\/p>\n<p>  \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0446\u0438\u043a\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. <\/p>\n<h5>\u041f\u043e\u0434\u0445\u043e\u0434 3. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439.<\/h5>\n<p>  \u041f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0413\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0431\u0435\u0433\u043b\u043e\u043c \u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c libcanvas. \u0411\u043b\u0430\u0433\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440\u0435 \u043e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e. <\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430 <a href=\"http:\/\/jsfiddle.net\/agegorin\/UM3vR\/\">jsfiddle<\/a>. (JSFiddle \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c atom \u0438 libcanvas \u0441 github-\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443)<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<pre><code class=\"javascript\">    new function () {           var center, i, helper, stars;              LibCanvas.extract();                helper = new App.Light(new Size( document.width, document.height));                center = helper.app.rectangle.center;                stars = [];           for(i = 0; i &lt; 350; i++){               new function() {                   var point = new Point(getRandomInt(document.width\/2,document.width),document.height\/2),                       length = getRandomInt(50,150),                       angle = getRandomInt(0,360),                            coords = [                           new Point(0,0),                           new Point(0,0),                           new Point(0,0)                       ],                       path = helper.createVector( new Path()                               .moveTo( coords[0] )                               .lineTo( coords[1] )                               .lineTo( coords[2] )                               .lineTo( coords[0] )).setStyle({fill:&quot;rgb(150,150,150)&quot;,stroke:&quot;rgb(150,150,150)&quot;});                        point.rotate( - angle.degree(), center);                        var star = {                       point : point,                       length : length,                       angle : angle,                       coords : coords,                       live : 0,                       setLength : function(){                           if (arguments.length &gt; 0){                               this.live = arguments[0];                           }                           this.coords[0].x = this.point.x;                           this.coords[0].y = this.point.y;                           this.coords[1].x = this.coords[0].x + this.live * Math.cos( this.angle.degree() );                           this.coords[1].y = this.coords[0].y - this.live * Math.sin( this.angle.degree() );                           this.coords[2].x = this.coords[1].x + 2 * Math.sin( this.angle.degree() );                           this.coords[2].y = this.coords[1].y + 2 * Math.cos( this.angle.degree() );                       },                       path : path                   };                   star.setLength();                      stars.push(star);               };           }                setInterval(function(){               for(var i = 0; i &lt; 350; i++){                   stars[i].setLength( stars[i].live + 1 );                   stars[i].path.redraw();               }           },10);            };   <\/code><\/pre>\n<p>  \u041d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0431\u043e\u0435\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0441 \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0435\u0439, \u043d\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u043e \u0442\u043e\u0433\u043e \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 libCanvas \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0430 \u043a\u043e\u0434\u0430 \u0432 \u0440\u0430\u0437\u044b \u043c\u0435\u043d\u044c\u0448\u0435 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u044b\u0448\u0435. \u0421 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c libCanvas \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c: \u044f \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0438\u043c \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u044f \u043f\u0440\u0438\u0432\u044b\u043a \u043a \u0447\u0438\u0441\u0442\u043e\u043c\u0443 JavaScript \u0438 \u044f \u0431\u043e\u044f\u043b\u0441\u044f, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439. \u041a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u043e\u044f\u043b\u0441\u044f \u0437\u0440\u044f. <\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u0438 \u0435\u0449\u0435 \u0440\u0430\u0437 \u0441 \u0434\u043d\u0435\u043c \u043a\u043e\u0441\u043c\u043e\u043d\u0430\u0432\u0442\u0438\u043a\u0438! <\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438: <br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 \u043d\u0430 <a href=\"http:\/\/jsfiddle.net\/agegorin\/rK8Bx\/\">jsfiddle<\/a>. <br \/>  \u00ab\u0411\u043e\u0435\u0432\u043e\u0439\u00bb \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 <a href=\"http:\/\/jsfiddle.net\/agegorin\/sdMPZ\/\">jsfiddle<\/a>. <br \/>  <a href=\"https:\/\/github.com\/theshock\/atomjs\">AtomJS<\/a> \u0438 <a href=\"https:\/\/github.com\/theshock\/libcanvas\/\">libCanvas<\/a> \u0434\u043b\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. <br \/>  \u0422\u0440\u0435\u0442\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 libCanvas \u043d\u0430 <a href=\"http:\/\/jsfiddle.net\/agegorin\/UM3vR\/\">jsfiddle<\/a>. (\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b jsfiddle \u0438 github)<br \/>  <a href=\"http:\/\/iamastronaut.ru\/\">\u041f\u0440\u043e\u043c\u043e \u0441\u0430\u0439\u0442<\/a>, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/176325\/\"> http:\/\/habrahabr.ru\/post\/176325\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0425\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435! \u0421 \u0434\u043d\u0435\u043c \u043a\u043e\u0441\u043c\u043e\u043d\u0430\u0432\u0442\u0438\u043a\u0438!<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/4e7\/f83\/544\/4e7f83544bb315c1381e3a6d5edbbb5c.jpeg\"\/><\/p>\n<p>  \u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043f\u0440\u0438\u0443\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u043c \u043a \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u043c\u0443 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u0443 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u044e \u0433\u0438\u043f\u0435\u0440\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0430\u0437\u043c\u044b\u0441\u043b\u0438\u0432 \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Canvas \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 \u0434\u043b\u044f SVG \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u0430 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0440\u0435\u0434\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f, \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u043e\u043d, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0434\u043e\u043b\u0433\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. Canvas, \u043a \u0441\u043b\u043e\u0432\u0443, \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u043e\u043d \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435\u2026 <\/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-176325","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176325","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=176325"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176325\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}