forked from ppfun/pixelplanet
Merge branch 'master' into pxlburst
This commit is contained in:
commit
39095154cf
190
package-lock.json
generated
190
package-lock.json
generated
|
@ -1518,9 +1518,9 @@
|
|||
}
|
||||
},
|
||||
"@eslint/eslintrc": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz",
|
||||
"integrity": "sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA==",
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
|
||||
"integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^6.12.4",
|
||||
|
@ -2072,9 +2072,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"assets-webpack-plugin": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/assets-webpack-plugin/-/assets-webpack-plugin-6.0.5.tgz",
|
||||
"integrity": "sha512-sCRg6IRT30boycg5XI7iSc+govAE5yqpFgWK2897MHdyfpO9xdkhRQjFAxqrmsba4ywrDB07poVoGSRT6l04fQ==",
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/assets-webpack-plugin/-/assets-webpack-plugin-6.1.1.tgz",
|
||||
"integrity": "sha512-Rk4VJVrryzBy/J+R2NeZGZz1l2e/z/gCT6wvob26Oe9dRRUffhitxKj3xRVblPRDzfnbvvw8EJbq7A7SRj4SuA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"camelcase": "^6.0.0",
|
||||
|
@ -3049,9 +3049,9 @@
|
|||
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
|
||||
},
|
||||
"core-js": {
|
||||
"version": "3.8.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.0.tgz",
|
||||
"integrity": "sha512-W2VYNB0nwQQE7tKS7HzXd7r2y/y2SVJl4ga6oH/dnaLFzM0o2lB2P3zCkWj5Wc/zyMYjtgd5Hmhk0ObkQFZOIA=="
|
||||
"version": "3.8.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz",
|
||||
"integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg=="
|
||||
},
|
||||
"core-js-compat": {
|
||||
"version": "3.8.0",
|
||||
|
@ -3595,9 +3595,9 @@
|
|||
}
|
||||
},
|
||||
"enhanced-resolve": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.2.tgz",
|
||||
"integrity": "sha512-G28GCrglCAH6+EqMN2D+Q2wCUS1O1vVQJBn8ME2I/Api41YBe4vLWWRBOUbwDH7vwzSZdljxwTRVqnf+sm6XqQ==",
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.4.0.tgz",
|
||||
"integrity": "sha512-ZmqfWURB2lConOBM1JdCVfPyMRv5RdKWktLXO6123p97ovVm2CLBgw9t5MBj3jJWA6eHyOeIws9iJQoGFR4euQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
|
@ -3691,13 +3691,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"eslint": {
|
||||
"version": "7.14.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.14.0.tgz",
|
||||
"integrity": "sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA==",
|
||||
"version": "7.15.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.15.0.tgz",
|
||||
"integrity": "sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@eslint/eslintrc": "^0.2.1",
|
||||
"@eslint/eslintrc": "^0.2.2",
|
||||
"ajv": "^6.10.0",
|
||||
"chalk": "^4.0.0",
|
||||
"cross-spawn": "^7.0.2",
|
||||
|
@ -3707,10 +3707,10 @@
|
|||
"eslint-scope": "^5.1.1",
|
||||
"eslint-utils": "^2.1.0",
|
||||
"eslint-visitor-keys": "^2.0.0",
|
||||
"espree": "^7.3.0",
|
||||
"espree": "^7.3.1",
|
||||
"esquery": "^1.2.0",
|
||||
"esutils": "^2.0.2",
|
||||
"file-entry-cache": "^5.0.1",
|
||||
"file-entry-cache": "^6.0.0",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"glob-parent": "^5.0.0",
|
||||
"globals": "^12.1.0",
|
||||
|
@ -3806,10 +3806,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
|
||||
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
|
||||
"dev": true
|
||||
"version": "7.3.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
|
||||
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.0",
|
||||
|
@ -4209,13 +4212,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"espree": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz",
|
||||
"integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==",
|
||||
"version": "7.3.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
|
||||
"integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "^7.4.0",
|
||||
"acorn-jsx": "^5.2.0",
|
||||
"acorn-jsx": "^5.3.1",
|
||||
"eslint-visitor-keys": "^1.3.0"
|
||||
}
|
||||
},
|
||||
|
@ -4454,12 +4457,12 @@
|
|||
"integrity": "sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg=="
|
||||
},
|
||||
"file-entry-cache": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz",
|
||||
"integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"flat-cache": "^2.0.1"
|
||||
"flat-cache": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"file-stream-rotator": {
|
||||
|
@ -4533,37 +4536,25 @@
|
|||
}
|
||||
},
|
||||
"flat-cache": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
|
||||
"integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
|
||||
"integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"flatted": "^2.0.0",
|
||||
"rimraf": "2.6.3",
|
||||
"write": "1.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"rimraf": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
}
|
||||
"flatted": "^3.1.0",
|
||||
"rimraf": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"flatted": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz",
|
||||
"integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
|
||||
"integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
|
||||
"dev": true
|
||||
},
|
||||
"flow-bin": {
|
||||
"version": "0.138.0",
|
||||
"resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.138.0.tgz",
|
||||
"integrity": "sha512-y3twwNeN0FWEK0vvJo/5SiC/OQVlhubGRyOPIS6p49b2yiiWE/cBFG/aC9kFXFfh7Orewe5O5B2X0+IiEOCYIw==",
|
||||
"version": "0.139.0",
|
||||
"resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.139.0.tgz",
|
||||
"integrity": "sha512-eilVetLwztYtKjRj//4OsJ7aw47hsUZ8GTINxaZHWhpqiFikErQL0sV/3hQtpm54w9FuS2PO4yvbU0pWrtckqg==",
|
||||
"dev": true
|
||||
},
|
||||
"fn.name": {
|
||||
|
@ -4641,9 +4632,9 @@
|
|||
}
|
||||
},
|
||||
"generate-package-json-webpack-plugin": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/generate-package-json-webpack-plugin/-/generate-package-json-webpack-plugin-2.1.1.tgz",
|
||||
"integrity": "sha512-GRh4GdNGKEgwmjxejlBwFXxJ7zbnGz94eykB2Bal7w9QBkYa41sztNekXC0So3kKaSKWt83N4UlstezuZYAdGQ==",
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/generate-package-json-webpack-plugin/-/generate-package-json-webpack-plugin-2.1.2.tgz",
|
||||
"integrity": "sha512-3TQcmtwtFmFONnpk11MiMTQNjIBxc6P6HDfdVLO6Comvgj0UfV3t+Bpwk1qIQkMYPnVFiOxBaH8TCieoO3QI4Q==",
|
||||
"dev": true
|
||||
},
|
||||
"gensync": {
|
||||
|
@ -8329,9 +8320,9 @@
|
|||
}
|
||||
},
|
||||
"sweetalert2": {
|
||||
"version": "10.10.4",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-10.10.4.tgz",
|
||||
"integrity": "sha512-qQJcqMaN9i5J0W7wrrttPpmZ5Ws6MrffT61asBLiCj+5sme2wII0ZeOGr8EoPrn8Hd56o58D33KcQMy01JodIQ=="
|
||||
"version": "10.12.1",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-10.12.1.tgz",
|
||||
"integrity": "sha512-5YhwCsQo1euaM1Mk5Ys2kkuJg//YLUVzu95ZK21VccizzbMXtmiGvxmRKTvYCGz9AuyiK8oRop2rYE8LZbsYrw=="
|
||||
},
|
||||
"symbol-observable": {
|
||||
"version": "1.2.0",
|
||||
|
@ -8397,9 +8388,9 @@
|
|||
}
|
||||
},
|
||||
"tapable": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz",
|
||||
"integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz",
|
||||
"integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==",
|
||||
"dev": true
|
||||
},
|
||||
"tar": {
|
||||
|
@ -8976,9 +8967,9 @@
|
|||
}
|
||||
},
|
||||
"webpack": {
|
||||
"version": "5.9.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.9.0.tgz",
|
||||
"integrity": "sha512-YnnqIV/uAS5ZrNpctSv378qV7HmbJ74DL+XfvMxzbX1bV9e7eeT6eEWU4wuUw33CNr/HspBh7R/xQlVjTEyAeA==",
|
||||
"version": "5.10.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.10.0.tgz",
|
||||
"integrity": "sha512-P0bHAXmIz0zsNcHNLqFmLY1ZtrT+jtBr7FqpuDtA2o7GiHC+zBsfhgK7SmJ1HG7BAEb3G9JoMdSVi7mEDvG3Zg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/eslint-scope": "^3.7.0",
|
||||
|
@ -8999,7 +8990,7 @@
|
|||
"loader-runner": "^4.1.0",
|
||||
"mime-types": "^2.1.27",
|
||||
"neo-async": "^2.6.2",
|
||||
"pkg-dir": "^4.2.0",
|
||||
"pkg-dir": "^5.0.0",
|
||||
"schema-utils": "^3.0.0",
|
||||
"tapable": "^2.1.1",
|
||||
"terser-webpack-plugin": "^5.0.3",
|
||||
|
@ -9014,31 +9005,40 @@
|
|||
"dev": true
|
||||
},
|
||||
"find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"locate-path": "^5.0.0",
|
||||
"locate-path": "^6.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
||||
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-locate": "^4.1.0"
|
||||
"p-locate": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"yocto-queue": "^0.1.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
|
||||
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-limit": "^2.2.0"
|
||||
"p-limit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"path-exists": {
|
||||
|
@ -9048,12 +9048,12 @@
|
|||
"dev": true
|
||||
},
|
||||
"pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz",
|
||||
"integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^4.0.0"
|
||||
"find-up": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"schema-utils": {
|
||||
|
@ -9524,26 +9524,6 @@
|
|||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"write": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz",
|
||||
"integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"write-file-atomic": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
|
||||
|
@ -9611,9 +9591,9 @@
|
|||
}
|
||||
},
|
||||
"ws": {
|
||||
"version": "7.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz",
|
||||
"integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ=="
|
||||
"version": "7.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.1.tgz",
|
||||
"integrity": "sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ=="
|
||||
},
|
||||
"xdg-basedir": {
|
||||
"version": "3.0.0",
|
||||
|
|
16
package.json
16
package.json
|
@ -33,7 +33,7 @@
|
|||
"compression": "^1.7.3",
|
||||
"connect-redis": "^5.0.0",
|
||||
"cookie-parser": "^1.4.5",
|
||||
"core-js": "^3.8.0",
|
||||
"core-js": "^3.8.1",
|
||||
"cors": "^2.8.4",
|
||||
"etag": "^1.8.1",
|
||||
"express": "^4.15.3",
|
||||
|
@ -75,13 +75,13 @@
|
|||
"sequelize": "^6.3.5",
|
||||
"sharp": "^0.26.3",
|
||||
"startaudiocontext": "^1.2.1",
|
||||
"sweetalert2": "^10.10.4",
|
||||
"sweetalert2": "^10.12.1",
|
||||
"three": "^0.123.0",
|
||||
"three-trackballcontrols": "^0.9.0",
|
||||
"url-search-params-polyfill": "^8.1.0",
|
||||
"winston": "^3.3.3",
|
||||
"winston-daily-rotate-file": "^4.5.0",
|
||||
"ws": "^7.4.0"
|
||||
"ws": "^7.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.9",
|
||||
|
@ -111,22 +111,22 @@
|
|||
"@babel/preset-flow": "^7.10.4",
|
||||
"@babel/preset-react": "^7.12.7",
|
||||
"@babel/preset-typescript": "^7.12.7",
|
||||
"assets-webpack-plugin": "^6.0.5",
|
||||
"assets-webpack-plugin": "^6.1.1",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.2.2",
|
||||
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
||||
"clean-css": "^4.2.3",
|
||||
"css-loader": "^5.0.1",
|
||||
"eslint": "^7.14.0",
|
||||
"eslint": "^7.15.0",
|
||||
"eslint-config-airbnb": "^18.2.1",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-plugin-flowtype": "^5.2.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.3.1",
|
||||
"eslint-plugin-react": "^7.21.2",
|
||||
"flow-bin": "^0.138.0",
|
||||
"generate-package-json-webpack-plugin": "^2.1.1",
|
||||
"flow-bin": "^0.139.0",
|
||||
"generate-package-json-webpack-plugin": "^2.1.2",
|
||||
"glob": "^7.1.6",
|
||||
"json-loader": "^0.5.4",
|
||||
"mkdirp": "^1.0.4",
|
||||
|
@ -135,7 +135,7 @@
|
|||
"react-svg-loader": "^3.0.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"style-loader": "^2.0.0",
|
||||
"webpack": "^5.9.0",
|
||||
"webpack": "^5.10.0",
|
||||
"webpack-bundle-analyzer": "^4.2.0",
|
||||
"webpack-cli": "^4.2.0",
|
||||
"webpack-dev-middleware": "^4.0.2",
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
"ranked" : true,
|
||||
"req": 20000,
|
||||
"sd": "2020-01-08",
|
||||
"desc": "Moon canvas with a pastel tone palette and black background"
|
||||
"desc": "Moon canvas. Safe space for art. No flags or large text (unless part of art)"
|
||||
},
|
||||
"2": {
|
||||
"ident":"v",
|
||||
|
@ -280,17 +280,19 @@
|
|||
"ident": "w",
|
||||
"title": "1bit",
|
||||
"colors": [
|
||||
[ 0, 0, 0 ],
|
||||
[ 255, 255, 255 ],
|
||||
[ 0, 0, 0 ],
|
||||
[ 255, 255, 255 ]
|
||||
],
|
||||
"size": 4096,
|
||||
"size": 65536,
|
||||
"hid": false,
|
||||
"cli": 0,
|
||||
"bcd": 2000,
|
||||
"pcd": 2000,
|
||||
"cds": 80000,
|
||||
"ranked": false,
|
||||
"req": 10000,
|
||||
"cli": 2,
|
||||
"bcd": 7000,
|
||||
"pcd": 15000,
|
||||
"cds": 1000000,
|
||||
"ranked": true,
|
||||
"req": 5000,
|
||||
"sd": "2020-11-09",
|
||||
"desc": "Black and White canvas"
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import Menu from './Menu';
|
|||
import UI from './UI';
|
||||
import ExpandMenuButton from './ExpandMenuButton';
|
||||
import ModalRoot from './ModalRoot';
|
||||
import ChristmasButton from './ChristmasButton';
|
||||
|
||||
const App = () => (
|
||||
<div>
|
||||
|
@ -35,6 +36,7 @@ const App = () => (
|
|||
<ExpandMenuButton />
|
||||
<UI />
|
||||
<ModalRoot />
|
||||
<ChristmasButton />
|
||||
</IconContext.Provider>
|
||||
</div>
|
||||
);
|
||||
|
|
55
src/components/ChristmasButton.jsx
Normal file
55
src/components/ChristmasButton.jsx
Normal file
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { GiPineTree } from 'react-icons/gi';
|
||||
|
||||
import SnowStorm from '../ui/snow';
|
||||
|
||||
const videoIds = [
|
||||
'-YUH8Xfz-jg',
|
||||
'yXQViqx6GMY',
|
||||
'is4NQkUN3AI',
|
||||
'xjLTDaCUYuQ',
|
||||
];
|
||||
|
||||
const snowStorm = new SnowStorm(window, document);
|
||||
|
||||
const ChristmasButton = () => {
|
||||
const [playing, setPlaying] = useState(false);
|
||||
const prot = window.location.protocol;
|
||||
|
||||
const video = videoIds[Math.floor(Math.random() * videoIds.length)];
|
||||
const url = `${prot}//www.youtube.com/embed/${video}?autoplay=1&loop=1`;
|
||||
|
||||
return (
|
||||
<div
|
||||
id="minecrafttpbutton"
|
||||
className="actionbuttons"
|
||||
role="button"
|
||||
tabIndex={-1}
|
||||
onClick={() => {
|
||||
setPlaying(!playing);
|
||||
snowStorm.toggleSnow();
|
||||
}}
|
||||
style={{
|
||||
boxShadow: (playing)
|
||||
? '0 0 9px 6px rgba(0, 189, 47, 0.8)'
|
||||
: '0 0 9px 6px rgba(189, 0, 0, 0.8)',
|
||||
}}
|
||||
>
|
||||
<GiPineTree />
|
||||
{(playing) && (
|
||||
<embed
|
||||
height="0"
|
||||
width="0"
|
||||
src={url}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChristmasButton;
|
670
src/ui/snow.js
Normal file
670
src/ui/snow.js
Normal file
|
@ -0,0 +1,670 @@
|
|||
/** @license
|
||||
* DHTML Snowstorm! JavaScript-based snow for web pages
|
||||
* Making it snow on the internets since 2003. You're welcome.
|
||||
* -----------------------------------------------------------
|
||||
* Version 1.44.20131215 (Previous rev: 1.44.20131208)
|
||||
* Copyright (c) 2007, Scott Schiller. All rights reserved.
|
||||
* Code provided under the BSD License
|
||||
* http://schillmania.com/projects/snowstorm/license.txt
|
||||
*/
|
||||
|
||||
/*jslint nomen: true, plusplus: true, sloppy: true, vars: true, white: true */
|
||||
/*global window, document, navigator, clearInterval, setInterval */
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
function SnowStorm(window, document) {
|
||||
|
||||
// --- common properties ---
|
||||
|
||||
this.autoStart = false; // Whether the snow should start automatically or not.
|
||||
this.flakesMax = 256; // Limit total amount of snow made (falling + sticking)
|
||||
this.flakesMaxActive = 128; // Limit amount of snow falling at once (less = lower CPU use)
|
||||
this.animationInterval = 33; // Theoretical "miliseconds per frame" measurement. 20 = fast + smooth, but high CPU use. 50 = more conservative, but slower
|
||||
this.useGPU = true; // Enable transform-based hardware acceleration, reduce CPU load.
|
||||
this.className = null; // CSS class name for further customization on snow elements
|
||||
this.excludeMobile = false; // Snow is likely to be bad news for mobile phones' CPUs (and batteries.) By default, be nice.
|
||||
this.flakeBottom = null; // Integer for Y axis snow limit, 0 or null for "full-screen" snow effect
|
||||
this.followMouse = true; // Snow movement can respond to the user's mouse
|
||||
this.snowColor = '#fff'; // Don't eat (or use?) yellow snow.
|
||||
this.snowCharacter = '•'; // • = bullet, · is square on some systems etc.
|
||||
this.snowStick = true; // Whether or not snow should "stick" at the bottom. When off, will never collect.
|
||||
this.targetElement = null; // element which snow will be appended to (null = document.body) - can be an element ID eg. 'myDiv', or a DOM node reference
|
||||
this.useMeltEffect = true; // When recycling fallen snow (or rarely, when falling), have it "melt" and fade out if browser supports it
|
||||
this.useTwinkleEffect = false; // Allow snow to randomly "flicker" in and out of view while falling
|
||||
this.usePositionFixed = false; // true = snow does not shift vertically when scrolling. May increase CPU load, disabled by default - if enabled, used only where supported
|
||||
this.usePixelPosition = false; // Whether to use pixel values for snow top/left vs. percentages. Auto-enabled if body is position:relative or targetElement is specified.
|
||||
|
||||
// --- less-used bits ---
|
||||
|
||||
this.freezeOnBlur = true; // Only snow when the window is in focus (foreground.) Saves CPU.
|
||||
this.flakeLeftOffset = 0; // Left margin/gutter space on edge of container (eg. browser window.) Bump up these values if seeing horizontal scrollbars.
|
||||
this.flakeRightOffset = 0; // Right margin/gutter space on edge of container
|
||||
this.flakeWidth = 8; // Max pixel width reserved for snow element
|
||||
this.flakeHeight = 8; // Max pixel height reserved for snow element
|
||||
this.vMaxX = 5; // Maximum X velocity range for snow
|
||||
this.vMaxY = 4; // Maximum Y velocity range for snow
|
||||
this.zIndex = 0; // CSS stacking order applied to each snowflake
|
||||
|
||||
// --- "No user-serviceable parts inside" past this point, yadda yadda ---
|
||||
|
||||
var storm = this,
|
||||
features,
|
||||
// UA sniffing and backCompat rendering mode checks for fixed position, etc.
|
||||
isIE = navigator.userAgent.match(/msie/i),
|
||||
isIE6 = navigator.userAgent.match(/msie 6/i),
|
||||
isMobile = navigator.userAgent.match(/mobile|opera m(ob|in)/i),
|
||||
isBackCompatIE = (isIE && document.compatMode === 'BackCompat'),
|
||||
noFixed = (isBackCompatIE || isIE6),
|
||||
screenX = null, screenX2 = null, screenY = null, scrollY = null, docHeight = null, vRndX = null, vRndY = null,
|
||||
windOffset = 1,
|
||||
windMultiplier = 2,
|
||||
flakeTypes = 6,
|
||||
fixedForEverything = false,
|
||||
targetElementIsRelative = false,
|
||||
opacitySupported = (function(){
|
||||
try {
|
||||
document.createElement('div').style.opacity = '0.5';
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}()),
|
||||
didInit = false,
|
||||
docFrag = document.createDocumentFragment();
|
||||
|
||||
features = (function() {
|
||||
|
||||
var getAnimationFrame;
|
||||
|
||||
/**
|
||||
* hat tip: paul irish
|
||||
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
* https://gist.github.com/838785
|
||||
*/
|
||||
|
||||
function timeoutShim(callback) {
|
||||
window.setTimeout(callback, 1000/(storm.animationInterval || 20));
|
||||
}
|
||||
|
||||
var _animationFrame = (window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
timeoutShim);
|
||||
|
||||
// apply to window, avoid "illegal invocation" errors in Chrome
|
||||
getAnimationFrame = _animationFrame ? function() {
|
||||
return _animationFrame.apply(window, arguments);
|
||||
} : null;
|
||||
|
||||
var testDiv;
|
||||
|
||||
testDiv = document.createElement('div');
|
||||
|
||||
function has(prop) {
|
||||
|
||||
// test for feature support
|
||||
var result = testDiv.style[prop];
|
||||
return (result !== undefined ? prop : null);
|
||||
|
||||
}
|
||||
|
||||
// note local scope.
|
||||
var localFeatures = {
|
||||
|
||||
transform: {
|
||||
ie: has('-ms-transform'),
|
||||
moz: has('MozTransform'),
|
||||
opera: has('OTransform'),
|
||||
webkit: has('webkitTransform'),
|
||||
w3: has('transform'),
|
||||
prop: null // the normalized property value
|
||||
},
|
||||
|
||||
getAnimationFrame: getAnimationFrame
|
||||
|
||||
};
|
||||
|
||||
localFeatures.transform.prop = (
|
||||
localFeatures.transform.w3 ||
|
||||
localFeatures.transform.moz ||
|
||||
localFeatures.transform.webkit ||
|
||||
localFeatures.transform.ie ||
|
||||
localFeatures.transform.opera
|
||||
);
|
||||
|
||||
testDiv = null;
|
||||
|
||||
return localFeatures;
|
||||
|
||||
}());
|
||||
|
||||
this.timer = null;
|
||||
this.flakes = [];
|
||||
this.disabled = false;
|
||||
this.active = false;
|
||||
this.meltFrameCount = 20;
|
||||
this.meltFrames = [];
|
||||
|
||||
this.setXY = function(o, x, y) {
|
||||
|
||||
if (!o) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (storm.usePixelPosition || targetElementIsRelative) {
|
||||
|
||||
o.style.left = (x - storm.flakeWidth) + 'px';
|
||||
o.style.top = (y - storm.flakeHeight) + 'px';
|
||||
|
||||
} else if (noFixed) {
|
||||
|
||||
o.style.right = (100-(x/screenX*100)) + '%';
|
||||
// avoid creating vertical scrollbars
|
||||
o.style.top = (Math.min(y, docHeight-storm.flakeHeight)) + 'px';
|
||||
|
||||
} else {
|
||||
|
||||
if (!storm.flakeBottom) {
|
||||
|
||||
// if not using a fixed bottom coordinate...
|
||||
o.style.right = (100-(x/screenX*100)) + '%';
|
||||
o.style.bottom = (100-(y/screenY*100)) + '%';
|
||||
|
||||
} else {
|
||||
|
||||
// absolute top.
|
||||
o.style.right = (100-(x/screenX*100)) + '%';
|
||||
o.style.top = (Math.min(y, docHeight-storm.flakeHeight)) + 'px';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.events = (function() {
|
||||
|
||||
var old = (!window.addEventListener && window.attachEvent), slice = Array.prototype.slice,
|
||||
evt = {
|
||||
add: (old?'attachEvent':'addEventListener'),
|
||||
remove: (old?'detachEvent':'removeEventListener')
|
||||
};
|
||||
|
||||
function getArgs(oArgs) {
|
||||
var args = slice.call(oArgs), len = args.length;
|
||||
if (old) {
|
||||
args[1] = 'on' + args[1]; // prefix
|
||||
if (len > 3) {
|
||||
args.pop(); // no capture
|
||||
}
|
||||
} else if (len === 3) {
|
||||
args.push(false);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
function apply(args, sType) {
|
||||
var element = args.shift(),
|
||||
method = [evt[sType]];
|
||||
if (old) {
|
||||
element[method](args[0], args[1]);
|
||||
} else {
|
||||
element[method].apply(element, args);
|
||||
}
|
||||
}
|
||||
|
||||
function addEvent() {
|
||||
apply(getArgs(arguments), 'add');
|
||||
}
|
||||
|
||||
function removeEvent() {
|
||||
apply(getArgs(arguments), 'remove');
|
||||
}
|
||||
|
||||
return {
|
||||
add: addEvent,
|
||||
remove: removeEvent
|
||||
};
|
||||
|
||||
}());
|
||||
|
||||
function rnd(n,min) {
|
||||
if (isNaN(min)) {
|
||||
min = 0;
|
||||
}
|
||||
return (Math.random()*n)+min;
|
||||
}
|
||||
|
||||
function plusMinus(n) {
|
||||
return (parseInt(rnd(2),10)===1?n*-1:n);
|
||||
}
|
||||
|
||||
this.randomizeWind = function() {
|
||||
var i;
|
||||
vRndX = plusMinus(rnd(storm.vMaxX,0.2));
|
||||
vRndY = rnd(storm.vMaxY,0.2);
|
||||
if (this.flakes) {
|
||||
for (i=0; i<this.flakes.length; i++) {
|
||||
if (this.flakes[i].active) {
|
||||
this.flakes[i].setVelocities();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.scrollHandler = function() {
|
||||
var i;
|
||||
// "attach" snowflakes to bottom of window if no absolute bottom value was given
|
||||
scrollY = (storm.flakeBottom ? 0 : parseInt(window.scrollY || document.documentElement.scrollTop || (noFixed ? document.body.scrollTop : 0), 10));
|
||||
if (isNaN(scrollY)) {
|
||||
scrollY = 0; // Netscape 6 scroll fix
|
||||
}
|
||||
if (!fixedForEverything && !storm.flakeBottom && storm.flakes) {
|
||||
for (i=0; i<storm.flakes.length; i++) {
|
||||
if (storm.flakes[i].active === 0) {
|
||||
storm.flakes[i].stick();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.resizeHandler = function() {
|
||||
if (window.innerWidth || window.innerHeight) {
|
||||
screenX = window.innerWidth - 16 - storm.flakeRightOffset;
|
||||
screenY = (storm.flakeBottom || window.innerHeight);
|
||||
} else {
|
||||
screenX = (document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth) - (!isIE ? 8 : 0) - storm.flakeRightOffset;
|
||||
screenY = storm.flakeBottom || document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight;
|
||||
}
|
||||
docHeight = document.body.offsetHeight;
|
||||
screenX2 = parseInt(screenX/2,10);
|
||||
};
|
||||
|
||||
this.resizeHandlerAlt = function() {
|
||||
screenX = storm.targetElement.offsetWidth - storm.flakeRightOffset;
|
||||
screenY = storm.flakeBottom || storm.targetElement.offsetHeight;
|
||||
screenX2 = parseInt(screenX/2,10);
|
||||
docHeight = document.body.offsetHeight;
|
||||
};
|
||||
|
||||
this.freeze = function() {
|
||||
// pause animation
|
||||
if (!storm.disabled) {
|
||||
storm.disabled = 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
storm.timer = null;
|
||||
};
|
||||
|
||||
this.resume = function() {
|
||||
if (storm.disabled) {
|
||||
storm.disabled = 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
storm.timerInit();
|
||||
};
|
||||
|
||||
this.toggleSnow = function() {
|
||||
if (!storm.flakes.length) {
|
||||
// first run
|
||||
storm.start();
|
||||
} else {
|
||||
storm.active = !storm.active;
|
||||
if (storm.active) {
|
||||
storm.show();
|
||||
storm.resume();
|
||||
} else {
|
||||
storm.stop();
|
||||
storm.freeze();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.stop = function() {
|
||||
var i;
|
||||
this.freeze();
|
||||
for (i=0; i<this.flakes.length; i++) {
|
||||
this.flakes[i].o.style.display = 'none';
|
||||
}
|
||||
storm.events.remove(window,'scroll',storm.scrollHandler);
|
||||
storm.events.remove(window,'resize',storm.resizeHandler);
|
||||
if (storm.freezeOnBlur) {
|
||||
if (isIE) {
|
||||
storm.events.remove(document,'focusout',storm.freeze);
|
||||
storm.events.remove(document,'focusin',storm.resume);
|
||||
} else {
|
||||
storm.events.remove(window,'blur',storm.freeze);
|
||||
storm.events.remove(window,'focus',storm.resume);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.show = function() {
|
||||
var i;
|
||||
for (i=0; i<this.flakes.length; i++) {
|
||||
this.flakes[i].o.style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
this.SnowFlake = function(type,x,y) {
|
||||
var s = this;
|
||||
this.type = type;
|
||||
this.x = x||parseInt(rnd(screenX-20),10);
|
||||
this.y = (!isNaN(y)?y:-rnd(screenY)-12);
|
||||
this.vX = null;
|
||||
this.vY = null;
|
||||
this.vAmpTypes = [1,1.2,1.4,1.6,1.8]; // "amplification" for vX/vY (based on flake size/type)
|
||||
this.vAmp = this.vAmpTypes[this.type] || 1;
|
||||
this.melting = false;
|
||||
this.meltFrameCount = storm.meltFrameCount;
|
||||
this.meltFrames = storm.meltFrames;
|
||||
this.meltFrame = 0;
|
||||
this.twinkleFrame = 0;
|
||||
this.active = 1;
|
||||
this.fontSize = (10+(this.type/5)*10);
|
||||
this.o = document.createElement('div');
|
||||
this.o.innerHTML = storm.snowCharacter;
|
||||
if (storm.className) {
|
||||
this.o.setAttribute('class', storm.className);
|
||||
}
|
||||
this.o.style.color = storm.snowColor;
|
||||
this.o.style.position = (fixedForEverything?'fixed':'absolute');
|
||||
if (storm.useGPU && features.transform.prop) {
|
||||
// GPU-accelerated snow.
|
||||
this.o.style[features.transform.prop] = 'translate3d(0px, 0px, 0px)';
|
||||
}
|
||||
this.o.style.width = storm.flakeWidth+'px';
|
||||
this.o.style.height = storm.flakeHeight+'px';
|
||||
this.o.style.fontFamily = 'arial,verdana';
|
||||
this.o.style.cursor = 'default';
|
||||
this.o.style.overflow = 'hidden';
|
||||
this.o.style.fontWeight = 'normal';
|
||||
this.o.style.zIndex = storm.zIndex;
|
||||
docFrag.appendChild(this.o);
|
||||
|
||||
this.refresh = function() {
|
||||
if (isNaN(s.x) || isNaN(s.y)) {
|
||||
// safety check
|
||||
return false;
|
||||
}
|
||||
storm.setXY(s.o, s.x, s.y);
|
||||
};
|
||||
|
||||
this.stick = function() {
|
||||
if (noFixed || (storm.targetElement !== document.documentElement && storm.targetElement !== document.body)) {
|
||||
s.o.style.top = (screenY+scrollY-storm.flakeHeight)+'px';
|
||||
} else if (storm.flakeBottom) {
|
||||
s.o.style.top = storm.flakeBottom+'px';
|
||||
} else {
|
||||
s.o.style.display = 'none';
|
||||
s.o.style.top = 'auto';
|
||||
s.o.style.bottom = '0%';
|
||||
s.o.style.position = 'fixed';
|
||||
s.o.style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
this.vCheck = function() {
|
||||
if (s.vX>=0 && s.vX<0.2) {
|
||||
s.vX = 0.2;
|
||||
} else if (s.vX<0 && s.vX>-0.2) {
|
||||
s.vX = -0.2;
|
||||
}
|
||||
if (s.vY>=0 && s.vY<0.2) {
|
||||
s.vY = 0.2;
|
||||
}
|
||||
};
|
||||
|
||||
this.move = function() {
|
||||
var vX = s.vX*windOffset, yDiff;
|
||||
s.x += vX;
|
||||
s.y += (s.vY*s.vAmp);
|
||||
if (s.x >= screenX || screenX-s.x < storm.flakeWidth) { // X-axis scroll check
|
||||
s.x = 0;
|
||||
} else if (vX < 0 && s.x-storm.flakeLeftOffset < -storm.flakeWidth) {
|
||||
s.x = screenX-storm.flakeWidth-1; // flakeWidth;
|
||||
}
|
||||
s.refresh();
|
||||
yDiff = screenY+scrollY-s.y+storm.flakeHeight;
|
||||
if (yDiff<storm.flakeHeight) {
|
||||
s.active = 0;
|
||||
if (storm.snowStick) {
|
||||
s.stick();
|
||||
} else {
|
||||
s.recycle();
|
||||
}
|
||||
} else {
|
||||
if (storm.useMeltEffect && s.active && s.type < 3 && !s.melting && Math.random()>0.998) {
|
||||
// ~1/1000 chance of melting mid-air, with each frame
|
||||
s.melting = true;
|
||||
s.melt();
|
||||
// only incrementally melt one frame
|
||||
// s.melting = false;
|
||||
}
|
||||
if (storm.useTwinkleEffect) {
|
||||
if (s.twinkleFrame < 0) {
|
||||
if (Math.random() > 0.97) {
|
||||
s.twinkleFrame = parseInt(Math.random() * 8, 10);
|
||||
}
|
||||
} else {
|
||||
s.twinkleFrame--;
|
||||
if (!opacitySupported) {
|
||||
s.o.style.visibility = (s.twinkleFrame && s.twinkleFrame % 2 === 0 ? 'hidden' : 'visible');
|
||||
} else {
|
||||
s.o.style.opacity = (s.twinkleFrame && s.twinkleFrame % 2 === 0 ? 0 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.animate = function() {
|
||||
// main animation loop
|
||||
// move, check status, die etc.
|
||||
s.move();
|
||||
};
|
||||
|
||||
this.setVelocities = function() {
|
||||
s.vX = vRndX+rnd(storm.vMaxX*0.12,0.1);
|
||||
s.vY = vRndY+rnd(storm.vMaxY*0.12,0.1);
|
||||
};
|
||||
|
||||
this.setOpacity = function(o,opacity) {
|
||||
if (!opacitySupported) {
|
||||
return false;
|
||||
}
|
||||
o.style.opacity = opacity;
|
||||
};
|
||||
|
||||
this.melt = function() {
|
||||
if (!storm.useMeltEffect || !s.melting) {
|
||||
s.recycle();
|
||||
} else {
|
||||
if (s.meltFrame < s.meltFrameCount) {
|
||||
s.setOpacity(s.o,s.meltFrames[s.meltFrame]);
|
||||
s.o.style.fontSize = s.fontSize-(s.fontSize*(s.meltFrame/s.meltFrameCount))+'px';
|
||||
s.o.style.lineHeight = storm.flakeHeight+2+(storm.flakeHeight*0.75*(s.meltFrame/s.meltFrameCount))+'px';
|
||||
s.meltFrame++;
|
||||
} else {
|
||||
s.recycle();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.recycle = function() {
|
||||
s.o.style.display = 'none';
|
||||
s.o.style.position = (fixedForEverything?'fixed':'absolute');
|
||||
s.o.style.bottom = 'auto';
|
||||
s.setVelocities();
|
||||
s.vCheck();
|
||||
s.meltFrame = 0;
|
||||
s.melting = false;
|
||||
s.setOpacity(s.o,1);
|
||||
s.o.style.padding = '0px';
|
||||
s.o.style.margin = '0px';
|
||||
s.o.style.fontSize = s.fontSize+'px';
|
||||
s.o.style.lineHeight = (storm.flakeHeight+2)+'px';
|
||||
s.o.style.textAlign = 'center';
|
||||
s.o.style.verticalAlign = 'baseline';
|
||||
s.x = parseInt(rnd(screenX-storm.flakeWidth-20),10);
|
||||
s.y = parseInt(rnd(screenY)*-1,10)-storm.flakeHeight;
|
||||
s.refresh();
|
||||
s.o.style.display = 'block';
|
||||
s.active = 1;
|
||||
};
|
||||
|
||||
this.recycle(); // set up x/y coords etc.
|
||||
this.refresh();
|
||||
|
||||
};
|
||||
|
||||
this.snow = function() {
|
||||
var active = 0, flake = null, i, j;
|
||||
for (i=0, j=storm.flakes.length; i<j; i++) {
|
||||
if (storm.flakes[i].active === 1) {
|
||||
storm.flakes[i].move();
|
||||
active++;
|
||||
}
|
||||
if (storm.flakes[i].melting) {
|
||||
storm.flakes[i].melt();
|
||||
}
|
||||
}
|
||||
if (active<storm.flakesMaxActive) {
|
||||
flake = storm.flakes[parseInt(rnd(storm.flakes.length),10)];
|
||||
if (flake.active === 0) {
|
||||
flake.melting = true;
|
||||
}
|
||||
}
|
||||
if (storm.timer) {
|
||||
features.getAnimationFrame(storm.snow);
|
||||
}
|
||||
};
|
||||
|
||||
this.mouseMove = function(e) {
|
||||
if (!storm.followMouse) {
|
||||
return true;
|
||||
}
|
||||
var x = parseInt(e.clientX,10);
|
||||
if (x<screenX2) {
|
||||
windOffset = -windMultiplier+(x/screenX2*windMultiplier);
|
||||
} else {
|
||||
x -= screenX2;
|
||||
windOffset = (x/screenX2)*windMultiplier;
|
||||
}
|
||||
};
|
||||
|
||||
this.createSnow = function(limit,allowInactive) {
|
||||
var i;
|
||||
for (i=0; i<limit; i++) {
|
||||
storm.flakes[storm.flakes.length] = new storm.SnowFlake(parseInt(rnd(flakeTypes),10));
|
||||
if (allowInactive || i>storm.flakesMaxActive) {
|
||||
storm.flakes[storm.flakes.length-1].active = -1;
|
||||
}
|
||||
}
|
||||
storm.targetElement.appendChild(docFrag);
|
||||
};
|
||||
|
||||
this.timerInit = function() {
|
||||
storm.timer = true;
|
||||
storm.snow();
|
||||
};
|
||||
|
||||
this.init = function() {
|
||||
var i;
|
||||
for (i=0; i<storm.meltFrameCount; i++) {
|
||||
storm.meltFrames.push(1-(i/storm.meltFrameCount));
|
||||
}
|
||||
storm.randomizeWind();
|
||||
storm.createSnow(storm.flakesMax); // create initial batch
|
||||
storm.events.add(window,'resize',storm.resizeHandler);
|
||||
storm.events.add(window,'scroll',storm.scrollHandler);
|
||||
if (storm.freezeOnBlur) {
|
||||
if (isIE) {
|
||||
storm.events.add(document,'focusout',storm.freeze);
|
||||
storm.events.add(document,'focusin',storm.resume);
|
||||
} else {
|
||||
storm.events.add(window,'blur',storm.freeze);
|
||||
storm.events.add(window,'focus',storm.resume);
|
||||
}
|
||||
}
|
||||
storm.resizeHandler();
|
||||
storm.scrollHandler();
|
||||
if (storm.followMouse) {
|
||||
storm.events.add(isIE?document:window,'mousemove',storm.mouseMove);
|
||||
}
|
||||
storm.animationInterval = Math.max(20,storm.animationInterval);
|
||||
storm.timerInit();
|
||||
};
|
||||
|
||||
this.start = function(bFromOnLoad) {
|
||||
if (!didInit) {
|
||||
didInit = true;
|
||||
} else if (bFromOnLoad) {
|
||||
// already loaded and running
|
||||
return true;
|
||||
}
|
||||
if (typeof storm.targetElement === 'string') {
|
||||
var targetID = storm.targetElement;
|
||||
storm.targetElement = document.getElementById(targetID);
|
||||
if (!storm.targetElement) {
|
||||
throw new Error('Snowstorm: Unable to get targetElement "'+targetID+'"');
|
||||
}
|
||||
}
|
||||
if (!storm.targetElement) {
|
||||
storm.targetElement = (document.body || document.documentElement);
|
||||
}
|
||||
if (storm.targetElement !== document.documentElement && storm.targetElement !== document.body) {
|
||||
// re-map handler to get element instead of screen dimensions
|
||||
storm.resizeHandler = storm.resizeHandlerAlt;
|
||||
//and force-enable pixel positioning
|
||||
storm.usePixelPosition = true;
|
||||
}
|
||||
storm.resizeHandler(); // get bounding box elements
|
||||
storm.usePositionFixed = (storm.usePositionFixed && !noFixed && !storm.flakeBottom); // whether or not position:fixed is to be used
|
||||
if (window.getComputedStyle) {
|
||||
// attempt to determine if body or user-specified snow parent element is relatlively-positioned.
|
||||
try {
|
||||
targetElementIsRelative = (window.getComputedStyle(storm.targetElement, null).getPropertyValue('position') === 'relative');
|
||||
} catch(e) {
|
||||
// oh well
|
||||
targetElementIsRelative = false;
|
||||
}
|
||||
}
|
||||
fixedForEverything = storm.usePositionFixed;
|
||||
if (screenX && screenY && !storm.disabled) {
|
||||
storm.init();
|
||||
storm.active = true;
|
||||
}
|
||||
};
|
||||
|
||||
function doDelayedStart() {
|
||||
window.setTimeout(function() {
|
||||
storm.start(true);
|
||||
}, 20);
|
||||
// event cleanup
|
||||
storm.events.remove(isIE?document:window,'mousemove',doDelayedStart);
|
||||
}
|
||||
|
||||
function doStart() {
|
||||
if (!storm.excludeMobile || !isMobile) {
|
||||
doDelayedStart();
|
||||
}
|
||||
// event cleanup
|
||||
storm.events.remove(window, 'load', doStart);
|
||||
}
|
||||
|
||||
// hooks for starting the snow
|
||||
if (storm.autoStart) {
|
||||
storm.events.add(window, 'load', doStart, false);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
export default SnowStorm;
|
Loading…
Reference in New Issue
Block a user