{"id":328514,"date":"2022-01-24T15:00:59","date_gmt":"2022-01-24T15:00:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328514"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328514","title":{"rendered":"<span>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Art-pixel \u043d\u0430 Angular \u0438 Nest.js. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0433\u0430\u043b\u0435\u0440\u0435\u0435, \u043f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0443\u044e\u0441\u044f. \u0412\u043e\u043e\u0431\u0449\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u043e\u0433, \u0433\u0430\u043b\u0435\u0440\u0435\u044f \u0438 \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u043a\u0430\u044f. \u041c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c Angular \u0438 \u043f\u0440\u043e\u0431\u0443\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0442\u0438\u043b\u044c \u0438 \u043d\u0430\u0431\u0438\u0442\u044c \u0440\u0443\u043a\u0443.\u00a0\u00a0<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u0431\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0435\u0435 \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b, \u043d\u043e \u043c\u043e\u0451 \u043b\u0443\u0437\u0435\u0440\u0441\u0442\u0432\u043e \u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0430 \u0431\u044b\u0442\u044c \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c, \u043c\u0435\u043d\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043a\u0440\u0435\u043f\u043e\u0441\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u044f \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u043e\u0435. \u0410\u043c\u0431\u0438\u0446\u0438\u0439 \u043d\u0435\u0442, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0439\u0444 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0434\u0435\u043b\u0430\u044e, \u043b\u044e\u0431\u043b\u044e \u0441\u043e\u0437\u0435\u0440\u0446\u0430\u0442\u044c, \u043b\u044e\u0431\u043b\u044e \u0447\u0442\u043e \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c. \u0420\u0430\u0434 \u0431\u0443\u0434\u0443 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u043e\u043c\u0443 \u0442\u043e \u043f\u0440\u0438\u043d\u0435\u0441\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0443. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0441\u0435 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e \u0438 \u044f \u043d\u0430\u0439\u0434\u0443 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0438\u043b\u044b \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0410 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443 \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u0435\u043c\u043e \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Angular, CSS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0442\u00a0 <a href=\"https:\/\/www.w3schools.com\/css\/default.asp\" rel=\"noopener noreferrer nofollow\">w3schools<\/a><\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u043a\u043e\u0439.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"822\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c12\/7fb\/44c\/c127fb44cbb16cf1d3d829801951b82c.png\" data-width=\"1738\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/art-pixel.jdymora.com\/\" rel=\"noopener noreferrer nofollow\">Demo<\/a>, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/github.com\/Gdymora\/pixel-art\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>.<\/p>\n<p>\u0418\u0434\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0410\u043d\u0433\u0443\u043b\u0430\u0440. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. <\/p>\n<p>\u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0443\u043c\u0435\u0435\u0442\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0448\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u043a\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p><strong>ng g m canvas<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/main-canvas &#8212;module canvas.module<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/left-panel &#8212;module canvas.module<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/canvas &#8212;module canvas.module<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/form &#8212;module canvas.module<\/strong><\/p>\n<p>\u0413\u0434\u0435 <strong>main-canvas<\/strong> \u0443 \u043d\u0430\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 <strong>left-panel, canvas, form<\/strong>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c component main-canvas<\/p>\n<p>code main-canvas.component.html<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;title>W3.CSS Template&lt;\/title> &lt;meta charset=\"UTF-8\"> &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> &lt;link rel=\"stylesheet\" href=\"https:\/\/www.w3schools.com\/w3css\/4\/w3.css\"> &lt;link rel='stylesheet' href='https:\/\/fonts.googleapis.com\/css?family=Roboto'> &lt;link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/4.7.0\/css\/font-awesome.min.css\"> &lt;style>  html,  body,  h1,  h2,  h3,  h4,  h5,  h6 {    font-family: \"Roboto\", sans-serif  } &lt;\/style> &lt;div class=\"w3-bar w3-light-grey\">  &lt;h1 style=\"padding-left: 2rem;\">ARTpixel&lt;\/h1> &lt;\/div>   &lt;body class=\"w3-light-grey\">  &lt;!-- Page Container -->  &lt;div class=\"w3-content w3-margin-top\" style=\"max-width:1400px;\">    &lt;!-- The Grid -->    &lt;div class=\"w3-row-padding\">      &lt;!-- Right Column -->      &lt;!-- Left Column -->      &lt;app-left-panel (pagesEvent)=\"getDataPanel($event)\">&lt;\/app-left-panel>      &lt;!-- End Left Column -->      &lt;div class=\"w3-twothird\">        &lt;div class=\"w3-container w3-card w3-white w3-margin-bottom\">          &lt;h2 class=\"w3-text-grey w3-padding-16\">&lt;i              class=\"fa fa-paint-brush fa-fw w3-margin-right w3-xxlarge w3-text-teal\">&lt;\/i>\u041f\u043e\u043b\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f          &lt;\/h2>          &lt;div class=\"w3-container\">            &lt;app-canvas [uploadSuccess]=\"uploadSuccess\">&lt;\/app-canvas>            &lt;hr>          &lt;\/div>        &lt;\/div>        &lt;\/div>      &lt;!-- End Right Column -->    &lt;\/div>    &lt;!-- End Grid -->  &lt;\/div>    &lt;!-- End Page Container -->    &lt;footer class=\"w3-container w3-teal w3-center w3-margin-top\">    &lt;p>Find me on social media.&lt;\/p>    &lt;i class=\"fa fa-facebook-official w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-instagram w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-snapchat w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-pinterest-p w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-twitter w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-linkedin w3-hover-opacity\">&lt;\/i>    &lt;p>Powered by &lt;a href=\"https:\/\/www.w3schools.com\/w3css\/default.asp\" target=\"_blank\">w3.css&lt;\/a>&lt;\/p>  &lt;\/footer> &lt;\/body>   &lt;\/html> <\/code><\/pre>\n<p>code main-canvas.component.ts<\/p>\n<pre><code class=\"javascript\">import { Component, EventEmitter } from '@angular\/core'; import { FormGroup } from '@angular\/forms';   @Component({  selector: 'app-main-canvas',  templateUrl: '.\/main-canvas.component.html',  styleUrls: ['.\/main-canvas.component.scss'] }) export class MainCanvasComponent {  uploadSuccess: EventEmitter&lt;any> = new EventEmitter();\/\/\u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438    constructor() { }    getDataPanel($event: FormGroup) {    const data = {      widthRect: Number($event.value.widthCanvas),      heightRect: Number($event.value.heightCanvas),      numberOf: Number($event.value.hwPixel),      borderRow: $event.value.meshThickness,      numberRow: Number($event.value.hwPixel) + Number($event.value.meshThickness),      innerWidth: Number($event.value.heightCanvas) * (Number($event.value.hwPixel) + Number($event.value.meshThickness)),      innerHeight: Number($event.value.widthCanvas) * (Number($event.value.hwPixel) + Number($event.value.meshThickness)),      colorfillStyle: $event.value.colorFone    }      this.uploadSuccess.emit(data);\/\/\u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438  } } <\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0443 \u043d\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 left-panel \u00a0<\/p>\n<pre><code class=\"javascript\">&lt;app-left-panel (pagesEvent)=\"getDataPanel($event)\">&lt;\/app-left-panel><\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 form\u00a0 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 canvas <\/p>\n<pre><code class=\"xml\">&lt;app-canvas [uploadSuccess]=\"uploadSuccess\">&lt;\/app-canvas> <\/code><\/pre>\n<p>\u0433\u0434\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0430.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u00a0 left-panel\u00a0<\/p>\n<p><strong>left-panel.cpmponent.html<\/strong><\/p>\n<pre><code class=\"javascript\">&lt;div class=\"w3-third\">    &lt;div class=\"w3-white w3-text-grey w3-card-4\">        &lt;div class=\"w3-container\">            &lt;p class=\"w3-large\">&lt;b>&lt;i class=\"fa fa-asterisk fa-fw w3-margin-right w3-text-teal\">&lt;\/i>\u0424\u043e\u0440\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0445\u043e\u043b\u0441\u0442\u0430&lt;\/b>&lt;\/p>            &lt;div class=\"w3-light-grey w3-round-xlarge w3-small\">                &lt;app-form                (pagesEvent)=\"getData($event)\"                >&lt;\/app-form>            &lt;\/div>            &lt;hr>        &lt;\/div>    &lt;\/div>&lt;br> &lt;\/div> <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u00a0 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0444\u043e\u0440\u043c<\/p>\n<pre><code class=\"xml\">&lt;app-form(pagesEvent)=\"getData($event)\">&lt;\/app-form><\/code><\/pre>\n<p><strong>left-panel.component.ts<\/strong><\/p>\n<pre><code class=\"javascript\">import { Component, EventEmitter, Output } from '@angular\/core'; import { FormGroup } from '@angular\/forms';   @Component({  selector: 'app-left-panel',  templateUrl: '.\/left-panel.component.html',  styleUrls: ['.\/left-panel.component.scss'] }) export class LeftPanelComponent {    @Output() pagesEvent: EventEmitter&lt;FormGroup > =    new EventEmitter&lt; FormGroup >();  constructor() { }  getData($event: FormGroup) {    this.pagesEvent.emit($event);  } } <\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u0437\u0434\u0435\u0441\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <strong>getData()<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043a\u0430\u043d\u0432\u0430\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/p>\n<p>\u00a0\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 form.\u00a0\u00a0<\/p>\n<p><strong>form.component.html<\/strong><\/p>\n<pre><code class=\"xml\">&lt;form [formGroup]=\"form\" class=\"w3-container\">  &lt;p>    \u0425\u043e\u043b\u0441\u0442  &lt;\/p>  &lt;label>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"widthCanvas\" formControlName=\"widthCanvas\">    &lt;label>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"heightCanvas\" formControlName=\"heightCanvas\">  &lt;p>    Pixel  &lt;\/p>  &lt;label>\u0420\u0430\u0437\u043c\u0435\u0440 \u043f\u0438\u043a\u0441\u0435\u043b\u044f&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"hwPixel\" formControlName=\"hwPixel\">  &lt;label>\u0422\u043e\u043b\u0449\u0438\u043d\u0430 \u0441\u0435\u0442\u043a\u0438&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"meshThickness\" formControlName=\"meshThickness\">  &lt;label>\u0426\u0432\u0435\u0442 \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0445\u043e\u043b\u0441\u0442\u0430&lt;\/label>  &lt;input class=\"w3-input w3-border 0 input-color\" type=\"color\" name=\"colorFone\" formControlName=\"colorFone\">  &lt;hr>    &lt;div class=\"form-group\">    &lt;button class=\"w3-button w3-pale-red\" (click)=\"onCreate()\">      \u0421\u043e\u0437\u0434\u0430\u0442\u044c    &lt;\/button>  &lt;\/div>  &lt;div>    &lt;hr>  &lt;\/div>   &lt;\/form> <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>form.component.ts<\/strong><\/p>\n<pre><code class=\"javascript\">import { Component, EventEmitter, OnInit, Output } from '@angular\/core'; import { FormControl, FormGroup, Validators } from '@angular\/forms';   @Component({  selector: 'app-form',  templateUrl: '.\/form.component.html',  styleUrls: ['.\/form.component.scss'] }) export class FormComponent implements OnInit {    @Output() pagesEvent: EventEmitter&lt;FormGroup> = new EventEmitter&lt;FormGroup>();  constructor() { }    form: FormGroup = new FormGroup(    {      \"heightCanvas\": new FormControl(\"24\", Validators.required),      \"widthCanvas\": new FormControl(\"24\", Validators.pattern(\"[0-9]{10}\")),      \"hwPixel\": new FormControl(\"10\", Validators.required),      \"meshThickness\": new FormControl(\"1\", Validators.pattern(\"[0-9]{10}\")),      \"colorFone\": new FormControl(\"green\"),    }  );     onCreate(): void {    this.pagesEvent.emit(this.form);  } }   <\/code><\/pre>\n<p>\u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u044f\u0434\u0440\u0430 canvas.component<\/p>\n<p><strong>canvas.component.html<\/strong><\/p>\n<pre><code class=\"xml\">&lt;div class=\"w3-card-4\">  &lt;div class=\"w3-container w3-center\">    &lt;label for=\"colorWell\">&lt;\/label>    &lt;input list=\"\" id=\"colorWell\" type=\"color\" name=\"colorRect\" [(ngModel)]=\"colorRect\">    &lt;button (click)=\"create()\">\u0412\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0438\u0441\u0443\u043d\u043e\u043a&lt;\/button>    &lt;button (click)=\"clearPixel()\">\u0417\u0430\u0434\u0430\u0442\u044c \u043f\u0438\u043a\u0441\u0435\u043b\u044e \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430&lt;\/button>    &lt;\/div> &lt;\/div> &lt;div class=\"w3-card-4 layer\">  &lt;div class=\"w3-container w3-center\">    &lt;canvas id=\"canvas\" #canvas>&lt;\/canvas>  &lt;\/div> &lt;\/div> <\/code><\/pre>\n<p><strong>canvas.component.ts<\/strong><\/p>\n<pre><code class=\"javascript\">import { AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Renderer2, ViewChild } from '@angular\/core'; import { FormGroup } from '@angular\/forms';   @Component({  selector: 'app-canvas',  templateUrl: '.\/canvas.component.html',  styleUrls: ['.\/canvas.component.scss'] }) export class CanvasComponent implements AfterViewInit, OnInit {  canvas: HTMLCanvasElement;  innerWidth: number;  innerHeight: number;  rendererRef: any;  numberRow: number;  numberOf = 10;  borderRow = 1;  widthRect = 50;  heightRect = 50;  x = 0;  y = 0  canvasX: number \/\/ X click cordinates  canvasY: number \/\/ Y click cordinates  colorRect = '#242323';\/\/\u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u043a\u0438  colorfillStyle = '#19a923';\/\/\u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0445\u043e\u043b\u0441\u0442\u0430  matr = { numberOf: 10, backgroundColor: '#19a923', data: [{ x: 0, y: 0, color: '' }] }    private ctx: CanvasRenderingContext2D | null;  @ViewChild('canvas') canvasRef: ElementRef;    constructor(private el: ElementRef,    private renderer: Renderer2,  ) {    this.numberRow = this.numberOf + this.borderRow;    this.innerWidth = this.heightRect * this.numberRow;    this.innerHeight = this.widthRect * this.numberRow;  }    onResize(data: any) {    this.innerWidth = data.innerWidth;    this.innerHeight = data.innerHeight;    this.widthRect = data.widthRect;    this.heightRect = data.heightRect;    this.numberOf = data.numberOf;    this.borderRow = data.borderRow;    this.numberRow = data.numberRow;    this.canvas.width = this.innerWidth;    this.canvas.height = this.innerHeight    this.colorfillStyle = data.colorfillStyle;    this.cleardraw()    this.draw()  } @Input() uploadSuccess: EventEmitter&lt;FormGroup>;    ngOnInit(): void {    this.uploadSuccess.subscribe(data => {      this.onResize(data);    });  }  ngAfterViewInit(): void {    this.canvas = this.canvasRef.nativeElement;    this.canvas.width = this.innerWidth;    this.canvas.height = this.innerHeight;    let image = document.getElementById('source');    this.cleardraw()    this.draw();    const data = this.canvas?.toDataURL();      if (this.rendererRef != null) {      this.rendererRef();    }      this.rendererRef = this.renderer.listen(this.canvasRef.nativeElement, 'click', (event) => {      let cX = event.layerX;      let cY = event.layerY;      const offsetLeft = this.canvasRef.nativeElement.offsetLeft;      const offsetTop = this.canvasRef.nativeElement.offsetTop;      this.canvasX = cX - offsetLeft;      this.canvasY = cY - offsetTop;      this.matr.data.map(data => {        if (cX >= data.x &amp;&amp; cX &lt; data.x + this.numberOf &amp;&amp; cY >= data.y &amp;&amp; cY &lt; data.y + this.numberOf) {          this.ctx.fillStyle = this.colorRect;          this.ctx.fillRect(data.x, data.y, this.numberOf, this.numberOf);          data.color = this.colorRect;        }      })      localStorage.setItem('matr', JSON.stringify(this.matr));      const data = this.canvas?.toDataURL();    })  }    draw(): void {    this.matr.backgroundColor = this.colorfillStyle;    this.matr.numberOf = this.numberOf;    for (let i = 0; i &lt; this.heightRect; i++) {      for (let j = 0; j &lt; this.widthRect; j++) {        this.ctx.fillStyle = this.colorfillStyle;        this.ctx.fillRect(j * this.numberRow, i * this.numberRow, this.numberOf, this.numberOf);        this.matr.data.push({ x: j * this.numberRow, y: i * this.numberRow, color: this.colorfillStyle })      }    }    }    cleardraw(): void {    this.ctx = this.canvas.getContext('2d');    this.ctx.clearRect(0, 0, this.widthRect, this.heightRect);    this.matr.data = [];  }    create(): void {    const retrievedObject = localStorage.getItem('matr');    this.matr = JSON.parse(retrievedObject);    this.matr.data.map(data => {      this.ctx.fillStyle = data.color;      this.ctx.fillRect(data.x, data.y, this.matr.numberOf, this.matr.numberOf);    })  }    clearPixel(): void {    this.colorRect = this.matr.backgroundColor  } } <\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<p>onResize(data: any), draw(), cleardraw(), create(), clearPixel()<\/p>\n<p><strong>onResize(data: any)<\/strong> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430 ngOnInit, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0444\u043e\u0440\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0445\u043e\u043b\u0441\u0442\u0430.<\/p>\n<p><strong>cleardraw()<\/strong>:  \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435 \u043a \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0435<\/p>\n<p><strong>draw()<\/strong>: \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0445\u043e\u043b\u0441\u0442<\/p>\n<p><strong>create()<\/strong>: \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u0443\u043d\u043e\u043a \u0438\u0437 localStorage<\/p>\n<p><strong>clearPixel()<\/strong>: \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0446\u0432\u0435\u0442 \u043a\u0438\u0441\u0442\u0438 \u0440\u0430\u0432\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u0443 \u0445\u043e\u043b\u0441\u0442\u0430<\/p>\n<p><strong>ngOnInit<\/strong>: \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c Angular \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0418 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<p><strong>ngAfterViewInit<\/strong>: \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c Angular \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043a\u043b\u0438\u043a\u0430 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044d\u0442\u043e \u0432\u0441\u0435, \u0438\u0434\u0443 \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/647411\/\"> https:\/\/habr.com\/ru\/post\/647411\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0433\u0430\u043b\u0435\u0440\u0435\u0435, \u043f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0443\u044e\u0441\u044f. \u0412\u043e\u043e\u0431\u0449\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u043e\u0433, \u0433\u0430\u043b\u0435\u0440\u0435\u044f \u0438 \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u043a\u0430\u044f. \u041c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c Angular \u0438 \u043f\u0440\u043e\u0431\u0443\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0442\u0438\u043b\u044c \u0438 \u043d\u0430\u0431\u0438\u0442\u044c \u0440\u0443\u043a\u0443.\u00a0\u00a0<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u0431\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0435\u0435 \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b, \u043d\u043e \u043c\u043e\u0451 \u043b\u0443\u0437\u0435\u0440\u0441\u0442\u0432\u043e \u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0430 \u0431\u044b\u0442\u044c \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c, \u043c\u0435\u043d\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043a\u0440\u0435\u043f\u043e\u0441\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u044f \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u043e\u0435. \u0410\u043c\u0431\u0438\u0446\u0438\u0439 \u043d\u0435\u0442, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0439\u0444 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0434\u0435\u043b\u0430\u044e, \u043b\u044e\u0431\u043b\u044e \u0441\u043e\u0437\u0435\u0440\u0446\u0430\u0442\u044c, \u043b\u044e\u0431\u043b\u044e \u0447\u0442\u043e \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c. \u0420\u0430\u0434 \u0431\u0443\u0434\u0443 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u043e\u043c\u0443 \u0442\u043e \u043f\u0440\u0438\u043d\u0435\u0441\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0443. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0441\u0435 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e \u0438 \u044f \u043d\u0430\u0439\u0434\u0443 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0438\u043b\u044b \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0410 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443 \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u0435\u043c\u043e \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Angular, CSS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0442\u00a0 <a href=\"https:\/\/www.w3schools.com\/css\/default.asp\" rel=\"noopener noreferrer nofollow\">w3schools<\/a><\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u043a\u043e\u0439.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/art-pixel.jdymora.com\/\" rel=\"noopener noreferrer nofollow\">Demo<\/a>, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/github.com\/Gdymora\/pixel-art\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>.<\/p>\n<p>\u0418\u0434\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0410\u043d\u0433\u0443\u043b\u0430\u0440. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. <\/p>\n<p>\u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0443\u043c\u0435\u0435\u0442\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0448\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u043a\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p><strong>ng g m canvas<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/main-canvas &#8212;module canvas.module<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/left-panel &#8212;module canvas.module<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/canvas &#8212;module canvas.module<\/strong><\/p>\n<p><strong>ng g c canvas\/components\/form &#8212;module canvas.module<\/strong><\/p>\n<p>\u0413\u0434\u0435 <strong>main-canvas<\/strong> \u0443 \u043d\u0430\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 <strong>left-panel, canvas, form<\/strong>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c component main-canvas<\/p>\n<p>code main-canvas.component.html<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;title>W3.CSS Template&lt;\/title> &lt;meta charset=\"UTF-8\"> &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> &lt;link rel=\"stylesheet\" href=\"https:\/\/www.w3schools.com\/w3css\/4\/w3.css\"> &lt;link rel='stylesheet' href='https:\/\/fonts.googleapis.com\/css?family=Roboto'> &lt;link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/4.7.0\/css\/font-awesome.min.css\"> &lt;style>  html,  body,  h1,  h2,  h3,  h4,  h5,  h6 {    font-family: \"Roboto\", sans-serif  } &lt;\/style> &lt;div class=\"w3-bar w3-light-grey\">  &lt;h1 style=\"padding-left: 2rem;\">ARTpixel&lt;\/h1> &lt;\/div>   &lt;body class=\"w3-light-grey\">  &lt;!-- Page Container -->  &lt;div class=\"w3-content w3-margin-top\" style=\"max-width:1400px;\">    &lt;!-- The Grid -->    &lt;div class=\"w3-row-padding\">      &lt;!-- Right Column -->      &lt;!-- Left Column -->      &lt;app-left-panel (pagesEvent)=\"getDataPanel($event)\">&lt;\/app-left-panel>      &lt;!-- End Left Column -->      &lt;div class=\"w3-twothird\">        &lt;div class=\"w3-container w3-card w3-white w3-margin-bottom\">          &lt;h2 class=\"w3-text-grey w3-padding-16\">&lt;i              class=\"fa fa-paint-brush fa-fw w3-margin-right w3-xxlarge w3-text-teal\">&lt;\/i>\u041f\u043e\u043b\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f          &lt;\/h2>          &lt;div class=\"w3-container\">            &lt;app-canvas [uploadSuccess]=\"uploadSuccess\">&lt;\/app-canvas>            &lt;hr>          &lt;\/div>        &lt;\/div>        &lt;\/div>      &lt;!-- End Right Column -->    &lt;\/div>    &lt;!-- End Grid -->  &lt;\/div>    &lt;!-- End Page Container -->    &lt;footer class=\"w3-container w3-teal w3-center w3-margin-top\">    &lt;p>Find me on social media.&lt;\/p>    &lt;i class=\"fa fa-facebook-official w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-instagram w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-snapchat w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-pinterest-p w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-twitter w3-hover-opacity\">&lt;\/i>    &lt;i class=\"fa fa-linkedin w3-hover-opacity\">&lt;\/i>    &lt;p>Powered by &lt;a href=\"https:\/\/www.w3schools.com\/w3css\/default.asp\" target=\"_blank\">w3.css&lt;\/a>&lt;\/p>  &lt;\/footer> &lt;\/body>   &lt;\/html> <\/code><\/pre>\n<p>code main-canvas.component.ts<\/p>\n<pre><code class=\"javascript\">import { Component, EventEmitter } from '@angular\/core'; import { FormGroup } from '@angular\/forms';   @Component({  selector: 'app-main-canvas',  templateUrl: '.\/main-canvas.component.html',  styleUrls: ['.\/main-canvas.component.scss'] }) export class MainCanvasComponent {  uploadSuccess: EventEmitter&lt;any> = new EventEmitter();\/\/\u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438    constructor() { }    getDataPanel($event: FormGroup) {    const data = {      widthRect: Number($event.value.widthCanvas),      heightRect: Number($event.value.heightCanvas),      numberOf: Number($event.value.hwPixel),      borderRow: $event.value.meshThickness,      numberRow: Number($event.value.hwPixel) + Number($event.value.meshThickness),      innerWidth: Number($event.value.heightCanvas) * (Number($event.value.hwPixel) + Number($event.value.meshThickness)),      innerHeight: Number($event.value.widthCanvas) * (Number($event.value.hwPixel) + Number($event.value.meshThickness)),      colorfillStyle: $event.value.colorFone    }      this.uploadSuccess.emit(data);\/\/\u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438  } } <\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0443 \u043d\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 left-panel \u00a0<\/p>\n<pre><code class=\"javascript\">&lt;app-left-panel (pagesEvent)=\"getDataPanel($event)\">&lt;\/app-left-panel><\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 form\u00a0 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 canvas <\/p>\n<pre><code class=\"xml\">&lt;app-canvas [uploadSuccess]=\"uploadSuccess\">&lt;\/app-canvas> <\/code><\/pre>\n<p>\u0433\u0434\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0430.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u00a0 left-panel\u00a0<\/p>\n<p><strong>left-panel.cpmponent.html<\/strong><\/p>\n<pre><code class=\"javascript\">&lt;div class=\"w3-third\">    &lt;div class=\"w3-white w3-text-grey w3-card-4\">        &lt;div class=\"w3-container\">            &lt;p class=\"w3-large\">&lt;b>&lt;i class=\"fa fa-asterisk fa-fw w3-margin-right w3-text-teal\">&lt;\/i>\u0424\u043e\u0440\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0445\u043e\u043b\u0441\u0442\u0430&lt;\/b>&lt;\/p>            &lt;div class=\"w3-light-grey w3-round-xlarge w3-small\">                &lt;app-form                (pagesEvent)=\"getData($event)\"                >&lt;\/app-form>            &lt;\/div>            &lt;hr>        &lt;\/div>    &lt;\/div>&lt;br> &lt;\/div> <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u00a0 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0444\u043e\u0440\u043c<\/p>\n<pre><code class=\"xml\">&lt;app-form(pagesEvent)=\"getData($event)\">&lt;\/app-form><\/code><\/pre>\n<p><strong>left-panel.component.ts<\/strong><\/p>\n<pre><code class=\"javascript\">import { Component, EventEmitter, Output } from '@angular\/core'; import { FormGroup } from '@angular\/forms';   @Component({  selector: 'app-left-panel',  templateUrl: '.\/left-panel.component.html',  styleUrls: ['.\/left-panel.component.scss'] }) export class LeftPanelComponent {    @Output() pagesEvent: EventEmitter&lt;FormGroup > =    new EventEmitter&lt; FormGroup >();  constructor() { }  getData($event: FormGroup) {    this.pagesEvent.emit($event);  } } <\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u0437\u0434\u0435\u0441\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <strong>getData()<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043a\u0430\u043d\u0432\u0430\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/p>\n<p>\u00a0\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 form.\u00a0\u00a0<\/p>\n<p><strong>form.component.html<\/strong><\/p>\n<pre><code class=\"xml\">&lt;form [formGroup]=\"form\" class=\"w3-container\">  &lt;p>    \u0425\u043e\u043b\u0441\u0442  &lt;\/p>  &lt;label>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"widthCanvas\" formControlName=\"widthCanvas\">    &lt;label>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"heightCanvas\" formControlName=\"heightCanvas\">  &lt;p>    Pixel  &lt;\/p>  &lt;label>\u0420\u0430\u0437\u043c\u0435\u0440 \u043f\u0438\u043a\u0441\u0435\u043b\u044f&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"hwPixel\" formControlName=\"hwPixel\">  &lt;label>\u0422\u043e\u043b\u0449\u0438\u043d\u0430 \u0441\u0435\u0442\u043a\u0438&lt;\/label>  &lt;input class=\"w3-input\" type=\"number\" name=\"meshThickness\" formControlName=\"meshThickness\">  &lt;label>\u0426\u0432\u0435\u0442 \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0445\u043e\u043b\u0441\u0442\u0430&lt;\/label>  &lt;input class=\"w3-input w3-border 0 input-color\" type=\"color\" name=\"colorFone\" formControlName=\"colorFone\">  &lt;hr>    &lt;div class=\"form-group\">    &lt;button class=\"w3-button w3-pale-red\" (click)=\"onCreate()\">      \u0421\u043e\u0437\u0434\u0430\u0442\u044c    &lt;\/button>  &lt;\/div>  &lt;div>    &lt;hr>  &lt;\/div>   &lt;\/form> <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>form.component.ts<\/strong><\/p>\n<pre><code class=\"javascript\">import { Component, EventEmitter, OnInit, Output } from '@angular\/core'; import { FormControl, FormGroup, Validators } from '@angular\/forms';   @Component({  selector: 'app-form',  templateUrl: '.\/form.component.html',  styleUrls: ['.\/form.component.scss'] }) export class FormComponent implements OnInit {    @Output() pagesEvent: EventEmitter&lt;FormGroup> = new EventEmitter&lt;FormGroup>();  constructor() { }    form: FormGroup = new FormGroup(    {      \"heightCanvas\": new FormControl(\"24\", Validators.required),      \"widthCanvas\": new FormControl(\"24\", Validators.pattern(\"[0-9]{10}\")),      \"hwPixel\": new FormControl(\"10\", Validators.required),      \"meshThickness\": new FormControl(\"1\", Validators.pattern(\"[0-9]{10}\")),      \"colorFone\": new FormControl(\"green\"),    }  );     onCreate(): void {    this.pagesEvent.emit(this.form);  } }   <\/code><\/pre>\n<p>\u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u044f\u0434\u0440\u0430 canvas.component<\/p>\n<p><strong>canvas.component.html<\/strong><\/p>\n<pre><code class=\"xml\">&lt;div class=\"w3-card-4\">  &lt;div class=\"w3-container w3-center\">    &lt;label for=\"colorWell\">&lt;\/label>    &lt;input list=\"\" id=\"colorWell\" type=\"color\" name=\"colorRect\" [(ngModel)]=\"colorRect\">    &lt;button (click)=\"create()\">\u0412\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0438\u0441\u0443\u043d\u043e\u043a&lt;\/button>    &lt;button (click)=\"clearPixel()\">\u0417\u0430\u0434\u0430\u0442\u044c \u043f\u0438\u043a\u0441\u0435\u043b\u044e \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430&lt;\/button>    &lt;\/div> &lt;\/div> &lt;div class=\"w3-card-4 layer\">  &lt;div class=\"w3-container w3-center\">    &lt;canvas id=\"canvas\" #canvas>&lt;\/canvas>  &lt;\/div> &lt;\/div> <\/code><\/pre>\n<p><strong>canvas.component.ts<\/strong><\/p>\n<pre><code class=\"javascript\">import { AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Renderer2, ViewChild } from '@angular\/core'; import { FormGroup } from '@angular\/forms';   @Component({  selector: 'app-canvas',  templateUrl: '.\/canvas.component.html',  styleUrls: ['.\/canvas.component.scss'] }) export class CanvasComponent implements AfterViewInit, OnInit {  canvas: HTMLCanvasElement;  innerWidth: number;  innerHeight: number;  rendererRef: any;  numberRow: number;  numberOf = 10;  borderRow = 1;  widthRect = 50;  heightRect = 50;  x = 0;  y = 0  canvasX: number \/\/ X click cordinates  canvasY: number \/\/ Y click cordinates  colorRect = '#242323';\/\/\u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u043a\u0438  colorfillStyle = '#19a923';\/\/\u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0445\u043e\u043b\u0441\u0442\u0430  matr = { numberOf: 10, backgroundColor: '#19a923', data: [{ x: 0, y: 0, color: '' }] }    private ctx: CanvasRenderingContext2D | null;  @ViewChild('canvas') canvasRef: ElementRef;    constructor(private el: ElementRef,    private renderer: Renderer2,  ) {    this.numberRow = this.numberOf + this.borderRow;    this.innerWidth = this.heightRect * this.numberRow;    this.innerHeight =<\/code><\/pre>\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-328514","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328514","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=328514"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328514\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}