{"id":28785,"date":"2021-05-12T09:36:32","date_gmt":"2021-05-12T00:36:32","guid":{"rendered":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/?p=28785"},"modified":"2021-05-12T09:36:49","modified_gmt":"2021-05-12T00:36:49","slug":"party-js","status":"publish","type":"post","link":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/articles\/build-websites\/operation\/javascript\/party-js.html","title":{"rendered":"UI\u3067\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u306e\u304c\u697d\u3057\u304f\u306a\u308b\u30a8\u30d5\u30a7\u30af\u30c8\u304c\u305f\u304f\u3055\u3093\u63c3\u3063\u305fJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea -Party.js"},"content":{"rendered":"<p>\u30e6\u30fc\u30b6\u30fc\u304c\u30dc\u30bf\u30f3\u306e\u30af\u30ea\u30c3\u30af\u306a\u3069\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u3057\u305f\u969b\u306b\u7d19\u5439\u96ea\u3084\u30cf\u30fc\u30c8\u3092\u30af\u30e9\u30c3\u30ab\u30fc\u3067\u5f3e\u3051\u305f\u3088\u3046\u306a\u30a8\u30d5\u30a7\u30af\u30c8\u3067\u8868\u793a\u3059\u308b\u3001\u697d\u3057\u3055\u3092\u6f14\u51fa\u3059\u308bJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p class=\"mT1em\">\u30af\u30ea\u30c3\u30af\u3059\u308b\u306e\u304c\u697d\u3057\u304f\u306a\u308b\u30a8\u30d5\u30a7\u30af\u30c8\u304c\u305f\u304f\u3055\u3093\u63c3\u3063\u3066\u304a\u308a\u3001\u300c\u304a\u3081\u3067\u3068\u3046\uff01\u300d\u300c\u3042\u308a\u304c\u3068\u3046\uff01\u300d\u300c\u3046\u308c\u3057\u3044\uff01\u300d\u306a\u3069\u3092\u8996\u899a\u7684\u306b\u4f1d\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"mT2em\"><img decoding=\"async\" class=\"imgFix lazyload\" data-src=\"\/\/coliss.com\/wp-content\/uploads-202102\/2021051101-01.png\" width=\"541\" height=\"338\" alt=\"UI\u3067\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u306e\u304c\u697d\u3057\u304f\u306a\u308b\u30a8\u30d5\u30a7\u30af\u30c8\u304c\u305f\u304f\u3055\u3093\u63c3\u3063\u305fJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea -Party.js\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 541px; --smush-placeholder-aspect-ratio: 541\/338;\"><\/div>\n<p><a href=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/party.js.org\/\">Party.js<\/a><br \/>\n<a href=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/github.com\/YilianSource\/party-js\">Party.js -GitHub<\/a><\/p>\n<p><!--more--><\/p>\n<ul class=\"mT3em listStyleAchor\">\n<li><a href=\"#h201\">Party.js\u306e\u7279\u5fb4<\/a><\/li>\n<li><a href=\"#h202\">Party.js\u306e\u30c7\u30e2<\/a><\/li>\n<li><a href=\"#h203\">Party.js\u306e\u4f7f\u3044\u65b9<\/a><\/li>\n<\/ul>\n<h2 id=\"h201\">Party.js\u306e\u7279\u5fb4<\/h2>\n<p>Party.js\u306f\u300c\u304a\u3081\u3067\u3068\u3046\uff01\u300d\u300c\u3042\u308a\u304c\u3068\u3046\uff01\u300d\u300c\u3046\u308c\u3057\u3044\uff01\u300d\u306a\u3069\u3092\u8996\u899a\u7684\u306b\u8868\u73fe\u3059\u308b\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u5b9f\u88c5\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30b5\u30a4\u30c8\u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3092\u660e\u308b\u304f\u697d\u3057\u304f\u3059\u308bJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n<p class=\"mT1em\">\u30e6\u30fc\u30b6\u30fc\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u4f34\u3044\u3001\u7d19\u5439\u96ea\u3084\u30cf\u30fc\u30c8\u3084\u30ad\u30e9\u30ad\u30e9\u306a\u3069\u306e\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"mT2em\"><img decoding=\"async\" class=\"imgFix lazyload\" data-src=\"\/\/coliss.com\/wp-content\/uploads-202102\/2021051102.gif\" width=\"541\" height=\"338\" alt=\"\u30b5\u30a4\u30c8\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 541px; --smush-placeholder-aspect-ratio: 541\/338;\"><\/div>\n<ul class=\"mT2em listStyleDisc\">\n<li>\n<dl class=\"listStyleDefinition1\">\n<dt>\u5b9f\u88c5\u304c\u7c21\u5358<\/dt>\n<dd>\u30e9\u30a4\u30d6\u30e9\u30ea\u3092HTML\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u3081\u308b\u3060\u3051\u3067\u3001\u6e96\u5099\u304c\u6574\u3044\u307e\u3059\u3002\u3042\u3068\u306f\u9069\u7528\u3059\u308b\u8981\u7d20\u3068\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a18\u8ff0\u3059\u308b\u3060\u3051\u3067\u3001\u5b8c\u4e86\u3057\u307e\u3059\u3002\u4ed6\u306e\u3059\u3079\u3066\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306f\u3001\u5185\u90e8\u3067\u884c\u308f\u308c\u307e\u3059\u3002<\/dd>\n<\/dl>\n<\/li>\n<li>\n<dl class=\"listStyleDefinition1\">\n<dt>\u9ad8\u5ea6\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3082\u53ef\u80fd<\/dt>\n<dd>\u3059\u3079\u3066\u306e\u30a8\u30d5\u30a7\u30af\u30c8\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u3001\u7c21\u5358\u306b\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3067\u304d\u307e\u3059\u3002<\/dd>\n<\/dl>\n<\/li>\n<li>\n<dl class=\"listStyleDefinition1\">\n<dt>\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30b7\u30f3\u30d7\u30eb\u306b\u3082\u8907\u96d1\u306b\u3082<\/dt>\n<dd>\u30a8\u30d5\u30a7\u30af\u30c8\u306f1\u884c\u306e\u30b3\u30fc\u30c9\u3067\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u3001\u81a8\u5927\u306a\u6570\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u3067\u304d\u3001\u3059\u3079\u3066\u306e\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u597d\u307f\u306b\u5408\u308f\u305b\u3066\u8abf\u6574\u3067\u304d\u307e\u3059\u3002<\/dd>\n<\/dl>\n<\/li>\n<li>\n<dl class=\"listStyleDefinition1\">\n<dt>\u5546\u7528\u5229\u7528\u3067\u3082\u5b8c\u5168\u306b\u7121\u6599<\/dt>\n<dd><a href=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/github.com\/yiliansource\/party-js\/blob\/main\/LICENSE.md\">MIT\u30e9\u30a4\u30bb\u30f3\u30b9<\/a>\u3067\u3001\u500b\u4eba\u3067\u3082\u5546\u7528\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3082\u7121\u6599\u3067\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/dd>\n<\/dl>\n<\/li>\n<\/ul>\n<h2 id=\"h202\">Party.js\u306e\u30c7\u30e2<\/h2>\n<p>\u30c7\u30e2\u3067\u306f\u3001\u7d19\u5439\u96ea\u30fb\u30ad\u30e9\u30ad\u30e9\u30fb\u30cf\u30fc\u30c8\u306a\u3069\u304c\u821e\u3044\u6563\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u52d5\u304d\u306f\u7570\u306a\u308a\u3001\u7d19\u5439\u96ea\u306f\u821e\u3044\u4e0a\u304c\u3063\u3066\u4e0b\u306b\u843d\u3061\u3001\u30cf\u30fc\u30c8\u306f\u305f\u304f\u3055\u3093\u306e\u30cf\u30fc\u30c8\u304c\u5168\u65b9\u5411\u306b\u6563\u3089\u3070\u308a\u307e\u3059\u3002<\/p>\n<div class=\"mT2em\"><img decoding=\"async\" class=\"imgFix lazyload\" data-src=\"\/\/coliss.com\/wp-content\/uploads-202102\/2021051101-03.png\" width=\"541\" height=\"338\" alt=\"\u30b5\u30a4\u30c8\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 541px; --smush-placeholder-aspect-ratio: 541\/338;\"><\/div>\n<p><a href=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/party.js.org\/docs\/examples\/simple\">\u30c7\u30e2\u30da\u30fc\u30b8<\/a><\/p>\n<h2 id=\"h203\">Party.js\u306e\u4f7f\u3044\u65b9<\/h2>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u306fTypeScript\u3067\u8a18\u8ff0\u3055\u308c\u3066\u304a\u308a\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3055\u307e\u3056\u307e\u306a\u74b0\u5883\u3067\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3 class=\"mT3em\">Step 1: \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p class=\"mT1em\">\u4f7f\u7528\u3059\u308bHTML\u306b\u5f53\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\" >&lt;script src=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/cdn.jsdelivr.net\/npm\/party-js@latest\/bundle\/party.min.js\"&gt;&lt;\/script&gt;<\/pre>\n<p class=\"mT2em\">\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u7d4c\u7531\u3067\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\" >npm install party-js\r\n# or\r\nyarn add party-js<\/pre>\n<p class=\"mT1em\">\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"\u30a4\u30f3\u30dd\u30fc\u30c8\" >import * as party from \"party-js\";\r\n\/\/ or\r\nconst party = require(\"party-js\");<\/pre>\n<h3 class=\"mT3em\">Step 2: HTML<\/h3>\n<p class=\"mT1em\">\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642\u306b<span class=\"marker1\">confetti<\/span>\uff08\u7d19\u5439\u96ea\uff09\u306e\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"HTML\" >&lt;div class=\"button\" onmousedown=\"party.confetti(this)\"&gt;Click me!&lt;\/div&gt;<\/pre>\n<h3 class=\"mT3em\">Step 3: JavaScript<\/h3>\n<p class=\"mT1em\">\u9069\u7528\u3059\u308b\u8981\u7d20\u3092\u6307\u5b9a\u3068\u30c8\u30ea\u30ac\u30fc\u3092\u6307\u5b9a\u3057\u3001\u30a8\u30d5\u30a7\u30af\u30c8\u306e\u91cf\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"JavaScript\" >document.querySelector(\".button\").addEventListener(\"click\", function (e) {\r\n    party.confetti(this, {\r\n        count: party.variation.range(20, 40),\r\n    });\r\n});<\/pre>\n<p class=\"mT1em\">\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u3055\u3089\u306b\u7d30\u304b\u304f\u5236\u5fa1\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u3055\u3089\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"mT2em\"><img decoding=\"async\" class=\"imgFix lazyload\" data-src=\"\/\/coliss.com\/wp-content\/uploads-202102\/2021051101-04.png\" width=\"541\" height=\"338\" alt=\"\u30b5\u30a4\u30c8\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 541px; --smush-placeholder-aspect-ratio: 541\/338;\"><\/div>\n<p><a href=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/party.js.org\/docs\/examples\/advanced\">Advanced -Party.js<\/a><\/p>\n<p class=\"mT3em\">\u8a73\u3057\u3044\u5b9f\u88c5\u65b9\u6cd5\u306f\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"mT2em\"><img decoding=\"async\" class=\"imgFix lazyload\" data-src=\"\/\/coliss.com\/wp-content\/uploads-202102\/2021051101-02.png\" width=\"541\" height=\"338\" alt=\"\u30b5\u30a4\u30c8\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 541px; --smush-placeholder-aspect-ratio: 541\/338;\"><\/div>\n<p><a href=\"https:\/\/proxy.goincop1.workers.dev:443\/https\/party.js.org\/docs\/\">Documentation -Party.js<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u30e6\u30fc\u30b6\u30fc\u304c\u30dc\u30bf\u30f3\u306e\u30af\u30ea\u30c3\u30af\u306a\u3069\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u3057\u305f\u969b\u306b\u7d19\u5439\u96ea\u3084\u30cf\u30fc\u30c8\u3092\u30af\u30e9\u30c3\u30ab\u30fc\u3067\u5f3e\u3051\u305f\u3088\u3046\u306a\u30a8\u30d5\u30a7\u30af\u30c8\u3067\u8868\u793a\u3059\u308b\u3001\u697d\u3057\u3055\u3092\u6f14\u51fa\u3059\u308bJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30af\u30ea\u30c3\u30af\u3059\u308b\u306e\u304c\u697d\u3057\u304f\u306a\u308b\u30a8\u30d5\u30a7\u30af\u30c8\u304c\u305f\u304f\u3055 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5640],"tags":[6708,6362],"class_list":["post-28785","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-effect","tag-javascript-operation-build-websites"],"_links":{"self":[{"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/posts\/28785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/comments?post=28785"}],"version-history":[{"count":0,"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/posts\/28785\/revisions"}],"wp:attachment":[{"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/media?parent=28785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/categories?post=28785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/coliss.com\/wp-json\/wp\/v2\/tags?post=28785"}],"curies":[{"name":"wp","href":"https:\/\/proxy.goincop1.workers.dev:443\/https\/api.w.org\/{rel}","templated":true}]}}