{"id":1160,"date":"2020-02-08T23:28:57","date_gmt":"2020-02-08T14:28:57","guid":{"rendered":"https:\/\/www.dogrow.net\/hp\/?p=1160"},"modified":"2020-02-17T02:24:06","modified_gmt":"2020-02-16T17:24:06","slug":"blog82","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/hp\/blog82\/","title":{"rendered":"(82) \u3010SVG\u753b\u50cf\u3011WEB\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3055\u305b\u308b\u3002(JavaScript\u7de8#1 Snap.svg)"},"content":{"rendered":"<h1 class=\"my_h\">1. \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u904e\u53bb\u306e\u6295\u7a3f\u3067\u306f CSS\u3092\u5229\u7528\u3057\u305f\u30d9\u30af\u30bf\u753b\u50cf\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002<\/p>\n<p>\u3067\u3082&#8230;<br \/>\n<span class=\"my_fc_crimsonB\">CSS\u306b\u3088\u308b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u30d9\u30af\u30bf\u753b\u50cf\u306e\u9802\u70b9\u60c5\u5831\u3092\u6642\u9593\u5909\u5316\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u305a<br \/>\n\u30d9\u30af\u30bf\u753b\u50cf\u3092\u3050\u306b\u3083\u3050\u306b\u3083\u3068\u5909\u5f62\u3055\u305b\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u304b\u3063\u305f\u3002<\/span><br \/>\n<span class=\"my_fc_gray\">\u81ea\u5206\u304c\u77e5\u3089\u306a\u3044\u3060\u3051\u306e\u53ef\u80fd\u6027\u3082\u3042\u308b\u304c&#8230;<\/span><\/p>\n<p>\u305d\u3053\u3067\u4eca\u56de\u306f&#8230;<br \/>\n<span class=\"my_fc_deeppinkBBig\">JavaScript\u3092\u4f7f\u7528\u3057\u3066 SVG\u306e\u5c5e\u6027\u3092\u6642\u9593\u5909\u5316\u3055\u305b\u305f\u3044\u3002<br \/>\n\u3059\u306a\u308f\u3061&#8230;<br \/>\n\u30d9\u30af\u30bf\u753b\u50cf\u306e\u9802\u70b9\u60c5\u5831\u3092\u6642\u9593\u5909\u5316\u3055\u305b\u3066\u56f3\u5f62\u3092\u3050\u306b\u3083\u3050\u306b\u3083\u3068\u52d5\u304b\u3057\u305f\u3044\uff01<\/span><\/p>\n<h3 class=\"my_h\">(1) \u5b9f\u73fe\u624b\u6bb5<\/h3>\n<p>\u4eca\u56de\u306f <span class=\"my_fc_deeppinkBBig\">Snap.svg<\/span> \u3092\u5229\u7528\u3055\u305b\u3066\u3044\u305f\u3060\u304f\u3002Snap.svg\u306f Photoshop\u3067\u6709\u540d\u306a\u3042\u306e Adobe\u793e\u304c 2013\u5e74\u306b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u516c\u958b\u3057\u3066\u304f\u308c\u305f\u30d5\u30ea\u30fc\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3060\u3002<br \/>\n<a href=\"http:\/\/snapsvg.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/snapsvg.io\/<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/hp\/wp-content\/uploads\/2020\/02\/001.png\" alt=\"\" class=\"my_add_bs1\" \/><\/a><\/p>\n<h3 class=\"my_h\">(2) \u304a\u984c<\/h3>\n<p>\u904e\u53bb\u6295\u7a3f <a href=\"https:\/\/www.dogrow.net\/hp\/blog79\/\" target=\"_blank\" rel=\"noopener noreferrer\">(79) \u3010SVG\u753b\u50cf\u3011WEB\u30d6\u30e9\u30a6\u30b6\u306bSVG\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u3002<\/a> \u3067\u4f5c\u6210\u3057\u305f\u661f\u5f62\u30d9\u30af\u30bf\u753b\u50cf\u306e\u9802\u70b9\u3092\u52d5\u304b\u3057\u3001\u2605\u3092\u6b6a\u307e\u305b\u305f\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/hp\/sample\/00082\/svgimg1.svg\" style=\"width:50%\"><\/p>\n<h1 class=\"my_h\">2. \u3084\u3063\u3066\u307f\u308b<\/h1>\n<h3 class=\"my_h\">\u3010Step 1\u3011polygon\u30bf\u30b0\u306e points\u5c5e\u6027\u306e\u5024\u3092\u6642\u9593\u5909\u5316\u3055\u305b\u308b\u3002<\/h3>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=&quot;ja&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;00082 demo1&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;svg id=&quot;star-svg&quot; xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; viewBox=&quot;0 0 188.43 180.82&quot;&gt;\r\n    &lt;defs&gt;\r\n        &lt;style&gt;\r\n            .cls-1{\r\n                fill:#efea3a;\r\n                stroke:#231815;\r\n                stroke-miterlimit:10;\r\n                stroke-width:6px;\r\n            }\r\n        &lt;\/style&gt;\r\n    &lt;\/defs&gt;\r\n    &lt;title&gt;return\u30a2\u30bb\u30c3\u30c8 1&lt;\/title&gt;\r\n    &lt;g id=&quot;\u30ec\u30a4\u30e4\u30fc_2&quot; data-name=&quot;\u30ec\u30a4\u30e4\u30fc 2&quot;&gt;\r\n        &lt;g id=&quot;\u30ec\u30a4\u30e4\u30fc_1-2&quot; data-name=&quot;\u30ec\u30a4\u30e4\u30fc 1&quot;&gt;\r\n            &lt;polygon id=&quot;star_poly&quot; class=&quot;cls-1&quot; points=&quot;151.38 172.22 96.34 145.21 42.89 175.23 51.57 114.54 6.5 72.98 66.91 62.48 92.5 6.78 121.15 60.98 182.04 68.11 139.34 112.11 151.38 172.22&quot;\/&gt;\r\n        &lt;\/g&gt;\r\n    &lt;\/g&gt;\r\n&lt;\/svg&gt;\r\n\r\n&lt;script src=&quot;.\/snap.svg-min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\nsvg = Snap('#star-svg');\r\npoly = svg.select('#star_poly');\r\nstartPts = &quot;151.38 172.22 96.34 145.21 42.89 175.23 51.57 114.54  6.5 72.98 66.91 62.48 92.5 6.78 121.15 60.98 182.04 68.11 139.34 112.11 151.38 172.22&quot;;\r\nendPts   = &quot;151.38 172.22 96.34 145.21 42.89 175.23 51.57 124.54 26.5 72.98 66.91 62.48 92.5 6.78 121.15 60.98 162.04 75.11 119.34 100.11 151.38 172.22&quot;;\r\nfunction anim(){\r\n  poly.animate({'points':endPts}, 1000, function(){\r\n    this.animate({'points':startPts}, 1000, function(){\r\n      anim();\r\n    });\r\n  });\r\n};\r\nanim();\r\n&lt;\/script&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><iframe src=\"https:\/\/www.dogrow.net\/hp\/sample\/00082\/demo1.html\" style=\"width:100%;height:800px;\" scrolling=\"no\"><\/iframe><\/p>\n<p><span class=\"my_fc_deeppinkBBig\">\u2605\u89e3\u8aac\u2605<\/span><\/p>\n<p>\u3053\u306e svg\u30bf\u30b0\u3067\u306f\u30d9\u30af\u30bf\u753b\u50cf\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u3002<br \/>\n\u904e\u53bb\u6295\u7a3f <a href=\"https:\/\/www.dogrow.net\/hp\/blog79\/\" target=\"_blank\" rel=\"noopener noreferrer\">(79) \u3010SVG\u753b\u50cf\u3011WEB\u30d6\u30e9\u30a6\u30b6\u306bSVG\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u3002<\/a> \u3067\u4f5c\u6210\u3057\u305f\u661f\u5f62\u753b\u50cf\u3060\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; title: ; notranslate\" title=\"\">\r\n&lt;svg id=&quot;star-svg&quot; xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; viewBox=&quot;0 0 188.43 180.82&quot;&gt;\r\n    &lt;defs&gt;\r\n        &lt;style&gt;\r\n            .cls-1{\r\n                fill:#efea3a;\r\n                stroke:#231815;\r\n                stroke-miterlimit:10;\r\n                stroke-width:6px;\r\n            }\r\n        &lt;\/style&gt;\r\n    &lt;\/defs&gt;\r\n    &lt;title&gt;return\u30a2\u30bb\u30c3\u30c8 1&lt;\/title&gt;\r\n    &lt;g id=&quot;\u30ec\u30a4\u30e4\u30fc_2&quot; data-name=&quot;\u30ec\u30a4\u30e4\u30fc 2&quot;&gt;\r\n        &lt;g id=&quot;\u30ec\u30a4\u30e4\u30fc_1-2&quot; data-name=&quot;\u30ec\u30a4\u30e4\u30fc 1&quot;&gt;\r\n            &lt;polygon id=&quot;star_poly&quot; class=&quot;cls-1&quot; points=&quot;151.38 172.22 96.34 145.21 42.89 175.23 51.57 114.54 6.5 72.98 66.91 62.48 92.5 6.78 121.15 60.98 182.04 68.11 139.34 112.11 151.38 172.22&quot;\/&gt;\r\n        &lt;\/g&gt;\r\n    &lt;\/g&gt;\r\n&lt;\/svg&gt;\r\n<\/pre>\n<p>\u3053\u3053\u3067\u306f Snap.svg \u306e JavaScript\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 28; title: ; notranslate\" title=\"\">\r\n&lt;script src=&quot;.\/snap.svg-min.js&quot;&gt;&lt;\/script&gt;\r\n<\/pre>\n<p>\u3053\u3053\u3067\u306f\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u3002<br \/>\n\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u958b\u59cb\u6642\u3068\u7d42\u4e86\u6642\u306e 2\u30bb\u30c3\u30c8\u306e point\u5c5e\u6027\u5024\uff08\uff1d\u9802\u70b9\u5ea7\u6a19\u60c5\u5831\u914d\u5217\uff09\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u3002<br \/>\npolygon\u3092\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u5bfe\u8c61\u3068\u3057\u3066\u30011000[ms]\u3067\u9806\u65b9\u5411\u30011000[ms]\u3067\u9006\u65b9\u5411\u306b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3055\u305b\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 27; title: ; notranslate\" title=\"\">\r\n&lt;script&gt;\r\nsvg = Snap('#star-svg');\r\npoly = svg.select('#star_poly');\r\nstartPts = &quot;151.38 172.22 96.34 145.21 42.89 175.23 51.57 114.54  6.5 72.98 66.91 62.48 92.5 6.78 121.15 60.98 182.04 68.11 139.34 112.11 151.38 172.22&quot;;\r\nendPts   = &quot;151.38 172.22 96.34 145.21 42.89 175.23 51.57 124.54 26.5 72.98 66.91 62.48 92.5 6.78 121.15 60.98 162.04 75.11 119.34 100.11 151.38 172.22&quot;;\r\nfunction anim(){\r\n  poly.animate({'points':endPts}, 1000, function(){\r\n    this.animate({'points':startPts}, 1000, function(){\r\n      anim();\r\n    });\r\n  });\r\n};\r\nanim();\r\n&lt;\/script&gt;\r\n<\/pre>\n<p><span class=\"my_fc_crimsonBBig\">\u2605\u6ce8\u610f\u70b9\u2605<\/span><\/p>\n<p>\u30fb\u52d5\u4f5c\u524d\u3001\u52d5\u4f5c\u5f8c\u306e points\u306e\u8981\u7d20\u6570\u3092\u540c\u3058\u306b\u3059\u308b\u3053\u3068\u3002<\/p>\n<h1 class=\"my_h\">3. \u6240\u611f<\/h1>\n<p>\u30fb<span class=\"my_fc_crimsonB\">CSS\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u30b9\u30bf\u30a4\u30eb\u3067\u5b9a\u7fa9\u3067\u304d\u308b\u3082\u306e\u3057\u304b\u52d5\u304b\u305b\u306a\u304b\u3063\u305f\u3002<\/span><\/p>\n<p>\u30fb<span class=\"my_fc_deeppinkBBig\">JavaScript\u3092\u4f7f\u3048\u3070\u3001\u30bf\u30b0\u306e\u5c5e\u6027\u306e\u5024\u3092\u52d5\u304b\u3059\u3053\u3068\u304c\u51fa\u6765\u308b\u3002<\/span><br \/>\n\u3000\u2192 \u30dd\u30ea\u30b4\u30f3\u306e\u9802\u70b9\u60c5\u5831\uff08\uff1dpolygon\u30bf\u30b0\u306e points\u5c5e\u6027\uff09\u3092\u52d5\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br \/>\n\u3000\u2192 <span class=\"my_fc_deeppinkB\">\u958b\u59cb\u70b9\u3068\u7d42\u4e86\u70b9\u3092\u6307\u5b9a\u3059\u308c\u3070\u3001\u305d\u306e\u4e2d\u9593\u70b9\u3092\u5185\u633f\u88dc\u5b8c\u3057\u3066\u304f\u308c\u308b\u3002<\/span><\/p>\n<p>\u30fb<span class=\"my_fc_deeppinkBBig\">\u3053\u306e\u65b9\u6cd5\u3092\u4f7f\u3048\u3070\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3067\u52d5\u304b\u305b\u308b\u3082\u306e\u306e\u5e45\u304c\u3059\u3054\u304f\u5e83\u304c\u308b\uff01<\/span><\/p>\n<h1 class=\"my_h\">4. \u8b1d\u8f9e<\/h1>\n<p>\u6709\u76ca\u306a\u60c5\u5831\u3092\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/ferret-plus.com\/7522\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ferret-plus.com\/7522<\/a><br \/>\n<a href=\"https:\/\/hacknote.jp\/archives\/24829\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/hacknote.jp\/archives\/24829\/<\/a><br \/>\n<a href=\"https:\/\/capotast.co.jp\/article\/detail\/33\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/capotast.co.jp\/article\/detail\/33\/<\/a><br \/>\n<a href=\"https:\/\/www.evoworx.co.jp\/blog\/svg-symbol\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.evoworx.co.jp\/blog\/svg-symbol\/<\/a><\/p>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>1. \u3084\u308a\u305f\u3044\u3053\u3068 \u904e\u53bb\u306e\u6295\u7a3f\u3067\u306f CSS\u3092\u5229\u7528\u3057\u305f\u30d9\u30af\u30bf\u753b\u50cf\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002 \u3067\u3082&#8230; CSS\u306b\u3088\u308b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u30d9\u30af\u30bf\u753b\u50cf\u306e\u9802\u70b9\u60c5\u5831\u3092\u6642\u9593\u5909\u5316\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u305a \u30d9\u30af\u30bf\u753b\u50cf\u3092\u3050\u306b\u3083\u3050\u306b\u3083\u3068\u5909\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/hp\/blog82\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1160","post","type-post","status-publish","format-standard","hentry","category-svg"],"views":1714,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts\/1160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/comments?post=1160"}],"version-history":[{"count":27,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts\/1160\/revisions"}],"predecessor-version":[{"id":1212,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts\/1160\/revisions\/1212"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/media?parent=1160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/categories?post=1160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/tags?post=1160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}