278 lines
104 KiB
JavaScript
278 lines
104 KiB
JavaScript
/*
|
||
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
||
* This devtool is neither made for production nor for readable output files.
|
||
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
||
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||
* or disable the default devtool with "devtool: false".
|
||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||
*/
|
||
/******/ (() => { // webpackBootstrap
|
||
/******/ "use strict";
|
||
/******/ var __webpack_modules__ = ({
|
||
|
||
/***/ "./src/html/button.html":
|
||
/*!******************************!*\
|
||
!*** ./src/html/button.html ***!
|
||
\******************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<button class=\\\"april-fools__button\\\">🎉</button>\\n\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://mybb-april-fools/./src/html/button.html?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/html/styles.html":
|
||
/*!******************************!*\
|
||
!*** ./src/html/styles.html ***!
|
||
\******************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<style class=\\\"april-fools__styles\\\">\\n .april-fools__button {\\n position: fixed;\\n bottom: 0.2rem;\\n right: 0.2rem;\\n padding: 0;\\n font-size: 3rem;\\n border: 0 solid;\\n background: transparent none;\\n opacity: 0.3;\\n transition: 0.4s all;\\n cursor: pointer;\\n }\\n .april-fools__button:hover {\\n opacity: 1;\\n }\\n .april-fools__joke-row {\\n border-bottom: 1px solid black;\\n }\\n .april-fools__joke-row:first-of-type {\\n border-top: 1px solid black;\\n }\\n .april-fools__joke {\\n display: flex;\\n flex-flow: row wrap;\\n padding: 10px;\\n opacity: 0.5;\\n justify-content: space-between;\\n align-items: center;\\n gap: 1ch;\\n cursor: pointer;\\n }\\n .april-fools__joke:hover {\\n text-shadow: 0 0 black;\\n }\\n .april-fools__joke:before {\\n display: block;\\n content: \\\"\\\";\\n flex: 0 0 2ch;\\n text-align: center;\\n content: \\\"✔\\\";\\n opacity: 0;\\n }\\n input.april-fools__joke-input:checked + .april-fools__joke {\\n opacity: 1;\\n }\\n input.april-fools__joke-input:checked + .april-fools__joke:before {\\n opacity: 1;\\n }\\n .april-fools__joke .april-fools__joke-title {\\n flex: 1 auto;\\n font-weight: bold;\\n }\\n .april-fools__joke .april-fools__joke-description {\\n flex: 1 auto;\\n text-align: right;\\n }\\n .april-fools__joke .april-fools__joke-chance {\\n flex: 0 0 4ch;\\n text-align: right;\\n }\\n .april-fools__content .april-fools__reset-button {\\n display: block;\\n margin: 10px auto;\\n }\\n</style>\\n\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://mybb-april-fools/./src/html/styles.html?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/html/window.html":
|
||
/*!******************************!*\
|
||
!*** ./src/html/window.html ***!
|
||
\******************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<div class=\\\"april-fools__content\\\">\\n <div class=\\\"april-fools__jokes\\\"></div>\\n\\n <button class=\\\"april-fools__reset-button\\\">\\n Вернуться к настройкам форума (страница будет перезагружена!)\\n </button>\\n</div>\\n<template class=\\\"april-fools__template\\\" id=\\\"april-fools__window-row\\\">\\n <div class=\\\"april-fools__joke-row\\\">\\n <input\\n type=\\\"checkbox\\\"\\n class=\\\"april-fools__joke-input\\\"\\n name=\\\"april-fools__joke-${joke.id}\\\"\\n id=\\\"april-fools__joke-${joke.id}\\\"\\n style=\\\"display: none\\\"\\n />\\n <label class=\\\"april-fools__joke\\\" for=\\\"april-fools__joke-${joke.id}\\\">\\n <p class=\\\"april-fools__joke-title\\\">${joke.title}</p>\\n <p class=\\\"april-fools__joke-description\\\">${joke.description}</p>\\n <p class=\\\"april-fools__joke-chance\\\">${joke.settings.chance}%</p>\\n </label>\\n </div>\\n</template>\\n\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://mybb-april-fools/./src/html/window.html?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/common.ts":
|
||
/*!***********************!*\
|
||
!*** ./src/common.ts ***!
|
||
\***********************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getTextNodes\": () => (/* binding */ getTextNodes)\n/* harmony export */ });\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n\n/**\n * Получение всех элементов, являющимися TextNode.\n * Используется некоторыми шутками для уменьшения влияния на существующее DOM-дерево.\n */\nfunction getTextNodes(root) {\n return jquery__WEBPACK_IMPORTED_MODULE_0___default()(root)\n .find(\"*\")\n .contents()\n .filter((_, node) => node.nodeType === Node.TEXT_NODE);\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/common.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/data/stupid_title_variants.ts":
|
||
/*!*******************************************!*\
|
||
!*** ./src/data/stupid_title_variants.ts ***!
|
||
\*******************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StupidTitleDefaultVariants\": () => (/* binding */ StupidTitleDefaultVariants)\n/* harmony export */ });\n/* harmony import */ var _jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jokes/stupid_title */ \"./src/jokes/stupid_title.ts\");\n\nfunction StupidTitleDefaultVariants(vars) {\n vars.adj = Object.assign(Object.assign(Object.assign({}, (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(true, \"адекватный,$адский,активный,алчный,%ангельский,банальный,безнадёжный,$бесполезный,былой,верный,виртуальный,вкусный,воспитанный,выгодный,выходной,гигантский,$глупый,гордый,грамотный,громадный,грубый,далекий,двуличный,деятельный,доброжелательный,$жалкий,жёсткий,жестокий,$жирный,заинтересованный,запасной,застенчивый,знакомый,иностранный,истинный,конструктивный,креативный,ласковый,любимый,мелочный,^мирный,мстительный,небесный,невозможный,независимый,низкий,нужный,объективный,обыкновенный,опрятный,^оригинальный,особенный,острый,откровенный,открытый,пестрый,повседневный,подземный,пожилой,показательный,последний,посторонний,провинциальный,пышный,робкий,родной,самовлюблённый,северный,седой,семейный,серьёзный,сногсшибательный,^солнечный,спокойный,суровый,терпеливый,уверенный в себе,ударный,^удачливый,формальный,хладнокровный,целый,чистый,чрезвычайный,чужой,южный\")), (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(false, \"адекватная,$адская,активная,алчная,%ангельская,банальная,безнадёжная,$бесполезная,былая,верная,виртуальная,вкусная,воспитанная,выгодная,выходная,гигантская,$глупая,гордая,грамотная,громадная,грубая,далекая,двуличная,деятельная,доброжелательная,$жалкая,жёсткая,жестокая,$жирная,заинтересованная,запасная,застенчивая,знакомая,иностранная,истинная,конструктивная,креативная,ласковая,любимая,мелочная,^мирная,мстительная,небесная,невозможная,независимая,низкая,нужная,объективная,обыкновенная,опрятная,^оригинальная,особенная,острая,откровенная,открытая,пестрая,повседневная,подземная,пожилая,показательная,последняя,посторонняя,провинциальная,пышная,робкая,родная,самовлюблённая,северная,седая,семейная,серьезная,сногсшибательная,^солнечная,спокаяная,суровая,терпеливая,уверенная в себе,ударная,^удачливая,формальная,хладнокровная,целая,чистая,чрезвычайная,чужая,южная\")), vars.adj);\n vars.noun = Object.assign(Object.assign(Object.assign({}, (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(true, \"актёр,$балбес,бард,басурманин,борец,бродяга,бруталище,волк,дворф,%дед,%дедушка,джентльмен,диван,динозавр,дракон,ёж,%ёжик,жук,зайц,$злоумышленник,зомби,карасик,кентавр,кит,кот,кролик,кулак,лев,ледник,лесоруб,%мальчег,мальчик,манекен,массажист,мачо,монах,монстр,наследник,ниндзя,носорог,одиночка,организм,орёл,отец,принц,проказник,пузырь,$раб,рыцарь,спортсмен,сурикат,сын,%сынок,тигр,товарищ,хоббит,эльф\")), (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(false, \"актриса,акула,$бабка,бабочка,%бабушка,бактерия,белочка,бусинка,валькирия,$ведьма,волторна,волчица,горгулья,дворфиха,девочка,деревяшка,детка,%деффачка,%дочка,дочь,заноза,$злоумышленница,знаменитость,каруселька,килька,конфетка,косточка,кошка,красотка,крышка,леди,$личинка,львица,мать,машина,милашка,монашка,мышь,наследница,орлица,панда,пиранья,принцесса,простуда,$рабыня,русалочка,рыбка,рыбка,скамеечка,спортсменка,тигрица,травка,черепашка,чертовка,эльфийка\")), vars.noun);\n vars.verb = Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(null, \"бежит,берёт и делает,болеет,встаёт,говорит,думает,забывает,замирает,заходит,идёт,%имеет план и придерживается его,ловит,меняется,молчит,нарушает,оглядывается,орёт,освобождает,отвечает,отказаться куда-то идти,отказывается,отказывается вставать,отказывается что-то делать,оформляет,плывёт,поглядывает,поздравляет,поздравляет,получает,прибывает,приказывает,просыпается,прощает,работает,радуется,скрывается,снимает,снимает,снимается в сериале,снимается в фильме,собирается,соединяет,спрашивает,тянет,указывает,учит,читает,что-то скрывает,чувствует опасность,шепчет\")), (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(true, \"взял и сделал,додумался,женился,женится,заработался,не спал,не успел,обиделся,познал дзен,присел,проснулся,скрылся,смог,успел\")), (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(false, \"взяла и сделала,выходит замуж,вышла замуж,додумалась,заработалась,не спала,не успела,обиделась,познала дзен,присела,проснулась,скрылась,смогла,успела\")), vars.verb);\n vars.place = Object.assign(Object.assign({}, (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(null, \"в джунглях,в квартире,в космосе,в лесу,в очереди,в пустыне,в театре,%в тёплой и уютной квартире,в филармонии,где-то,на заснеженной вершине,на конференции,на пляже,на форуме,под водой,под дождём,%под проливным дождём\")), vars.place);\n vars.adv = Object.assign(Object.assign({}, (0,_jokes_stupid_title__WEBPACK_IMPORTED_MODULE_0__.BuildStupdiTitleVariant)(null, \"безрассудно,быстро,внезапно,вновь,$грубо,грустно,медленно,%молниеносно,немедленно,опять,осмысленно,позже,предсказуемо,расчётливо,регулярно,счастливо,уже,уныло\")), vars.adv);\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/data/stupid_title_variants.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/joke.ts":
|
||
/*!*********************!*\
|
||
!*** ./src/joke.ts ***!
|
||
\*********************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Joke\": () => (/* binding */ Joke),\n/* harmony export */ \"JokeSettings\": () => (/* binding */ JokeSettings),\n/* harmony export */ \"StopableJoke\": () => (/* binding */ StopableJoke)\n/* harmony export */ });\n/**\n * Объект настроек шутки\n */\nclass JokeSettings {\n constructor() {\n /**\n * Флаг блокировки срабатывания\n */\n this.enabled = true;\n /**\n * Вероятность срабатывания в процентах\n */\n this.chance = 20;\n }\n}\n/**\n * Объект, описывающий шутку\n */\nclass Joke {\n /**\n * Получение полного списка настроек\n */\n get settings() {\n return this._settings;\n }\n /**\n * Запись новых настроек\n *\n * @param settings\n */\n set settings(settings) {\n for (const entry of Object.entries(settings)) {\n const id = entry[0];\n const value = entry[1];\n switch (id) {\n case \"name\":\n case \"title\":\n this.title = value;\n break;\n case \"description\":\n this.description = value;\n break;\n default:\n this._settings[id] = value;\n }\n }\n }\n /**\n * Проверка вероятности\n *\n * @param {number} chance Вероятность срабатывания\n * @returns {boolean} Флаг срабатывания (true - сработало)\n */\n check(chance) {\n return Math.random() < 0.01 * chance;\n }\n /**\n * Разблокировать шутку\n */\n enable() {\n this.settings.enabled = true;\n }\n /**\n * Заблокировать шутку\n */\n disable() {\n this.settings.enabled = false;\n }\n /**\n * Переключить блокировку шутки\n * @param value Новое значение\n */\n toggle(value = null) {\n this.settings.enabled = value === null ? !this.settings.enabled : value;\n }\n}\n/**\n * Объект, описывающий шутку, которая может быть остановлена\n */\nclass StopableJoke extends Joke {\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/joke.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/joker.ts":
|
||
/*!**********************!*\
|
||
!*** ./src/joker.ts ***!
|
||
\**********************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JokerClass\": () => (/* binding */ JokerClass)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./joke */ \"./src/joke.ts\");\n/* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ui */ \"./src/ui.ts\");\n\n\n/**\n * Блок обработки перво-апрельских шуток\n *\n * @author Kozhilya\n */\nclass JokerClass {\n constructor() {\n this.ui = new _ui__WEBPACK_IMPORTED_MODULE_1__.JokerUI(this);\n /**\n * Общие настройки системы\n */\n this.core_settings = new CoreSettings();\n /**\n * Перечисление всех шуток\n */\n this.jokes = {};\n }\n /**\n * Проверка вероятности\n *\n * @param {number} chance Вероятность срабатывания\n * @returns {boolean} Флаг срабатывания (true - сработало)\n */\n check(chance) {\n return Math.random() < 0.01 * chance;\n }\n /**\n * Добавление шутки\n *\n * @param joke Объект шутки\n */\n add(joke) {\n this.jokes[joke.id] = joke;\n }\n /**\n * Регистрация новой шутки\n *\n * @param id Идентификатор шутки\n * @param handler Метод, выполняющий шутку\n * @param settings Объект настроек шутки\n */\n addCustom(id, handler, settings = null) {\n const joke = new (class extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = id;\n this.title = \"Пользовательская шутка\";\n this.description = \"Для шутки не определено описание\";\n this._settings = new _joke__WEBPACK_IMPORTED_MODULE_0__.JokeSettings();\n }\n start() {\n handler.call(this, this.settings);\n }\n })();\n joke.settings = settings;\n this.add(joke);\n return joke;\n }\n /**\n * Получение полного списка настроек\n */\n get settings() {\n const result = {};\n result[\"core\"] = this.core_settings;\n for (const entries of Object.entries(this.jokes)) {\n const id = entries[0];\n const joke = entries[1];\n result[id] = joke.settings;\n }\n return result;\n }\n /**\n * Запись новых настроек\n *\n * @param settings\n */\n set settings(settings) {\n for (const entry of Object.entries(settings)) {\n const id = entry[0];\n const jokeSettings = entry[1];\n const targetSettings = id === \"core\" ? this.core_settings : this.jokes[id].settings;\n Object.assign(targetSettings, jokeSettings);\n }\n }\n /**\n * Разблокировать систему\n */\n enable() {\n this.core_settings.enabled = true;\n }\n /**\n * Заблокировать систему\n */\n disable() {\n this.core_settings.enabled = false;\n }\n /**\n * Разблокировать все шутки\n */\n enableAll() {\n for (const key of Object.keys(this.jokes)) {\n this.jokes[key].enable();\n }\n }\n /**\n * Заблокировать все шутки\n */\n disableAll() {\n for (const key of Object.keys(this.jokes)) {\n this.jokes[key].disable();\n }\n }\n /**\n * Переключение шутки\n */\n toggleJoke(joke_id, state) {\n const joke = this.jokes[joke_id];\n joke.settings.enabled = state;\n if (joke instanceof _joke__WEBPACK_IMPORTED_MODULE_0__.StopableJoke && !state) {\n joke.stop();\n }\n this.saveUserStates();\n }\n /**\n * Сохранение пользовательских настроек\n */\n saveUserStates() {\n const states = {};\n for (const key of Object.keys(this.jokes)) {\n states[key] = this.jokes[key].settings.enabled;\n }\n fetch(\"/api.php?\" +\n $.param({\n method: \"storage.set\",\n user_id: window.UserID,\n key: \"april-fools\",\n token: window.ForumAPITicket,\n value: JSON.stringify(states),\n timer: 24 * 60,\n }));\n }\n /**\n * Загрузка пользовательских настроек\n */\n async loadUserStates() {\n const response = await fetch(\"/api.php?\" +\n $.param({\n method: \"storage.get\",\n user_id: window.UserID,\n key: \"april-fools\",\n }));\n const json = await response.json();\n if (json.error) {\n return;\n }\n const data = JSON.parse(json.response.storage.data[\"april-fools\"]);\n for (const key of Object.keys(this.jokes)) {\n this.jokes[key].settings.enabled = data[key];\n }\n }\n async clearUserStates() {\n await fetch(\"/api.php?\" +\n $.param({\n method: \"storage.delete\",\n user_id: window.UserID,\n key: \"april-fools\",\n token: window.ForumAPITicket,\n }));\n return;\n }\n /**\n * Запуск шутки\n *\n * @param id\n * @param {boolean} forced\n */\n start(id, forced = false) {\n if (!(id in this.jokes))\n return;\n const joke = this.jokes[id];\n if (!forced &&\n (!joke.settings.enabled || !this.check(joke.settings.chance))) {\n return;\n }\n joke.start();\n }\n /**\n * Запуск всех шуток\n */\n startAll(forced = false) {\n for (const key of Object.keys(this.jokes)) {\n this.start(key, forced);\n }\n }\n regularCheck() {\n if (!this.core_settings.enabled) {\n return false;\n }\n if (this.core_settings.testers.indexOf(window.UserID) >= 0) {\n return true;\n }\n const today = new Date();\n const month = today.getMonth() + 1;\n const day = today.getDate();\n if (month !== 4 || day !== 1) {\n return false;\n }\n return this.check(this.core_settings.chance);\n }\n async regularStart() {\n if (!this.regularCheck()) {\n return;\n }\n await this.loadUserStates();\n this.ui.show();\n this.startAll();\n }\n}\nclass CoreSettings {\n constructor() {\n this.chance = 100;\n this.enabled = true;\n this.testers = [];\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/joker.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/carnival.ts":
|
||
/*!*******************************!*\
|
||
!*** ./src/jokes/carnival.ts ***!
|
||
\*******************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CarnivalJoke\": () => (/* binding */ CarnivalJoke),\n/* harmony export */ \"CarnivalJokeSettings\": () => (/* binding */ CarnivalJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * **Карнавал**\n *\n * Аватарки приобретают интересные цвета\n *\n * @author Kozhilya\n */\nclass CarnivalJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = \"carnival\";\n this.title = \"Карнавал\";\n this.description = \"Аватарки приобретают интересные цвета\";\n this._settings = new CarnivalJokeSettings();\n }\n start() {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each((_, elem) => {\n const filters = [];\n for (const entry of Object.entries(this.settings.variants)) {\n if (!this.check(this.settings.variant_chance)) {\n continue;\n }\n filters.push(entry[0].replace(\"{0}\", Math.round(Math.random() * entry[1]).toString()));\n }\n if (filters.length > 0) {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).css({ filter: filters.join(\" \") });\n }\n });\n }\n}\nclass CarnivalJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 30;\n /**\n * Селектор всех элементов, которые будут перекрашены\n */\n this.selector = 'img[src*=\"/avatars/\"]';\n /**\n * Вероятность применения некоторого фильтра\n */\n this.variant_chance = 20;\n /**\n * Список фильтров и диапозона случайных параметров\n */\n this.variants = {\n \"sepia({0}%)\": 100,\n \"saturate({0}%)\": 100,\n \"hue-rotate({0}deg)\": 360,\n \"invert({0}%)\": 100,\n };\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/carnival.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/crazy_letters.ts":
|
||
/*!************************************!*\
|
||
!*** ./src/jokes/crazy_letters.ts ***!
|
||
\************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CrazyLettersJoke\": () => (/* binding */ CrazyLettersJoke),\n/* harmony export */ \"CrazyLettersJokeSettings\": () => (/* binding */ CrazyLettersJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * **Мама, Я сОшЛа С уМа!**\n *\n * иМеНа ЗаБоРчИкОм\n *\n * @author Kozhilya\n */\nclass CrazyLettersJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = \"crazy_letters\";\n this.title = \"Мама, Я сОшЛа С уМа!\";\n this.description = \"иМеНа ЗаБоРчИкОм\";\n this._settings = new CrazyLettersJokeSettings();\n }\n start() {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each((_, elem) => {\n let text = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this).text();\n let result = \"\";\n for (let i = 0; i < text.length; i++) {\n result += text[i][i % 2 ? \"toLowerCase\" : \"toUpperCase\"]();\n }\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this).text(result);\n });\n }\n}\nclass CrazyLettersJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = \".pa-author a\";\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/crazy_letters.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/cursor.ts":
|
||
/*!*****************************!*\
|
||
!*** ./src/jokes/cursor.ts ***!
|
||
\*****************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CursorEffectsJoke\": () => (/* binding */ CursorEffectsJoke),\n/* harmony export */ \"CursorEffectsJokeSettings\": () => (/* binding */ CursorEffectsJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n\n// import * as cursor_effects from \"cursor-effects\";\nconst cursor_effects = __webpack_require__(/*! cursor-effects */ \"./node_modules/cursor-effects/dist/cjs.cjs\");\n/**\n * **Красивый курсор**\n *\n * Эффекты, следующие за курсором\n *\n * @author Tim Holman\n * @link https://tholman.com/cursor-effects/\n */\nclass CursorEffectsJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.StopableJoke {\n constructor() {\n super(...arguments);\n this.id = \"cursor_effects\";\n this.title = \"Красивый курсор\";\n this.description = \"Эффекты, следующие за курсором\";\n this._settings = new CursorEffectsJokeSettings();\n }\n /**\n * Разблокировать все варианты курсоров\n */\n enableAll() {\n for (const key of Object.keys(this.settings.effects)) {\n this.settings.effects[key].enabled = true;\n }\n }\n /**\n * Заблокировать все варианты курсоров\n */\n disableAll() {\n for (const key of Object.keys(this.settings.effects)) {\n this.settings.effects[key].enabled = false;\n }\n }\n weight(effect) {\n const s = this.settings.effects[effect];\n return s.enabled ? s.weight : 0;\n }\n getRandomEffect() {\n const elements = Object.values(CursorEffectsEnum).map((e) => e);\n const totalWeight = elements.reduce((sum, element) => sum + this.weight(element), 0);\n const randomWeight = Math.random() * totalWeight;\n let currentWeight = 0;\n for (const element of elements) {\n currentWeight += this.weight(element);\n if (randomWeight <= currentWeight) {\n return element;\n }\n }\n throw new Error(\"Тебя быть тут не должно...\");\n }\n start() {\n const effect = this.getRandomEffect();\n const settings = this.settings.effects[effect];\n this.active_cursor_effect = resolveCursorEffectsEnum(effect, settings);\n }\n stop() {\n this.active_cursor_effect.destroy();\n }\n}\nvar CursorEffectsEnum;\n(function (CursorEffectsEnum) {\n CursorEffectsEnum[\"Rainbow\"] = \"rainbow\";\n CursorEffectsEnum[\"FairyDust\"] = \"fairy_dust\";\n CursorEffectsEnum[\"SpringyEmoji\"] = \"springy_emoji\";\n CursorEffectsEnum[\"Emoji\"] = \"emoji\";\n CursorEffectsEnum[\"Ghost\"] = \"ghost\";\n CursorEffectsEnum[\"Trailing\"] = \"trailing\";\n CursorEffectsEnum[\"TextFlag\"] = \"text_flag\";\n CursorEffectsEnum[\"FollowingDot\"] = \"following_dot\";\n CursorEffectsEnum[\"Bubbles\"] = \"bubbles\";\n CursorEffectsEnum[\"Snowflake\"] = \"snowflake\";\n CursorEffectsEnum[\"Clock\"] = \"clock\";\n})(CursorEffectsEnum || (CursorEffectsEnum = {}));\nfunction resolveCursorEffectsEnum(effect, options) {\n switch (effect) {\n case CursorEffectsEnum.Rainbow:\n return cursor_effects.rainbowCursor(options);\n case CursorEffectsEnum.FairyDust:\n return cursor_effects.fairyDustCursor(options);\n case CursorEffectsEnum.SpringyEmoji:\n return cursor_effects.springyEmojiCursor(options);\n case CursorEffectsEnum.Emoji:\n return cursor_effects.emojiCursor(options);\n case CursorEffectsEnum.Ghost:\n return cursor_effects.ghostCursor(options);\n case CursorEffectsEnum.Trailing:\n return cursor_effects.trailingCursor(options);\n case CursorEffectsEnum.TextFlag:\n return cursor_effects.textFlag(options);\n case CursorEffectsEnum.FollowingDot:\n return cursor_effects.followingDotCursor(options);\n case CursorEffectsEnum.Bubbles:\n return cursor_effects.bubbleCursor(options);\n case CursorEffectsEnum.Snowflake:\n return cursor_effects.snowflakeCursor(options);\n case CursorEffectsEnum.Clock:\n return cursor_effects.clockCursor(options);\n }\n}\nclass CursorEffectsJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 100;\n this.effects = {\n /**\n * Радужный след за курсором\n */\n [CursorEffectsEnum.Rainbow]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Длина полосы\n */\n this.length = 20;\n /**\n * Ширина полосы\n */\n this.size = 3;\n /**\n * Цвета полос (сверху вниз)\n */\n this.colors = [\n \"#9400D3\",\n \"#4B0082\",\n \"#0000FF\",\n \"#00FF00\",\n \"#FFFF00\",\n \"#FF7F00\",\n \"#FF0000\",\n ];\n }\n })(),\n /**\n * Цепочка из эмодзи \"на резинке\" под курсором\n */\n [CursorEffectsEnum.SpringyEmoji]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Висящий эмодзи\n */\n this.emoji = \"🤪\";\n }\n })(),\n /**\n * Падающие от курсора эмодзи\n */\n [CursorEffectsEnum.Emoji]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Падающие эмодзи\n */\n this.emoji = [\"🔥\", \"🐬\", \"🦆\"];\n }\n })(),\n /**\n * Падающие от курсора пылинки\n */\n [CursorEffectsEnum.FairyDust]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Цвет пылинок\n */\n this.colors = [\"#ff0000\", \"#00ff00\", \"#0000ff\"];\n }\n })(),\n /**\n * След \"зависших\" курсоров\n */\n [CursorEffectsEnum.Ghost]: new DefaultCursorEffectsSetting(),\n /**\n * След курсоров \"на резинке\"\n */\n [CursorEffectsEnum.Trailing]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Количество элементов\n */\n this.particles = 15;\n /**\n * Скорость частиц\n */\n this.rate = 0.4;\n /**\n * Ссылка на картинку с курсором\n * Используйте `null`, что бы использовать картинку курсора по умолчанию\n */\n this.baseImageSrc = null;\n }\n })(),\n /**\n * Текст, развивающийся флагом от курсора\n */\n [CursorEffectsEnum.TextFlag]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Отображаемый текст\n */\n this.text = \"С днём смеха!\";\n /**\n * Цвет текста\n */\n this.color = \"#000000\";\n /**\n * Шрифт текста\n */\n this.font = \"monospace\";\n /**\n * Размер текста\n */\n this.textSize = 12;\n /**\n * Растояние между бквами\n */\n this.gap = 14;\n /**\n * Размер... чего-то.\n */\n this.size = 3;\n }\n })(),\n /**\n * Точка, преследующая курсор\n */\n [CursorEffectsEnum.FollowingDot]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Цвет догоняющей точки\n */\n this.color = \"#323232a6\";\n }\n })(),\n /**\n * Пузырьки от курсора\n */\n [CursorEffectsEnum.Bubbles]: new DefaultCursorEffectsSetting(),\n /**\n * Снежинки, летящие от курсора\n *\n * Отключено, потому что сейчас не зима :D\n */\n [CursorEffectsEnum.Snowflake]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n this.weight = 0;\n }\n })(),\n /**\n * Циферблат вокруг курсора\n */\n [CursorEffectsEnum.Clock]: new (class extends DefaultCursorEffectsSetting {\n constructor() {\n super(...arguments);\n /**\n * Цвет даты\n */\n this.dateColor = \"blue\";\n /**\n * Цвет циферблата\n */\n this.faceColor = \"black\";\n /**\n * Цвет секундной стрелки\n */\n this.secondsColor = \"red\";\n /**\n * Цвет минутной стрелки\n */\n this.minutesColor = \"black\";\n /**\n * Цвет часовой стрелки\n */\n this.hoursColor = \"black\";\n }\n })(),\n };\n }\n}\nclass DefaultCursorEffectsSetting {\n constructor() {\n /**\n * Флаг возможности срабатывания\n */\n this.enabled = true;\n /**\n * Весовой коэффициент вероятности курсора\n */\n this.weight = 50;\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/cursor.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/humanitarian_hell.ts":
|
||
/*!****************************************!*\
|
||
!*** ./src/jokes/humanitarian_hell.ts ***!
|
||
\****************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HumanitarianHellJoke\": () => (/* binding */ HumanitarianHellJoke),\n/* harmony export */ \"HumanitarianHellJokeSettings\": () => (/* binding */ HumanitarianHellJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ \"./src/common.ts\");\n\n\n/**\n * **Ад гуманитария**\n *\n * Все \"тся\" заменяются на \"ться\", а все \"ться\" на \"тся\"\n *\n * @author Kozhilya\n */\nclass HumanitarianHellJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = \"humanitarian_hell\";\n this.title = \"Ад гуманитария\";\n this.description = 'Все \"тся\" заменяются на \"ться\", а все \"ться\" на \"тся\"';\n this._settings = new HumanitarianHellJokeSettings();\n }\n processText(text) {\n return text.replace(/(ть?ся)/g, function (fnd) {\n return fnd.indexOf(\"ь\") > 0 ? \"тся\" : \"ться\";\n });\n }\n start() {\n const textNodes = (0,_common__WEBPACK_IMPORTED_MODULE_1__.getTextNodes)(this.settings.selector);\n textNodes.each((_, elem) => {\n elem.textContent = this.processText(elem.textContent);\n });\n }\n}\nclass HumanitarianHellJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = \".post-content\";\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/humanitarian_hell.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/letter_chaos.ts":
|
||
/*!***********************************!*\
|
||
!*** ./src/jokes/letter_chaos.ts ***!
|
||
\***********************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LetterChaosJoke\": () => (/* binding */ LetterChaosJoke),\n/* harmony export */ \"LetterChaosJokeSettings\": () => (/* binding */ LetterChaosJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ \"./src/common.ts\");\n\n\n/**\n * **Буквенный хаос**\n *\n * Все буквы в словах, кроме первой и последней, перемешены\n *\n * @author Kozhilya\n */\nclass LetterChaosJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = \"letter_chaos\";\n this.title = \"Буквенный хаос\";\n this.description = \"Все буквы в словах, кроме первой и последней, перемешены\";\n this._settings = new LetterChaosJokeSettings();\n this.punctuationSymbols = null;\n }\n shuffleLetters(word) {\n // Check if the word has two or more letters\n if (word.length < 3 || !this.check(this.settings.shuffle_chance)) {\n return word;\n }\n // Split the word into an array of characters\n const characters = word.split(\"\");\n // Shuffle the characters between the first and last letters\n const middleCharacters = characters.slice(1, -1);\n for (let i = middleCharacters.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [middleCharacters[i], middleCharacters[j]] = [\n middleCharacters[j],\n middleCharacters[i],\n ];\n }\n // Join the shuffled characters back into a word\n return [\n characters[0],\n ...middleCharacters,\n characters[characters.length - 1],\n ].join(\"\");\n }\n processNode(node) {\n var _a;\n node.textContent = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.replace(/([А-Яа-яA-Za-z]+)/gm, (_, word) => this.shuffleLetters(word));\n }\n start() {\n const textNodes = (0,_common__WEBPACK_IMPORTED_MODULE_1__.getTextNodes)(this.settings.selector);\n textNodes.each((_, node) => this.processNode(node));\n }\n}\nclass LetterChaosJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = \".post-content\";\n /**\n * Вероятность того, что буквы будут перемешаны\n */\n this.shuffle_chance = 50;\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/letter_chaos.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/mirror.ts":
|
||
/*!*****************************!*\
|
||
!*** ./src/jokes/mirror.ts ***!
|
||
\*****************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MirrorJoke\": () => (/* binding */ MirrorJoke),\n/* harmony export */ \"MirrorJokeSettings\": () => (/* binding */ MirrorJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * **Зеркало**\n *\n * Элементы форума отражаются (по крайней мере, пытаются)\n *\n * @author Kozhilya\n */\nclass MirrorJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = \"mirror\";\n this.title = \"Зеркало\";\n this.description = \"Элементы форума отражаются (по крайней мере, пытаются)\";\n this._settings = new MirrorJokeSettings();\n }\n start() {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".post, .post h3, .post-links, .post-author, .post-content\")\n .css(\"transform\", \"scaleX(-1)\")\n .css(\"-moz-transform\", \"scaleX(-1)\")\n .css(\"-moz-transform\", \"scaleX(-1)\")\n .css(\"filter\", \"FlipH\")\n .css(\"-ms-filter\", '\"FlipH\"');\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".post-links, .post-links ul, .post h3 span\").css(\"margin-left\", \"0\");\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".post h3 span\").css(\"margin-right\", \"25em\");\n }\n}\nclass MirrorJokeSettings {\n constructor() {\n this.enabled = false;\n this.chance = 30;\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/mirror.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/shake.ts":
|
||
/*!****************************!*\
|
||
!*** ./src/jokes/shake.ts ***!
|
||
\****************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ShakeJoke\": () => (/* binding */ ShakeJoke),\n/* harmony export */ \"ShakeJokeSettings\": () => (/* binding */ ShakeJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * **Форумо-трясение**\n *\n * Страница форума начинает трястись\n *\n * @author Kozhilya\n */\nclass ShakeJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.StopableJoke {\n constructor() {\n super(...arguments);\n this.id = \"shake\";\n this.title = \"Форумо-трясение\";\n this.description = \"Страница форума начинает трястись\";\n this._settings = new ShakeJokeSettings();\n this.data_name = \"april-fools-shake\";\n }\n rand(a) {\n return a + this.settings.force * (Math.random() * 2 - 1);\n }\n start() {\n this.items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector);\n this.items.each((_, elem) => {\n let data = {};\n this.settings.directions.forEach((d) => {\n data[d] = parseInt(jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).css(\"margin-\" + d));\n });\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).data(this.data_name, data);\n });\n this.interval_id = setInterval(() => {\n this.items.each((_, elem) => {\n const data = jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).data(this.data_name);\n for (const entry of Object.entries(data)) {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).css(\"margin-\" + entry[0], this.rand(entry[1]));\n }\n });\n }, this.settings.interval);\n }\n stop() {\n clearInterval(this.interval_id);\n this.items.each((_, elem) => {\n let data = {};\n this.settings.directions.forEach((d) => {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).css(\"margin-\" + d, data[d]);\n });\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).data(this.data_name, data);\n });\n }\n}\nclass ShakeJokeSettings {\n constructor() {\n this.enabled = false;\n this.chance = 1;\n /**\n * Направление тряски (тряска происходит путём изменения перечисленных направлений margin на значение ±force от стандартного значения)\n */\n this.directions = [\"top\", \"left\", \"bottom\", \"left\"];\n /**\n * Сила тряски - насколько отклоняется элемент от стандартного значения\n */\n this.force = 0.5;\n /**\n * Селектор всех элементов, которые будут трястись\n */\n this.selector = \"[id^=pun]\";\n /**\n * Частота тряски\n */\n this.interval = 100;\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/shake.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/jokes/stupid_title.ts":
|
||
/*!***********************************!*\
|
||
!*** ./src/jokes/stupid_title.ts ***!
|
||
\***********************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BuildStupdiTitleVariant\": () => (/* binding */ BuildStupdiTitleVariant),\n/* harmony export */ \"StupidTitleJoke\": () => (/* binding */ StupidTitleJoke),\n/* harmony export */ \"StupidTitleJokeSettings\": () => (/* binding */ StupidTitleJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _data_stupid_title_variants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../data/stupid_title_variants */ \"./src/data/stupid_title_variants.ts\");\n\n\n\n/**\n * **Глупые статусы**\n *\n * Каждому пользователю даётся новый глупый статус\n *\n * @author Kozhilya\n */\nclass StupidTitleJoke extends _joke__WEBPACK_IMPORTED_MODULE_0__.Joke {\n constructor() {\n super(...arguments);\n this.id = \"stupid_title\";\n this.title = \"Глупые статусы\";\n this.description = \"Каждому пользователю даётся новый глупый статус\";\n this._settings = new StupidTitleJokeSettings();\n this.loadedGenders = null;\n this.variantsGenerated = false;\n this.seed = 0;\n }\n async loadGenders() {\n const names = jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".pa-author a\")\n .map((_, elem) => elem.innerText)\n .toArray()\n .reduce((arr, name) => {\n if (arr.indexOf(name) < 0) {\n arr.push(name);\n }\n return arr;\n }, []);\n const url = \"/api.php?\" +\n jquery__WEBPACK_IMPORTED_MODULE_1___default().param({ method: \"users.get\", fields: \"username,sex\", username: names });\n const response = await fetch(url);\n const json = await response.json();\n this.loadedGenders = {};\n if (json.error) {\n return;\n }\n json.response.users.forEach((element) => {\n if (element.sex === \"0\") {\n return;\n }\n this.loadedGenders[element.username] = element.sex === \"1\";\n });\n }\n resolveGender(name) {\n if (this.settings.gender_resolver !== null) {\n return !!this.settings.gender_resolver.call(this, name);\n }\n if (name in this.loadedGenders) {\n return !!this.loadedGenders[name];\n }\n this.resetSeed();\n return this.selectRandom(name, { m: 1, f: 1 }) === \"m\";\n }\n async start() {\n if (!this.variantsGenerated) {\n (0,_data_stupid_title_variants__WEBPACK_IMPORTED_MODULE_2__.StupidTitleDefaultVariants)(this.settings.variants);\n this.variantsGenerated = true;\n }\n await this.loadGenders();\n const cache = {};\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".post-author\").each((_, root) => {\n const name = jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".pa-author a\", root).text();\n if (!name) {\n return;\n }\n if (!(name in cache)) {\n this.resetSeed();\n cache[name] = this.generatePhrase(name);\n }\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(\".pa-title\", root).text(cache[name]);\n });\n }\n prng(name, seed, limit) {\n /*\n https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js\n \n cyrb53 (c) 2018 bryc (github.com/bryc)\n A fast and simple hash function with decent collision resistance.\n Largely inspired by MurmurHash2/3, but with a focus on speed/simplicity.\n Public domain. Attribution appreciated.\n */\n let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;\n for (let i = 0, ch; i < name.length; i++) {\n ch = name.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 =\n Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^\n Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 =\n Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^\n Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n const value = 4294967296 * (2097151 & h2) + (h1 >>> 0);\n return Math.floor(Math.pow(Math.sin(value), 2) * limit) % limit;\n }\n resetSeed() {\n const date = new Date();\n const time = date.getUTCHours() * 60 + date.getUTCMinutes();\n if (this.settings.change_frequency === 0) {\n this.seed = time * 60 + date.getUTCSeconds();\n return;\n }\n this.seed = Math.floor(time / this.settings.change_frequency);\n }\n selectRandom(name, variants) {\n const elements = Object.keys(variants);\n const totalWeight = elements.reduce((sum, element) => sum + variants[element], 0);\n const randomWeight = this.prng(name, this.seed++, totalWeight);\n let currentWeight = 0;\n for (const element of elements) {\n currentWeight += variants[element];\n if (randomWeight <= currentWeight) {\n return element;\n }\n }\n throw new Error(\"Тебя быть тут не должно...\");\n }\n buildVariants(type, gender) {\n const result = {};\n const variants = this.settings.variants[type];\n for (const iterator of Object.entries(variants)) {\n const word = iterator[0];\n const wordSettings = iterator[1];\n if (!wordSettings.enabled || wordSettings.gender === !gender) {\n continue;\n }\n if (!this.settings.rude && wordSettings.rude) {\n continue;\n }\n result[word] = wordSettings.weight;\n }\n return result;\n }\n capitalizeFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n generatePhrase(name) {\n const gender = this.resolveGender(name);\n const prhase = this.selectRandom(name, this.settings.schemas);\n return this.capitalizeFirst(prhase.replace(/\\{(.+?)\\}/g, (_, type) => {\n const variants = this.buildVariants(type, gender);\n return this.selectRandom(name, variants);\n }));\n }\n}\nclass StupidTitleJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 100;\n /**\n * Определение пола по имени.\n * По умолчанию род устанавливается случайным образом\n *\n * Если установлено значение `null`, система попытается загрузить пол, установленный в настройках аккаунта. Если этот пол определить невозможно, то он будет выбран случайно. Эта настройка позволяет изменить это поведение, если ваш форум обладает ролевой системой, в которой пол определяется иным образом.\n *\n * @param name Имя персонажа\n * @returns true, если мужской род; false, если женский род\n */\n this.gender_resolver = null;\n /**\n * Разрешить возможно оскорбительные варианты\n */\n this.rude = false;\n /**\n * Частота смены статусов (в минутах)\n * Установите значение 0, что бы обновление происходило при каждом обновлении страницы\n */\n this.change_frequency = 5;\n /**\n * Разрешённые схемы формирования статусов\n *\n * {adj} - прилагательное\n * {noun} - имя существительно\n * {verb} - глагол\n * {adv} - наречие\n * {place} - дополнение места\n * {p} - знак препинания\n */\n this.schemas = {\n \"{adj} {noun}{p}\": 10,\n \"{noun} {adj}{p}\": 3,\n \"{adj}, {adj} {noun}{p}\": 10,\n \"{adj} и очень {adj} {noun}{p}\": 10,\n \"{adj} {noun} {verb}{p}\": 10,\n \"{adj} {noun} {adv} {verb}{p}\": 5,\n \"{adj} {noun} {verb} {place}{p}\": 5,\n \"{adj} {noun} {adv} {verb} {place}{p}\": 5,\n };\n /**\n * Вариант слов\n * Смотрите раздел описания скрипта, что бы настроить это поле\n */\n this.variants = {\n adj: {},\n noun: {},\n verb: {},\n place: {},\n adv: {},\n p: {\n \"\": new StupidTitleSetting({ weight: 10 }),\n \".\": new StupidTitleSetting({ weight: 10 }),\n \"...\": new StupidTitleSetting({ weight: 5 }),\n \"!\": new StupidTitleSetting({ weight: 5 }),\n \"!!!\": new StupidTitleSetting({ weight: 2 }),\n \"?\": new StupidTitleSetting({ weight: 2 }),\n \"?!\": new StupidTitleSetting({ weight: 1 }),\n },\n };\n }\n}\nclass StupidTitleSetting {\n constructor(options = new Object()) {\n this.weight = 10;\n this.enabled = true;\n this.rude = false;\n this.gender = null;\n for (const iterator of Object.entries(options)) {\n if (iterator[0] in this) {\n this[iterator[0]] = iterator[1];\n }\n }\n }\n}\nfunction BuildStupdiTitleVariant(gender, input) {\n const result = {};\n const words = input.split(\",\").map((word) => word.trim());\n words.forEach((word) => {\n const clean_word = word.replace(/[^А-ЯЁа-яёA-Za-z\\- ]/g, \"\");\n if (clean_word === \"\") {\n return;\n }\n result[clean_word] = new StupidTitleSetting({\n gender,\n rude: word.indexOf(\"$\") >= 0,\n enabled: word.indexOf(\"!\") < 0,\n weight: 10 *\n (word.indexOf(\"$\") >= 0 ? 0.5 : 1) *\n (word.indexOf(\"%\") >= 0 ? 0.5 : 1) *\n (word.indexOf(\"^\") >= 0 ? 2 : 1),\n });\n });\n return result;\n}\nwindow.BuildStupdiTitleVariant = BuildStupdiTitleVariant;\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/stupid_title.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/main.ts":
|
||
/*!*********************!*\
|
||
!*** ./src/main.ts ***!
|
||
\*********************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _joker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./joker */ \"./src/joker.ts\");\n/* harmony import */ var _jokes_shake__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jokes/shake */ \"./src/jokes/shake.ts\");\n/* harmony import */ var _jokes_humanitarian_hell__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jokes/humanitarian_hell */ \"./src/jokes/humanitarian_hell.ts\");\n/* harmony import */ var _jokes_mirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jokes/mirror */ \"./src/jokes/mirror.ts\");\n/* harmony import */ var _jokes_carnival__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./jokes/carnival */ \"./src/jokes/carnival.ts\");\n/* harmony import */ var _jokes_crazy_letters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./jokes/crazy_letters */ \"./src/jokes/crazy_letters.ts\");\n/* harmony import */ var _jokes_letter_chaos__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./jokes/letter_chaos */ \"./src/jokes/letter_chaos.ts\");\n/* harmony import */ var _jokes_cursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jokes/cursor */ \"./src/jokes/cursor.ts\");\n/* harmony import */ var _jokes_stupid_title__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./jokes/stupid_title */ \"./src/jokes/stupid_title.ts\");\n\n\n\n\n\n\n\n\n\nwindow.AprilJokes = ((jokes) => {\n const cl = new _joker__WEBPACK_IMPORTED_MODULE_0__.JokerClass();\n jokes.forEach((joke) => {\n cl.add(new joke());\n });\n $(() => cl.regularStart());\n return cl;\n})([\n _jokes_shake__WEBPACK_IMPORTED_MODULE_1__.ShakeJoke,\n _jokes_humanitarian_hell__WEBPACK_IMPORTED_MODULE_2__.HumanitarianHellJoke,\n _jokes_mirror__WEBPACK_IMPORTED_MODULE_3__.MirrorJoke,\n _jokes_carnival__WEBPACK_IMPORTED_MODULE_4__.CarnivalJoke,\n _jokes_crazy_letters__WEBPACK_IMPORTED_MODULE_5__.CrazyLettersJoke,\n _jokes_letter_chaos__WEBPACK_IMPORTED_MODULE_6__.LetterChaosJoke,\n _jokes_cursor__WEBPACK_IMPORTED_MODULE_7__.CursorEffectsJoke,\n _jokes_stupid_title__WEBPACK_IMPORTED_MODULE_8__.StupidTitleJoke,\n]);\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/main.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/ui.ts":
|
||
/*!*******************!*\
|
||
!*** ./src/ui.ts ***!
|
||
\*******************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JokerUI\": () => (/* binding */ JokerUI)\n/* harmony export */ });\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _html_button_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./html/button.html */ \"./src/html/button.html\");\n/* harmony import */ var _html_styles_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./html/styles.html */ \"./src/html/styles.html\");\n/* harmony import */ var _html_window_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./html/window.html */ \"./src/html/window.html\");\n\n\n\n\nclass JokerUI {\n constructor(joker) {\n this.joker = joker;\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('link[rel=\"stylesheet\"]').eq(0).before(_html_styles_html__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n const button = this.button;\n button.hide();\n button.mybbModal({\n title: \"Настройки первоапрельских шуток\",\n content: () => this.render(),\n closer: true,\n noscroll: true,\n escClose: true,\n });\n }\n get button() {\n let button = jquery__WEBPACK_IMPORTED_MODULE_0___default()(\".april-fools__button\");\n if (button.length === 0) {\n button = jquery__WEBPACK_IMPORTED_MODULE_0___default()(_html_button_html__WEBPACK_IMPORTED_MODULE_1__[\"default\"]).appendTo(\"body\");\n }\n return button;\n }\n show() {\n this.button.show();\n }\n render() {\n const result = jquery__WEBPACK_IMPORTED_MODULE_0___default()(\"<div></div>\").html(_html_window_html__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n const row_template = jquery__WEBPACK_IMPORTED_MODULE_0___default()(\"#april-fools__window-row\", result).html();\n const joke_container = jquery__WEBPACK_IMPORTED_MODULE_0___default()(\".april-fools__jokes\", result);\n for (const joke of Object.values(this.joker.jokes)) {\n const row = jquery__WEBPACK_IMPORTED_MODULE_0___default()(eval(\"`\" + row_template + \"`\"));\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('input[type=\"checkbox\"]', row)\n .prop(\"checked\", joke.settings.enabled)\n .on(\"click\", (e) => this.joker.toggleJoke(joke.id, e.currentTarget.checked));\n joke_container.append(row);\n }\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(\"button\", result).on(\"click\", async () => {\n await this.joker.clearUserStates();\n window.location.reload();\n });\n return jquery__WEBPACK_IMPORTED_MODULE_0___default()(\".april-fools__content\", result);\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/ui.ts?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "jquery":
|
||
/*!*************************!*\
|
||
!*** external "jQuery" ***!
|
||
\*************************/
|
||
/***/ ((module) => {
|
||
|
||
module.exports = jQuery;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/cursor-effects/dist/cjs.cjs":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/cursor-effects/dist/cjs.cjs ***!
|
||
\**************************************************/
|
||
/***/ ((__unused_webpack_module, exports) => {
|
||
|
||
eval("Object.defineProperty(exports, \"__esModule\", ({value:!0})),exports.bubbleCursor=function(e){let t,i,n,o=e&&e.element,s=o||document.body,h=window.innerWidth,c=window.innerHeight,l={x:h/2,y:h/2},r=[],d=[];const a=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function A(){if(a.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",o?(t.style.position=\"absolute\",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=h,t.height=c),s.addEventListener(\"mousemove\",g),s.addEventListener(\"touchmove\",m,{passive:!0}),s.addEventListener(\"touchstart\",m,{passive:!0}),window.addEventListener(\"resize\",u),f()}function u(e){h=window.innerWidth,c=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=h,t.height=c)}function m(e){if(e.touches.length>0)for(let t=0;t<e.touches.length;t++)p(e.touches[t].clientX,e.touches[t].clientY,d[Math.floor(Math.random()*d.length)])}function g(e){if(o){const t=s.getBoundingClientRect();l.x=e.clientX-t.left,l.y=e.clientY-t.top}else l.x=e.clientX,l.y=e.clientY;p(l.x,l.y)}function p(e,t,i){r.push(new w(e,t,i))}function f(){!function(){if(0!=r.length){i.clearRect(0,0,h,c);for(let e=0;e<r.length;e++)r[e].update(i);for(let e=r.length-1;e>=0;e--)r[e].lifeSpan<0&&r.splice(e,1);0==r.length&&i.clearRect(0,0,h,c)}}(),n=requestAnimationFrame(f)}function y(){t.remove(),cancelAnimationFrame(n),s.removeEventListener(\"mousemove\",g),s.removeEventListener(\"touchmove\",m),s.removeEventListener(\"touchstart\",m),window.addEventListener(\"resize\",u)}function w(e,t,i){const n=Math.floor(60*Math.random()+60);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/10),y:-1*Math.random()-.4},this.position={x:e,y:t},this.canv=i,this.baseDimension=4,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.velocity.x+=2*(Math.random()<.5?-1:1)/75,this.velocity.y-=Math.random()/600,this.lifeSpan--;const t=.2+(this.initialLifeSpan-this.lifeSpan)/this.initialLifeSpan;e.fillStyle=\"#e6f1f7\",e.strokeStyle=\"#3a92c5\",e.beginPath(),e.arc(this.position.x-this.baseDimension/2*t,this.position.y-this.baseDimension/2,this.baseDimension*t,0,2*Math.PI),e.stroke(),e.fill(),e.closePath()}}return a.onchange=()=>{a.matches?y():A()},A(),{destroy:y}},exports.clockCursor=function(e){let t,i,n,o=e&&e.element,s=o||document.body,h=window.innerWidth,c=window.innerHeight,l={x:h/2,y:h/2};const r=e&&e.dateColor||\"blue\",d=e&&e.faceColor||\"black\",a=e&&e.secondsColor||\"red\",A=e&&e.minutesColor||\"black\",u=e&&e.hoursColor||\"black\",m=.4;let g=new Date,p=g.getDate(),f=g.getYear()+1900;const y=(\" \"+[\"SUNDAY\",\"MONDAY\",\"TUESDAY\",\"WEDNESDAY\",\"THURSDAY\",\"FRIDAY\",\"SATURDAY\"][g.getDay()]+\" \"+p+\" \"+[\"JANUARY\",\"FEBRUARY\",\"MARCH\",\"APRIL\",\"MAY\",\"JUNE\",\"JULY\",\"AUGUST\",\"SEPTEMBER\",\"OCTOBER\",\"NOVEMBER\",\"DECEMBER\"][g.getMonth()]+\" \"+f).split(\"\"),w=[\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"1\",\"2\"],v=w.length,x=[\"•\",\"•\",\"•\"],E=[\"•\",\"•\",\"•\",\"•\"],C=[\"•\",\"•\",\"•\",\"•\",\"•\"],M=360/v,L=360/y.length,B=45/6.5,b=[],R=[],Y=[],S=[],W=[],H=[],I=[],X=[],T=[];var D=parseInt(y.length+v+x.length+E.length+C.length)+1;const F=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function z(){if(F.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",o?(t.style.position=\"absolute\",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=h,t.height=c),i.font=\"10px sans-serif\",i.textAlign=\"center\",i.textBaseline=\"middle\";for(let e=0;e<D;e++)b[e]=0,R[e]=0,Y[e]=0,S[e]=0;for(let e=0;e<y.length;e++)T[e]={color:r,value:y[e]};for(let e=0;e<w.length;e++)X[e]={color:d,value:w[e]};for(let e=0;e<x.length;e++)I[e]={color:u,value:x[e]};for(let e=0;e<E.length;e++)H[e]={color:A,value:E[e]};for(let e=0;e<C.length;e++)W[e]={color:a,value:C[e]};s.addEventListener(\"mousemove\",U),s.addEventListener(\"touchmove\",J,{passive:!0}),s.addEventListener(\"touchstart\",J,{passive:!0}),window.addEventListener(\"resize\",P),Q()}function P(e){h=window.innerWidth,c=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=h,t.height=c)}function J(e){if(e.touches.length>0)if(o){const t=s.getBoundingClientRect();l.x=e.touches[0].clientX-t.left,l.y=e.touches[0].clientY-t.top}else l.x=e.touches[0].clientX,l.y=e.touches[0].clientY}function U(e){if(o){const t=s.getBoundingClientRect();l.x=e.clientX-t.left,l.y=e.clientY-t.top}else l.x=e.clientX,l.y=e.clientY}function Q(){!function(){Y[0]=Math.round(b[0]+=(l.y-b[0])*m),S[0]=Math.round(R[0]+=(l.x-R[0])*m);for(let e=1;e<D;e++)Y[e]=Math.round(b[e]+=(Y[e-1]-b[e])*m),S[e]=Math.round(R[e]+=(S[e-1]-R[e])*m),b[e-1]>=c-80&&(b[e-1]=c-80),R[e-1]>=h-80&&(R[e-1]=h-80)}(),function(){i.clearRect(0,0,h,c);const e=new Date,t=e.getSeconds(),n=Math.PI*(t-15)/30,o=e.getMinutes(),s=Math.PI*(o-15)/30,l=e.getHours(),r=Math.PI*(l-3)/6+Math.PI*parseInt(e.getMinutes())/360;for(let e=0;e<T.length;e++)T[e].y=b[e]+67.5*Math.sin(-n+e*L*Math.PI/180),T[e].x=R[e]+67.5*Math.cos(-n+e*L*Math.PI/180),i.fillStyle=T[e].color,i.fillText(T[e].value,T[e].x,T[e].y);for(let e=0;e<X.length;e++)X[e].y=b[T.length+e]+45*Math.sin(e*M*Math.PI/180),X[e].x=R[T.length+e]+45*Math.cos(e*M*Math.PI/180),i.fillStyle=X[e].color,i.fillText(X[e].value,X[e].x,X[e].y);for(let e=0;e<I.length;e++)I[e].y=b[T.length+v+e]+0+e*B*Math.sin(r),I[e].x=R[T.length+v+e]+0+e*B*Math.cos(r),i.fillStyle=I[e].color,i.fillText(I[e].value,I[e].x,I[e].y);for(let e=0;e<H.length;e++)H[e].y=b[T.length+v+I.length+e]+0+e*B*Math.sin(s),H[e].x=R[T.length+v+I.length+e]+0+e*B*Math.cos(s),i.fillStyle=H[e].color,i.fillText(H[e].value,H[e].x,H[e].y);for(let e=0;e<W.length;e++)W[e].y=b[T.length+v+I.length+H.length+e]+0+e*B*Math.sin(n),W[e].x=R[T.length+v+I.length+H.length+e]+0+e*B*Math.cos(n),i.fillStyle=W[e].color,i.fillText(W[e].value,W[e].x,W[e].y)}(),n=requestAnimationFrame(Q)}function Z(){t.remove(),cancelAnimationFrame(n),s.removeEventListener(\"mousemove\",U),s.removeEventListener(\"touchmove\",J),s.removeEventListener(\"touchstart\",J),window.addEventListener(\"resize\",P)}return F.onchange=()=>{F.matches?Z():z()},z(),{destroy:Z}},exports.emojiCursor=function(e){const t=e&&e.emoji||[\"😀\",\"😂\",\"😆\",\"😊\"];let i=e&&e.element,n=i||document.body,o=window.innerWidth,s=window.innerHeight;const h={x:o/2,y:o/2},c={x:o/2,y:o/2};let l=0;const r=[],d=[];let a,A,u;const m=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function g(){if(m.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;a=document.createElement(\"canvas\"),A=a.getContext(\"2d\"),a.style.top=\"0px\",a.style.left=\"0px\",a.style.pointerEvents=\"none\",i?(a.style.position=\"absolute\",n.appendChild(a),a.width=n.clientWidth,a.height=n.clientHeight):(a.style.position=\"fixed\",document.body.appendChild(a),a.width=o,a.height=s),A.font=\"21px serif\",A.textBaseline=\"middle\",A.textAlign=\"center\",t.forEach((e=>{let t=A.measureText(e),i=document.createElement(\"canvas\"),n=i.getContext(\"2d\");i.width=t.width,i.height=2*t.actualBoundingBoxAscent,n.textAlign=\"center\",n.font=\"21px serif\",n.textBaseline=\"middle\",n.fillText(e,i.width/2,t.actualBoundingBoxAscent),d.push(i)})),n.addEventListener(\"mousemove\",y,{passive:!0}),n.addEventListener(\"touchmove\",f,{passive:!0}),n.addEventListener(\"touchstart\",f,{passive:!0}),window.addEventListener(\"resize\",p),v()}function p(e){o=window.innerWidth,s=window.innerHeight,i?(a.width=n.clientWidth,a.height=n.clientHeight):(a.width=o,a.height=s)}function f(e){if(e.touches.length>0)for(let t=0;t<e.touches.length;t++)w(e.touches[t].clientX,e.touches[t].clientY,d[Math.floor(Math.random()*d.length)])}function y(e){e.timeStamp-l<16||window.requestAnimationFrame((()=>{if(i){const t=n.getBoundingClientRect();h.x=e.clientX-t.left,h.y=e.clientY-t.top}else h.x=e.clientX,h.y=e.clientY;Math.hypot(h.x-c.x,h.y-c.y)>1&&(w(h.x,h.y,d[Math.floor(Math.random()*t.length)]),c.x=h.x,c.y=h.y,l=e.timeStamp)}))}function w(e,t,i){r.push(new E(e,t,i))}function v(){!function(){if(0!=r.length){A.clearRect(0,0,o,s);for(let e=0;e<r.length;e++)r[e].update(A);for(let e=r.length-1;e>=0;e--)r[e].lifeSpan<0&&r.splice(e,1);0==r.length&&A.clearRect(0,0,o,s)}}(),u=requestAnimationFrame(v)}function x(){a.remove(),cancelAnimationFrame(u),n.removeEventListener(\"mousemove\",y),n.removeEventListener(\"touchmove\",f),n.removeEventListener(\"touchstart\",f),window.addEventListener(\"resize\",p)}function E(e,t,i){const n=Math.floor(60*Math.random()+80);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.4*Math.random()+.8},this.position={x:e,y:t},this.canv=i,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.05;const t=Math.max(this.lifeSpan/this.initialLifeSpan,0);e.drawImage(this.canv,this.position.x-this.canv.width/2*t,this.position.y-this.canv.height/2,this.canv.width*t,this.canv.height*t)}}return m.onchange=()=>{m.matches?x():g()},g(),{destroy:x}},exports.fairyDustCursor=function(e){let t=e&&e.colors||[\"#D61C59\",\"#E7D84B\",\"#1B8798\"],i=e&&e.element,n=i||document.body,o=window.innerWidth,s=window.innerHeight;const h={x:o/2,y:o/2},c={x:o/2,y:o/2},l=[],r=[];let d,a,A;const u=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function m(){if(u.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;d=document.createElement(\"canvas\"),a=d.getContext(\"2d\"),d.style.top=\"0px\",d.style.left=\"0px\",d.style.pointerEvents=\"none\",i?(d.style.position=\"absolute\",n.appendChild(d),d.width=n.clientWidth,d.height=n.clientHeight):(d.style.position=\"fixed\",n.appendChild(d),d.width=o,d.height=s),a.font=\"21px serif\",a.textBaseline=\"middle\",a.textAlign=\"center\",t.forEach((e=>{let t=a.measureText(\"*\"),i=document.createElement(\"canvas\"),n=i.getContext(\"2d\");i.width=t.width,i.height=t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,n.fillStyle=e,n.textAlign=\"center\",n.font=\"21px serif\",n.textBaseline=\"middle\",n.fillText(\"*\",i.width/2,t.actualBoundingBoxAscent),r.push(i)})),n.addEventListener(\"mousemove\",f),n.addEventListener(\"touchmove\",p,{passive:!0}),n.addEventListener(\"touchstart\",p,{passive:!0}),window.addEventListener(\"resize\",g),w()}function g(e){o=window.innerWidth,s=window.innerHeight,i?(d.width=n.clientWidth,d.height=n.clientHeight):(d.width=o,d.height=s)}function p(e){if(e.touches.length>0)for(let t=0;t<e.touches.length;t++)y(e.touches[t].clientX,e.touches[t].clientY,r[Math.floor(Math.random()*r.length)])}function f(e){window.requestAnimationFrame((()=>{if(i){const t=n.getBoundingClientRect();h.x=e.clientX-t.left,h.y=e.clientY-t.top}else h.x=e.clientX,h.y=e.clientY;Math.hypot(h.x-c.x,h.y-c.y)>1.5&&(y(h.x,h.y,r[Math.floor(Math.random()*t.length)]),c.x=h.x,c.y=h.y)}))}function y(e,t,i){l.push(new x(e,t,i))}function w(){!function(){if(0!=l.length){a.clearRect(0,0,o,s);for(let e=0;e<l.length;e++)l[e].update(a);for(let e=l.length-1;e>=0;e--)l[e].lifeSpan<0&&l.splice(e,1);0==l.length&&a.clearRect(0,0,o,s)}}(),A=requestAnimationFrame(w)}function v(){d.remove(),cancelAnimationFrame(A),n.removeEventListener(\"mousemove\",f),n.removeEventListener(\"touchmove\",p),n.removeEventListener(\"touchstart\",p),window.addEventListener(\"resize\",g)}function x(e,t,i){const n=Math.floor(30*Math.random()+60);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.7*Math.random()+.9},this.position={x:e,y:t},this.canv=i,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.02;const t=Math.max(this.lifeSpan/this.initialLifeSpan,0);e.drawImage(this.canv,this.position.x-this.canv.width/2*t,this.position.y-this.canv.height/2,this.canv.width*t,this.canv.height*t)}}return u.onchange=()=>{u.matches?v():m()},m(),{destroy:v}},exports.followingDotCursor=function(e){let t,i,n=e&&e.element,o=n||document.body,s=window.innerWidth,h=window.innerHeight,c={x:s/2,y:s/2},l=new function(e,t,i,n){this.position={x:e,y:t},this.width=i,this.lag=n,this.moveTowards=function(e,t,i){this.position.x+=(e-this.position.x)/this.lag,this.position.y+=(t-this.position.y)/this.lag,i.fillStyle=r,i.beginPath(),i.arc(this.position.x,this.position.y,this.width,0,2*Math.PI),i.fill(),i.closePath()}}(s/2,h/2,10,10),r=e?.color||\"#323232a6\";const d=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function a(){if(d.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",n?(t.style.position=\"absolute\",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=s,t.height=h),o.addEventListener(\"mousemove\",u),window.addEventListener(\"resize\",A),m()}function A(e){s=window.innerWidth,h=window.innerHeight,n?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=s,t.height=h)}function u(e){if(n){const t=o.getBoundingClientRect();c.x=e.clientX-t.left,c.y=e.clientY-t.top}else c.x=e.clientX,c.y=e.clientY}function m(){i.clearRect(0,0,s,h),l.moveTowards(c.x,c.y,i),requestAnimationFrame(m)}function g(){t.remove(),cancelAnimationFrame(m),o.removeEventListener(\"mousemove\",u),window.addEventListener(\"resize\",A)}return d.onchange=()=>{d.matches?g():a()},a(),{destroy:g}},exports.ghostCursor=function(e){let t,i,n,o=e&&e.element,s=o||document.body,h=window.innerWidth,c=window.innerHeight,l={x:h/2,y:h/2},r=[],d=new Image;d.src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAAEwAAAAAChpcNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAABqElEQVQoFY3SPUvDQBgH8BREpRHExYiDgmLFl6WC+AYmWeyLg4i7buJX8DMpOujgyxGvUYeCgzhUQUSKKLUS0+ZyptXh8Z5Ti621ekPyJHl+uftfomhaf9Ei5JyxXKfynyEA6EYcLHpwyflT958GAQ7DTABNHd8EbtDbEH2BD5QEQmi2mM8P/Iq+A0SzszEg+3sPjDnDdVEtQKQbMUidHD3xVzf6A9UDEmEm+8h9KTqTVUjT+vB53aHrCbAPiceYq1dQI1Aqv4EhMll0jzv+Y0yiRgCnLRSYyDQHVoqUXe4uKL9l+L7GXC4vkMhE6eW/AOJs9k583ORDUyXMZ8F5SVHVVnllmPNKSFagAJ5DofaqGXw/gHBYg51dIldkmknY3tguv3jOtHR4+MqAzaraJXbEhqHhcQlwGSOi5pytVQHZLN5s0WNe8HPrLYlFsO20RPHkImxsbmHdLJFI76th7Z4SeuF53hTeFLvhRCJRCTKZKxgdnRDbW+iozFJbBMw14/ElwGYc0egMBMFzT21f5Rog33Z7dX02GBm7WV5ZfT5Nn5bE3zuCDe9UxdTpNvK+5AAAAABJRU5ErkJggg==\";const a=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function A(){if(a.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",o?(t.style.position=\"absolute\",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=h,t.height=c),s.addEventListener(\"mousemove\",g),s.addEventListener(\"touchmove\",m,{passive:!0}),s.addEventListener(\"touchstart\",m,{passive:!0}),window.addEventListener(\"resize\",u),f()}function u(e){h=window.innerWidth,c=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=h,t.height=c)}function m(e){if(e.touches.length>0)for(let t=0;t<e.touches.length;t++)p(e.touches[t].clientX,e.touches[t].clientY,d)}function g(e){if(o){const t=s.getBoundingClientRect();l.x=e.clientX-t.left,l.y=e.clientY-t.top}else l.x=e.clientX,l.y=e.clientY;p(l.x,l.y,d)}function p(e,t,i){r.push(new w(e,t,i))}function f(){!function(){if(0!=r.length){i.clearRect(0,0,h,c);for(let e=0;e<r.length;e++)r[e].update(i);for(let e=r.length-1;e>=0;e--)r[e].lifeSpan<0&&r.splice(e,1);0==r.length&&i.clearRect(0,0,h,c)}}(),n=requestAnimationFrame(f)}function y(){t.remove(),cancelAnimationFrame(n),s.removeEventListener(\"mousemove\",g),s.removeEventListener(\"touchmove\",m),s.removeEventListener(\"touchstart\",m),window.addEventListener(\"resize\",u)}function w(e,t,i){this.initialLifeSpan=40,this.lifeSpan=40,this.position={x:e,y:t},this.image=i,this.update=function(e){this.lifeSpan--;const t=Math.max(this.lifeSpan/this.initialLifeSpan,0);e.globalAlpha=t,e.drawImage(this.image,this.position.x,this.position.y)}}return a.onchange=()=>{a.matches?y():A()},A(),{destroy:y}},exports.rainbowCursor=function(e){let t,i,n,o=e&&e.element,s=o||document.body,h=window.innerWidth,c=window.innerHeight,l={x:h/2,y:h/2},r=[];const d=e?.length||20,a=e?.colors||[\"#FE0000\",\"#FD8C00\",\"#FFE500\",\"#119F0B\",\"#0644B3\",\"#C22EDC\"],A=e?.size||3;let u=!1;const m=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function g(){if(m.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",o?(t.style.position=\"absolute\",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=h,t.height=c),s.addEventListener(\"mousemove\",f),window.addEventListener(\"resize\",p),y()}function p(e){h=window.innerWidth,c=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=h,t.height=c)}function f(e){if(o){const t=s.getBoundingClientRect();l.x=e.clientX-t.left,l.y=e.clientY-t.top}else l.x=e.clientX,l.y=e.clientY;if(!1===u){u=!0;for(let e=0;e<d;e++)t=l.x,i=l.y,void 0,r.push(new v(t,i))}var t,i}function y(){!function(){i.clearRect(0,0,h,c),i.lineJoin=\"round\";let e=[],t=l.x,n=l.y;r.forEach((function(i,o,s){let h=s[o+1]||s[0];i.position.x=t,i.position.y=n,e.push({x:t,y:n}),t+=.4*(h.position.x-i.position.x),n+=.4*(h.position.y-i.position.y)})),a.forEach(((t,n)=>{i.beginPath(),i.strokeStyle=t,e.length&&i.moveTo(e[0].x,e[0].y+n*(A-1)),e.forEach(((e,t)=>{0!==t&&i.lineTo(e.x,e.y+n*A)})),i.lineWidth=A,i.lineCap=\"round\",i.stroke()}))}(),n=requestAnimationFrame(y)}function w(){t.remove(),cancelAnimationFrame(n),s.removeEventListener(\"mousemove\",f),window.addEventListener(\"resize\",p)}function v(e,t){this.position={x:e,y:t}}return m.onchange=()=>{m.matches?w():g()},g(),{destroy:w}},exports.snowflakeCursor=function(e){let t,i,n,o=e&&e.element,s=o||document.body,h=[\"❄️\"],c=window.innerWidth,l=window.innerHeight,r={x:c/2,y:c/2},d=[],a=[];const A=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function u(){if(A.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",o?(t.style.position=\"absolute\",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=c,t.height=l),i.font=\"12px serif\",i.textBaseline=\"middle\",i.textAlign=\"center\",h.forEach((e=>{let t=i.measureText(e),n=document.createElement(\"canvas\"),o=n.getContext(\"2d\");n.width=t.width,n.height=2*t.actualBoundingBoxAscent,o.textAlign=\"center\",o.font=\"12px serif\",o.textBaseline=\"middle\",o.fillText(e,n.width/2,t.actualBoundingBoxAscent),a.push(n)})),s.addEventListener(\"mousemove\",p),s.addEventListener(\"touchmove\",g,{passive:!0}),s.addEventListener(\"touchstart\",g,{passive:!0}),window.addEventListener(\"resize\",m),y()}function m(e){c=window.innerWidth,l=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=c,t.height=l)}function g(e){if(e.touches.length>0)for(let t=0;t<e.touches.length;t++)f(e.touches[t].clientX,e.touches[t].clientY,a[Math.floor(Math.random()*a.length)])}function p(e){if(o){const t=s.getBoundingClientRect();r.x=e.clientX-t.left,r.y=e.clientY-t.top}else r.x=e.clientX,r.y=e.clientY;f(r.x,r.y,a[Math.floor(Math.random()*h.length)])}function f(e,t,i){d.push(new v(e,t,i))}function y(){!function(){if(0!=d.length){i.clearRect(0,0,c,l);for(let e=0;e<d.length;e++)d[e].update(i);for(let e=d.length-1;e>=0;e--)d[e].lifeSpan<0&&d.splice(e,1);0==d.length&&i.clearRect(0,0,c,l)}}(),n=requestAnimationFrame(y)}function w(){t.remove(),cancelAnimationFrame(n),s.removeEventListener(\"mousemove\",p),s.removeEventListener(\"touchmove\",g),s.removeEventListener(\"touchstart\",g),window.addEventListener(\"resize\",m)}function v(e,t,i){const n=Math.floor(60*Math.random()+80);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:1+Math.random()},this.position={x:e,y:t},this.canv=i,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.x+=2*(Math.random()<.5?-1:1)/75,this.velocity.y-=Math.random()/300;const t=Math.max(this.lifeSpan/this.initialLifeSpan,0),i=.0174533*(2*this.lifeSpan);e.translate(this.position.x,this.position.y),e.rotate(i),e.drawImage(this.canv,-this.canv.width/2*t,-this.canv.height/2,this.canv.width*t,this.canv.height*t),e.rotate(-i),e.translate(-this.position.x,-this.position.y)}}return A.onchange=()=>{A.matches?w():u()},u(),{destroy:w}},exports.springyEmojiCursor=function(e){let t,i,n,o,s=e&&e.emoji||\"🤪\",h=e&&e.element,c=h||document.body,l=window.innerWidth,r=window.innerHeight,d={x:l/2,y:l/2},a=[];const A=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function u(){if(A.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",h?(t.style.position=\"absolute\",c.appendChild(t),t.width=c.clientWidth,t.height=c.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=l,t.height=r),i.font=\"16px serif\",i.textBaseline=\"middle\",i.textAlign=\"center\";let e=i.measureText(s),n=document.createElement(\"canvas\"),d=n.getContext(\"2d\");n.width=e.width,n.height=2*e.actualBoundingBoxAscent,d.textAlign=\"center\",d.font=\"16px serif\",d.textBaseline=\"middle\",d.fillText(s,n.width/2,e.actualBoundingBoxAscent),o=n;let u=0;for(u=0;u<7;u++)a[u]=new x(o);c.addEventListener(\"mousemove\",p),c.addEventListener(\"touchmove\",g,{passive:!0}),c.addEventListener(\"touchstart\",g,{passive:!0}),window.addEventListener(\"resize\",m),f()}function m(e){l=window.innerWidth,r=window.innerHeight,h?(t.width=c.clientWidth,t.height=c.clientHeight):(t.width=l,t.height=r)}function g(e){if(e.touches.length>0)if(h){const t=c.getBoundingClientRect();d.x=e.touches[0].clientX-t.left,d.y=e.touches[0].clientY-t.top}else d.x=e.touches[0].clientX,d.y=e.touches[0].clientY}function p(e){if(h){const t=c.getBoundingClientRect();d.x=e.clientX-t.left,d.y=e.clientY-t.top}else d.x=e.clientX,d.y=e.clientY}function f(){!function(){t.width=t.width,a[0].position.x=d.x,a[0].position.y=d.y;for(let e=1;e<7;e++){let n=new w(0,0);e>0&&v(e-1,e,n),e<6&&v(e+1,e,n);let o,s,h=new w(10*-a[e].velocity.x,10*-a[e].velocity.y),c=new w((n.X+h.X)/1,(n.Y+h.Y)/1+50);a[e].velocity.x+=.01*c.X,a[e].velocity.y+=.01*c.Y,Math.abs(a[e].velocity.x)<.1&&Math.abs(a[e].velocity.y)<.1&&Math.abs(c.X)<.1&&Math.abs(c.Y)<.1&&(a[e].velocity.x=0,a[e].velocity.y=0),a[e].position.x+=a[e].velocity.x,a[e].position.y+=a[e].velocity.y,o=t.clientHeight,s=t.clientWidth,a[e].position.y>=o-11-1&&(a[e].velocity.y>0&&(a[e].velocity.y=.7*-a[e].velocity.y),a[e].position.y=o-11-1),a[e].position.x>=s-11&&(a[e].velocity.x>0&&(a[e].velocity.x=.7*-a[e].velocity.x),a[e].position.x=s-11-1),a[e].position.x<0&&(a[e].velocity.x<0&&(a[e].velocity.x=.7*-a[e].velocity.x),a[e].position.x=0),a[e].draw(i)}}(),n=requestAnimationFrame(f)}function y(){t.remove(),cancelAnimationFrame(n),c.removeEventListener(\"mousemove\",p),c.removeEventListener(\"touchmove\",g),c.removeEventListener(\"touchstart\",g),window.addEventListener(\"resize\",m)}function w(e,t){this.X=e,this.Y=t}function v(e,t,i){let n=a[e].position.x-a[t].position.x,o=a[e].position.y-a[t].position.y,s=Math.sqrt(n*n+o*o);if(s>10){let e=10*(s-10);i.X+=n/s*e,i.Y+=o/s*e}}function x(e){this.position={x:d.x,y:d.y},this.velocity={x:0,y:0},this.canv=e,this.draw=function(e){e.drawImage(this.canv,this.position.x-this.canv.width/2,this.position.y-this.canv.height/2,this.canv.width,this.canv.height)}}return A.onchange=()=>{A.matches?y():u()},u(),{destroy:y}},exports.textFlag=function(e){let t,i,n,o=e||{},s=e&&e.element,h=s||document.body,c=o.text?\" \"+e.text:\" Your Text Here\",l=o.font||\"monospace\",r=o.textSize||12,d=r+\"px \"+l,a=o.gap||r+2,A=0,u=[],m=window.innerWidth,g=window.innerHeight,p={x:m/2,y:m/2};for(let e=0;e<c.length;e++)u[e]={letter:c.charAt(e),x:m/2,y:m/2};e?.size;const f=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function y(){if(f.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",s?(t.style.position=\"absolute\",h.appendChild(t),t.width=h.clientWidth,t.height=h.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=m,t.height=g),h.addEventListener(\"mousemove\",v),window.addEventListener(\"resize\",w),x()}function w(e){m=window.innerWidth,g=window.innerHeight,s?(t.width=h.clientWidth,t.height=h.clientHeight):(t.width=m,t.height=g)}function v(e){if(s){const t=h.getBoundingClientRect();p.x=e.clientX-t.left,p.y=e.clientY-t.top}else p.x=e.clientX,p.y=e.clientY}function x(){!function(){i.clearRect(0,0,m,g),A+=.15;let e=2*Math.cos(A),t=5*Math.sin(A);for(let e=u.length-1;e>0;e--)u[e].x=u[e-1].x+a,u[e].y=u[e-1].y,i.font=d,i.fillText(u[e].letter,u[e].x,u[e].y);let n=u[0].x,o=u[0].y;n+=(p.x-n)/5+e+2,o+=(p.y-o)/5+t,u[0].x=n,u[0].y=o}(),n=requestAnimationFrame(x)}function E(){t.remove(),cancelAnimationFrame(n),h.removeEventListener(\"mousemove\",v),window.addEventListener(\"resize\",w)}return f.onchange=()=>{f.matches?E():y()},y(),{destroy:E}},exports.trailingCursor=function(e){let t,i,n,o=e&&e.element,s=o||document.body,h=window.innerWidth,c=window.innerHeight,l={x:h/2,y:h/2},r=[];const d=e?.particles||15,a=e?.rate||.4,A=e?.baseImageSrc||\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAAEwAAAAAChpcNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAABqElEQVQoFY3SPUvDQBgH8BREpRHExYiDgmLFl6WC+AYmWeyLg4i7buJX8DMpOujgyxGvUYeCgzhUQUSKKLUS0+ZyptXh8Z5Ti621ekPyJHl+uftfomhaf9Ei5JyxXKfynyEA6EYcLHpwyflT958GAQ7DTABNHd8EbtDbEH2BD5QEQmi2mM8P/Iq+A0SzszEg+3sPjDnDdVEtQKQbMUidHD3xVzf6A9UDEmEm+8h9KTqTVUjT+vB53aHrCbAPiceYq1dQI1Aqv4EhMll0jzv+Y0yiRgCnLRSYyDQHVoqUXe4uKL9l+L7GXC4vkMhE6eW/AOJs9k583ORDUyXMZ8F5SVHVVnllmPNKSFagAJ5DofaqGXw/gHBYg51dIldkmknY3tguv3jOtHR4+MqAzaraJXbEhqHhcQlwGSOi5pytVQHZLN5s0WNe8HPrLYlFsO20RPHkImxsbmHdLJFI76th7Z4SeuF53hTeFLvhRCJRCTKZKxgdnRDbW+iozFJbBMw14/ElwGYc0egMBMFzT21f5Rog33Z7dX02GBm7WV5ZfT5Nn5bE3zuCDe9UxdTpNvK+5AAAAABJRU5ErkJggg==\";let u=!1,m=new Image;m.src=A;const g=window.matchMedia(\"(prefers-reduced-motion: reduce)\");function p(){if(g.matches)return console.log(\"This browser has prefers reduced motion turned on, so the cursor did not init\"),!1;t=document.createElement(\"canvas\"),i=t.getContext(\"2d\"),t.style.top=\"0px\",t.style.left=\"0px\",t.style.pointerEvents=\"none\",o?(t.style.position=\"absolute\",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position=\"fixed\",document.body.appendChild(t),t.width=h,t.height=c),s.addEventListener(\"mousemove\",y),window.addEventListener(\"resize\",f),w()}function f(e){h=window.innerWidth,c=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=h,t.height=c)}function y(e){if(o){const t=s.getBoundingClientRect();l.x=e.clientX-t.left,l.y=e.clientY-t.top}else l.x=e.clientX,l.y=e.clientY;if(!1===u){u=!0;for(let e=0;e<d;e++)t=l.x,i=l.y,n=m,r.push(new x(t,i,n))}var t,i,n}function w(){!function(){i.clearRect(0,0,h,c);let e=l.x,t=l.y;r.forEach((function(n,o,s){let h=s[o+1]||s[0];n.position.x=e,n.position.y=t,n.move(i),e+=(h.position.x-n.position.x)*a,t+=(h.position.y-n.position.y)*a}))}(),n=requestAnimationFrame(w)}function v(){t.remove(),cancelAnimationFrame(n),s.removeEventListener(\"mousemove\",y),window.addEventListener(\"resize\",f)}function x(e,t,i){this.position={x:e,y:t},this.image=i,this.move=function(e){e.drawImage(this.image,this.position.x,this.position.y)}}return g.onchange=()=>{g.matches?v():p()},p(),{destroy:v}};\n\n\n//# sourceURL=webpack://mybb-april-fools/./node_modules/cursor-effects/dist/cjs.cjs?");
|
||
|
||
/***/ })
|
||
|
||
/******/ });
|
||
/************************************************************************/
|
||
/******/ // The module cache
|
||
/******/ var __webpack_module_cache__ = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/ // Check if module is in cache
|
||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||
/******/ if (cachedModule !== undefined) {
|
||
/******/ return cachedModule.exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||
/******/ // no module.id needed
|
||
/******/ // no module.loaded needed
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/************************************************************************/
|
||
/******/ /* webpack/runtime/compat get default export */
|
||
/******/ (() => {
|
||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
/******/ __webpack_require__.n = (module) => {
|
||
/******/ var getter = module && module.__esModule ?
|
||
/******/ () => (module['default']) :
|
||
/******/ () => (module);
|
||
/******/ __webpack_require__.d(getter, { a: getter });
|
||
/******/ return getter;
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/define property getters */
|
||
/******/ (() => {
|
||
/******/ // define getter functions for harmony exports
|
||
/******/ __webpack_require__.d = (exports, definition) => {
|
||
/******/ for(var key in definition) {
|
||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||
/******/ }
|
||
/******/ }
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/make namespace object */
|
||
/******/ (() => {
|
||
/******/ // define __esModule on exports
|
||
/******/ __webpack_require__.r = (exports) => {
|
||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
/******/ }
|
||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/************************************************************************/
|
||
/******/
|
||
/******/ // startup
|
||
/******/ // Load entry module and return exports
|
||
/******/ // This entry module can't be inlined because the eval devtool is used.
|
||
/******/ var __webpack_exports__ = __webpack_require__("./src/main.ts");
|
||
/******/
|
||
/******/ })()
|
||
; |