From 1ec33d6a803deac7650a530855e1d5adefef25d0 Mon Sep 17 00:00:00 2001 From: Teswa Date: Wed, 29 Mar 2023 00:36:23 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9A=D1=83=D1=80=D1=81=D0=BE=D1=80=D1=8B,=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JOKES.md | 48 ----- README.md | 120 ++++++++++- dist/april-fools.js | 58 +++-- dist/april-fools.min.js | 2 +- package-lock.json | 6 + package.json | 1 + settings.compact.js | 130 +++++++++++ settings.example.js | 382 +++++++++++++++++++++++++++++++++ src/joke.ts | 39 +++- src/{handler.ts => joker.ts} | 69 ++++-- src/jokes/carnival.ts | 6 +- src/jokes/crazy_letters.ts | 2 + src/jokes/crazy_punctuation.ts | 2 + src/jokes/cursor.ts | 320 +++++++++++++++++++++++++++ src/jokes/humanitarian_hell.ts | 2 + src/jokes/letter_chaos.ts | 6 +- src/jokes/mirror.ts | 2 + src/jokes/shake.ts | 14 +- src/main.ts | 8 +- tsconfig.json | 7 +- 20 files changed, 1118 insertions(+), 106 deletions(-) delete mode 100644 JOKES.md create mode 100644 settings.compact.js create mode 100644 settings.example.js rename src/{handler.ts => joker.ts} (65%) create mode 100644 src/jokes/cursor.ts diff --git a/JOKES.md b/JOKES.md deleted file mode 100644 index 1f7c7e4..0000000 --- a/JOKES.md +++ /dev/null @@ -1,48 +0,0 @@ -# Список реализованых шуток - -## `shake` - Форумо-трясение -Страница форума начинает трястись - -Настройки: -* `chance` - Вероятность срабатывания в процентах (по умолчанию: `1%`) -* `directions` - Направление тряски (по умолчанию: `['top', 'left', 'bottom', 'left']`) -* `selector` - Селектор всех элементов, которые будут трястись (по умолчанию: `[id^=pun]`) -* `interval` - Частота тряски (по умолчанию: `100`) -* `force` - Сила тряски (по умолчанию: `0.5`) - -## `mirror` - Зеркало -Элементы форума отражаются (по крайней мере, пытаются) - -Настройки: -* `chance` - Вероятность срабатывания в процентах (по умолчанию: `30%`) - -## `carnival` - Карнавал -Аватарки приобретают интересные цвета - -Настройки: -* `chance` - Вероятность срабатывания в процентах (по умолчанию: `30%`) -* `selector` - Селектор всех элементов, которые будут перекрашены (по умолчанию: `img[src*="/avatars/"]`) -* `variant_chance` - Вероятность применения некоторого фильтра (по умолчанию: `20%`) -* `variants` - Список фильтров и диапозона случайных параметров - -## `humanitarian_hell` - Ад гуманитария -Все "тся" заменяются на "ться", а все "ться" на "тся" - -Настройки: -* `chance` - Вероятность срабатывания в процентах (по умолчанию: `20%`) -* `selector` - Селектор всех элементов, которые будут затронуты: `.post-content`) - -## `crazy_letters` - Мама, Я сОшЛа С уМа! -иМеНа ЗаБоРчИкОм - -Настройки: -* `chance` - Вероятность срабатывания в процентах (по умолчанию: `20%`) -* `selector` - Селектор всех элементов, которые будут затронуты: `.pa-author a`) - -## `letter_chaos` - Буквенный хаос -Все буквы в словах, кроме первой и последней, перемешены. - -Настройки: -* `chance` - Вероятность срабатывания в процентах (по умолчанию: `20%`) -* `selector` - Селектор всех элементов, которые будут затронуты: `.post-content`) -* `shuffle_chance` - Вероятность того, что буквы будут перемешаны (по умолчанию: `50%`) \ No newline at end of file diff --git a/README.md b/README.md index 53d86e6..7107084 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Базовое использование: ```html + + ``` +--- +## Полный список шуток + +* `shake` — **Форумо-трясение**. Страница форума начинает трястись. +* `mirror` — **Зеркало**. Элементы форума отражаются... По крайней мере, пытаются. +* `carnival` — **Карнавал**. Аватарки приобретают интересные цвета. +* `humanitarian_hell` — **Ад гуманитария**. Все "тся" заменяются на "ться", а все "ться" на "тся". +* `crazy_letters` — **Мама, Я сОшЛа С уМа!** иМеНа ЗаБоРчИкОм +* `letter_chaos` — **Буквенный хаос**. Все буквы в словах, кроме первой и последней, перемешены. +* `cursor` — **Красивые курсоры**. Эффекты, следующие за курсором. + +--- +## Настройка шуток + +Настройка шуток происходит при присвоении объекта `window.AprilJokes.settings`. +Это присвоедние должно произойти **после** загрузки скрипта. + +Для всех шуток определны 2 общих поля: +```js +window.AprilJokes.settings = { + // ... + example: { + /** + * Активность шутки. + * Установите это значение `false`, что бы отключить шутку. + * Если `true`, то шутка будет обработана как обычно. + */ + enabled: true, + + /** + * Вероятность срабатывания в процентах. + * Если установлено значение `100`, шутка будет срабатывать всегда. + * Если установлено значение `0`, шутка никогда не сработает. + * Лучше отключать шутку, используя enabled = false! + */ + chance: 20, + }, + // ... +}; +``` + +Полный список настроек с объяснениями вы можете посмотреть в файле [`settings.example.js`](./settings.example.js). Также представлен файл [`settings.compact.js`](./settings.compact.js), который также содержит все настройки, но без коментариев. + +При этом, объективно, вставлять весь этот код в HTML-начало может быть "немного" неудобно, поэтому вы можете скачать код (кнопка "Raw" над файлом), изменить его, и загрузить в файлы форума, подключив скрипт таким образом: + +```html + + + + +``` + +Заметьте, что во всех примерах приведены значения настроек по умолчанию. Вы *можете* удалять строки, значения по умолчанию которых вас устраивают. + +Если вас интерсует только несколько шуток, вы можете использовать метод `disableAll()`, что бы выключить выполнение всех шуток, а потом включать отдельные шутки через установку настройки `enabled`: + +```js +window.AprilJokes.disableAll(); + +window.AprilJokes.settings = { + // ... + example: { + enabled: true, + // ... + }, + // ... +}; +``` + +Обратите внимание, что метод `disableAll()` должен быть вызван *до* установки настроек `settings`, иначе заданные значения `enabled` будут сброшены. + +--- +### Настройка `shake` (Форумо-трясение) + +Тряска элементов происходит путём изменения перечисленных направлений `margin` на значение ±`force` от стандартного значения. + +> **Важно**: эта шутка может вызвать дискомфорт у пользователей. Настоятельно рекомендуется оставить вероятность срабатывания шутки (`chance`) очень низкой, что бы у пользователей была возможность избавиться от шутки простым обновлением страницы! Вариант отключить шутку (`enabled: false`) тоже вариант. + +--- +### Настройка `mirror` (Зеркало) +Элементы форума отражаются по весьма специфичному алгоритму... И из-за этого, шутка может работать *очень* плохо на некоторых дизайнах, поэтому данная шутка по умолчанию **отключена** + +Для того, что бы попробовать, сработает ли шутка для вашего дизайна, используйте в консоли разработчика: +```js +window.AprilJokes.start("mirror", true); +``` + +Так же можете [посмотреть](./src/jokes/mirror.ts#L16) на метод `MirrorJoke.start`, что бы узнать как именно проиходит отражение. + +--- +### Настройка `cursor` (Красивые курсоры) +Эффекты, следующие за курсором. + +Используются курсоры, предложенные в библотеке `tholman/cursor-effects` от Tim Holman ([Github](https://github.com/tholman/cursor-effects), [сайт](https://tholman.com/cursor-effects/)). + +Код предусматривает, что одновременно активировано не более 1 курсора из этой библиотеки. Так же для каждого курсора установлен свой шанс срабатывания, однако из-за необходимости активации строго одного эффекта, предусмотрено использование весового коэффициента `weight`: если говорить просто, то чем больше это значение, то тем больше шанс срабатывания эффекта относительно других эффектов. + +Так же для каждого эффекта определена настройка `enabled`, позволяющая отключить эффекты, и метод `disableAll` для отключения эффектов: +```js +window.AprilJokes.jokes.cursor.disableAll(); +``` + +--- +## Разработка дополнений + Использование для тестирования: ```html @@ -26,10 +133,13 @@ 'alert', // Вызываемая функция шутки - settings => alert(settings.text), + settings => { + alert(settings.text) + }, // Стандартные настройки { + enabled: true, chance: 30, text: 'Fooled!', } @@ -40,11 +150,3 @@ window.AprilJokes.start('alert', true); ``` - -В планах: -* Отключение отдельных шуток для пользователей. - -О том, какие шутки определены по умолчанию, смотрите [на странице со списком их настроек](JOKES.md). - -Если же вам интересна их реализация, то ищите её в папке [с их исходным кодом](src/jokes). - diff --git a/dist/april-fools.js b/dist/april-fools.js index 42f9ea5..28051bd 100644 --- a/dist/april-fools.js +++ b/dist/april-fools.js @@ -10,23 +10,23 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ -/***/ "./src/handler.ts": -/*!************************!*\ - !*** ./src/handler.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 */ \"AprilFoolsJokeClass\": () => (/* binding */ AprilFoolsJokeClass)\n/* harmony export */ });\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./joke */ \"./src/joke.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n/**\n * Блок обработки перво-апрельских шуток\n *\n * @author Kozhilya\n */\nvar AprilFoolsJokeClass = /** @class */ (function () {\n function AprilFoolsJokeClass() {\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 AprilFoolsJokeClass.check = function (chance) {\n return Math.random() < 0.01 * chance;\n };\n /**\n * Добавление шутки\n *\n * @param joke\n */\n AprilFoolsJokeClass.prototype.add = function (joke) {\n this.jokes[joke.id] = joke;\n };\n AprilFoolsJokeClass.prototype.addCustom = function (id, handler, settings) {\n if (settings === void 0) { settings = null; }\n var joke = new /** @class */ (function (_super) {\n __extends(class_1, _super);\n function class_1() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = id;\n _this.settings = { chance: 10 };\n return _this;\n }\n class_1.prototype.start = function () {\n handler.call(this, this.settings);\n };\n return class_1;\n }(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n Object.assign(joke.settings, settings !== null && settings !== void 0 ? settings : {});\n this.add(joke);\n };\n Object.defineProperty(AprilFoolsJokeClass.prototype, \"settings\", {\n get: function () {\n var result = {};\n result['core'] = this.core_settings;\n for (var _i = 0, _a = Object.entries(this.jokes); _i < _a.length; _i++) {\n var entries = _a[_i];\n var id = entries[0];\n var joke = entries[1];\n result[id] = joke.settings;\n }\n return result;\n },\n /**\n * Запись новых настроек\n *\n * @param settings\n */\n set: function (settings) {\n for (var _i = 0, _a = Object.entries(settings); _i < _a.length; _i++) {\n var entry = _a[_i];\n var id = entry[0];\n var jokeSettings = entry[1];\n var targetSettings = (id === 'core') ? this.core_settings : this.jokes[id].settings;\n Object.assign(targetSettings, jokeSettings);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Запуск шутки\n *\n * @param id\n * @param {boolean} forced\n */\n AprilFoolsJokeClass.prototype.start = function (id, forced) {\n if (forced === void 0) { forced = false; }\n if (!(id in this.jokes))\n return;\n var joke = this.jokes[id];\n if (!forced && !AprilFoolsJokeClass.check(joke.settings.chance)) {\n return;\n }\n joke.start();\n };\n /**\n * Запуск всех шуток\n */\n AprilFoolsJokeClass.prototype.startAll = function (forced) {\n if (forced === void 0) { forced = false; }\n for (var _i = 0, _a = Object.keys(this.jokes); _i < _a.length; _i++) {\n var key = _a[_i];\n this.start(key, forced);\n }\n };\n AprilFoolsJokeClass.prototype.regularStart = function () {\n var today = new Date();\n var month = today.getMonth() + 1; // Note that getMonth() returns 0-indexed month, so we need to add 1\n var day = today.getDate();\n if (month === 4 && day === 1 && AprilFoolsJokeClass.check(this.core_settings.chance)) {\n this.startAll();\n }\n };\n return AprilFoolsJokeClass;\n}());\n\n/**\n *\n */\nvar CoreSettings = /** @class */ (function () {\n function CoreSettings() {\n this.chance = 100;\n }\n return CoreSettings;\n}());\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/handler.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 */ \"StopableJoke\": () => (/* binding */ StopableJoke)\n/* harmony export */ });\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * Объект, описывающий шутку\n */\nvar Joke = /** @class */ (function () {\n function Joke() {\n /**\n * Флаг, указывающий, должна ли шутка быть запущена\n */\n this.enabled = true;\n }\n return Joke;\n}());\n\n/**\n * Объект, описывающий шутку, которая может быть остановлена\n */\nvar StopableJoke = /** @class */ (function (_super) {\n __extends(StopableJoke, _super);\n function StopableJoke() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StopableJoke;\n}(Joke));\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/joke.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Joke\": () => (/* binding */ Joke),\n/* harmony export */ \"StopableJoke\": () => (/* binding */ StopableJoke)\n/* harmony export */ });\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * Объект, описывающий шутку\n */\nvar Joke = /** @class */ (function () {\n function Joke() {\n }\n /**\n * Проверка вероятности\n *\n * @param {number} chance Вероятность срабатывания\n * @returns {boolean} Флаг срабатывания (true - сработало)\n */\n Joke.prototype.check = function (chance) {\n return Math.random() < 0.01 * chance;\n };\n /**\n * Разблокировать шутку\n */\n Joke.prototype.enable = function () {\n this.settings.enabled = true;\n };\n /**\n * Заблокировать шутку\n */\n Joke.prototype.disable = function () {\n this.settings.enabled = false;\n };\n /**\n * Переключить блокировку шутки\n * @param value Новое значение\n */\n Joke.prototype.toggle = function (value) {\n if (value === void 0) { value = null; }\n this.settings.enabled = (value === null) ? !this.settings.enabled : value;\n };\n return Joke;\n}());\n\n/**\n * Объект, описывающий шутку, которая может быть остановлена\n */\nvar StopableJoke = /** @class */ (function (_super) {\n __extends(StopableJoke, _super);\n function StopableJoke() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StopableJoke;\n}(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\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n/**\n * Блок обработки перво-апрельских шуток\n *\n * @author Kozhilya\n */\nvar JokerClass = /** @class */ (function () {\n function JokerClass() {\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 JokerClass.prototype.check = function (chance) {\n return Math.random() < 0.01 * chance;\n };\n /**\n * Добавление шутки\n *\n * @param joke Объект шутки\n */\n JokerClass.prototype.add = function (joke) {\n this.jokes[joke.id] = joke;\n };\n /**\n * Регистрация новой шутки\n *\n * @param id Идентификатор шутки\n * @param handler Метод, выполняющий шутку\n * @param settings Объект настроек шутки\n */\n JokerClass.prototype.addCustom = function (id, handler, settings) {\n if (settings === void 0) { settings = null; }\n var joke = new /** @class */ (function (_super) {\n __extends(class_1, _super);\n function class_1() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = id;\n _this.settings = { chance: 10, enabled: true };\n return _this;\n }\n class_1.prototype.start = function () {\n handler.call(this, this.settings);\n };\n return class_1;\n }(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n Object.assign(joke.settings, settings !== null && settings !== void 0 ? settings : {});\n this.add(joke);\n };\n Object.defineProperty(JokerClass.prototype, \"settings\", {\n /**\n * Получение полного списка настроек\n */\n get: function () {\n var result = {};\n result['core'] = this.core_settings;\n for (var _i = 0, _a = Object.entries(this.jokes); _i < _a.length; _i++) {\n var entries = _a[_i];\n var id = entries[0];\n var joke = entries[1];\n result[id] = joke.settings;\n }\n return result;\n },\n /**\n * Запись новых настроек\n *\n * @param settings\n */\n set: function (settings) {\n for (var _i = 0, _a = Object.entries(settings); _i < _a.length; _i++) {\n var entry = _a[_i];\n var id = entry[0];\n var jokeSettings = entry[1];\n var targetSettings = (id === 'core') ? this.core_settings : this.jokes[id].settings;\n Object.assign(targetSettings, jokeSettings);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Разблокировать систему\n */\n JokerClass.prototype.enable = function () {\n this.core_settings.enabled = true;\n };\n /**\n * Заблокировать систему\n */\n JokerClass.prototype.disable = function () {\n this.core_settings.enabled = false;\n };\n /**\n * Разблокировать все шутки\n */\n JokerClass.prototype.enableAll = function () {\n for (var _i = 0, _a = Object.keys(this.jokes); _i < _a.length; _i++) {\n var key = _a[_i];\n this.jokes[key].enable();\n }\n };\n /**\n * Заблокировать все шутки\n */\n JokerClass.prototype.disableAll = function () {\n for (var _i = 0, _a = Object.keys(this.jokes); _i < _a.length; _i++) {\n var key = _a[_i];\n this.jokes[key].disable();\n }\n };\n /**\n * Запуск шутки\n *\n * @param id\n * @param {boolean} forced\n */\n JokerClass.prototype.start = function (id, forced) {\n if (forced === void 0) { forced = false; }\n if (!(id in this.jokes))\n return;\n var joke = this.jokes[id];\n if (!forced && (!joke.settings.enabled || !this.check(joke.settings.chance))) {\n return;\n }\n joke.start();\n };\n /**\n * Запуск всех шуток\n */\n JokerClass.prototype.startAll = function (forced) {\n if (forced === void 0) { forced = false; }\n for (var _i = 0, _a = Object.keys(this.jokes); _i < _a.length; _i++) {\n var key = _a[_i];\n this.start(key, forced);\n }\n };\n JokerClass.prototype.regularStart = function () {\n var today = new Date();\n var month = today.getMonth() + 1; // Note that getMonth() returns 0-indexed month, so we need to add 1\n var day = today.getDate();\n if (month !== 4 || day !== 1 || !this.core_settings.enabled || !this.check(this.core_settings.chance)) {\n return;\n }\n this.startAll();\n };\n return JokerClass;\n}());\n\nvar CoreSettings = /** @class */ (function () {\n function CoreSettings() {\n this.chance = 100;\n this.enabled = true;\n }\n return CoreSettings;\n}());\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/joker.ts?"); /***/ }), @@ -36,7 +36,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*******************************/ /***/ ((__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/* harmony import */ var _handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../handler */ \"./src/handler.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n/**\n * **Карнавал**\n *\n * Аватарки приобретают интересные цвета\n *\n * @author Kozhilya\n */\nvar CarnivalJoke = /** @class */ (function (_super) {\n __extends(CarnivalJoke, _super);\n function CarnivalJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'carnival';\n _this.settings = new CarnivalJokeSettings;\n return _this;\n }\n CarnivalJoke.prototype.start = function () {\n var _this = this;\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each(function (_, elem) {\n var filters = [];\n for (var _i = 0, _a = Object.entries(_this.settings.variants); _i < _a.length; _i++) {\n var entry = _a[_i];\n if (!_handler__WEBPACK_IMPORTED_MODULE_2__.AprilFoolsJokeClass.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 return CarnivalJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar CarnivalJokeSettings = /** @class */ (function () {\n function CarnivalJokeSettings() {\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 return CarnivalJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/carnival.ts?"); +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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Карнавал**\n *\n * Аватарки приобретают интересные цвета\n *\n * @author Kozhilya\n */\nvar CarnivalJoke = /** @class */ (function (_super) {\n __extends(CarnivalJoke, _super);\n function CarnivalJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'carnival';\n _this.settings = new CarnivalJokeSettings;\n return _this;\n }\n CarnivalJoke.prototype.start = function () {\n var _this = this;\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each(function (_, elem) {\n var filters = [];\n for (var _i = 0, _a = Object.entries(_this.settings.variants); _i < _a.length; _i++) {\n var entry = _a[_i];\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 return CarnivalJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar CarnivalJokeSettings = /** @class */ (function () {\n function CarnivalJokeSettings() {\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 return CarnivalJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/carnival.ts?"); /***/ }), @@ -46,7 +46,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \************************************/ /***/ ((__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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Мама, Я сОшЛа С уМа!**\n *\n * иМеНа ЗаБоРчИкОм\n *\n * @author Kozhilya\n */\nvar CrazyLettersJoke = /** @class */ (function (_super) {\n __extends(CrazyLettersJoke, _super);\n function CrazyLettersJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'crazy_letters';\n _this.settings = new CrazyLettersJokeSettings;\n return _this;\n }\n CrazyLettersJoke.prototype.start = function () {\n var _this = this;\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each(function (_, elem) {\n var text = jquery__WEBPACK_IMPORTED_MODULE_1___default()(_this).text();\n var result = '';\n for (var 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 return CrazyLettersJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar CrazyLettersJokeSettings = /** @class */ (function () {\n function CrazyLettersJokeSettings() {\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.pa-author a';\n }\n return CrazyLettersJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/crazy_letters.ts?"); +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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Мама, Я сОшЛа С уМа!**\n *\n * иМеНа ЗаБоРчИкОм\n *\n * @author Kozhilya\n */\nvar CrazyLettersJoke = /** @class */ (function (_super) {\n __extends(CrazyLettersJoke, _super);\n function CrazyLettersJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'crazy_letters';\n _this.settings = new CrazyLettersJokeSettings;\n return _this;\n }\n CrazyLettersJoke.prototype.start = function () {\n var _this = this;\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each(function (_, elem) {\n var text = jquery__WEBPACK_IMPORTED_MODULE_1___default()(_this).text();\n var result = '';\n for (var 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 return CrazyLettersJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar CrazyLettersJokeSettings = /** @class */ (function () {\n function CrazyLettersJokeSettings() {\n this.enabled = true;\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.pa-author a';\n }\n return CrazyLettersJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/crazy_letters.ts?"); /***/ }), @@ -56,7 +56,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CrazyPunctuationJoke\": () => (/* binding */ CrazyPunctuationJoke),\n/* harmony export */ \"CrazyPunctuationJokeSettings\": () => (/* binding */ CrazyPunctuationJokeSettings)\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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Бешеные запятые**\n *\n * Запятые после слов\n *\n * @author Kozhilya\n */\nvar CrazyPunctuationJoke = /** @class */ (function (_super) {\n __extends(CrazyPunctuationJoke, _super);\n function CrazyPunctuationJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'crazy_punctuation';\n _this.settings = new CrazyPunctuationJokeSettings;\n _this.punctuationSymbols = null;\n return _this;\n }\n CrazyPunctuationJoke.prototype.shufflePunctuation = function (text) {\n var _this = this;\n if (this.punctuationSymbols === null) {\n this.punctuationSymbols = this.settings.symbols.split('');\n }\n var words = text.split(\" \");\n var shuffledWords = words.map(function (word) {\n var characters = word.split(\"\");\n // Filter out any non-punctuation characters\n var punctuation = characters.filter(function (char) { return _this.punctuationSymbols.includes(char); });\n // Shuffle the punctuation array\n var shuffledPunctuation = punctuation.sort(function () { return Math.random() - 0.5; });\n // Loop through each character in the word and replace punctuation with shuffled punctuation\n var index = 0;\n return characters.map(function (char) {\n if (_this.punctuationSymbols.includes(char)) {\n return shuffledPunctuation[index++];\n }\n return char;\n }).join(\"\");\n });\n // Join the shuffled words array into a single string with spaces\n return shuffledWords.join(\" \");\n };\n CrazyPunctuationJoke.prototype.start = function () {\n var _this = this;\n var items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).find('*').contents().filter(function (_, node) { return node.nodeType === Node.TEXT_NODE; });\n items.each(function (_, node) {\n node.textContent = _this.shufflePunctuation(node.textContent);\n });\n };\n return CrazyPunctuationJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar CrazyPunctuationJokeSettings = /** @class */ (function () {\n function CrazyPunctuationJokeSettings() {\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.post-content p';\n /**\n * Мигрирующие знаки\n */\n this.symbols = ',.;:?!-()[]{}\\'\"';\n }\n return CrazyPunctuationJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/crazy_punctuation.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CrazyPunctuationJoke\": () => (/* binding */ CrazyPunctuationJoke),\n/* harmony export */ \"CrazyPunctuationJokeSettings\": () => (/* binding */ CrazyPunctuationJokeSettings)\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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Бешеные запятые**\n *\n * Запятые после слов\n *\n * @author Kozhilya\n */\nvar CrazyPunctuationJoke = /** @class */ (function (_super) {\n __extends(CrazyPunctuationJoke, _super);\n function CrazyPunctuationJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'crazy_punctuation';\n _this.settings = new CrazyPunctuationJokeSettings;\n _this.punctuationSymbols = null;\n return _this;\n }\n CrazyPunctuationJoke.prototype.shufflePunctuation = function (text) {\n var _this = this;\n if (this.punctuationSymbols === null) {\n this.punctuationSymbols = this.settings.symbols.split('');\n }\n var words = text.split(\" \");\n var shuffledWords = words.map(function (word) {\n var characters = word.split(\"\");\n // Filter out any non-punctuation characters\n var punctuation = characters.filter(function (char) { return _this.punctuationSymbols.includes(char); });\n // Shuffle the punctuation array\n var shuffledPunctuation = punctuation.sort(function () { return Math.random() - 0.5; });\n // Loop through each character in the word and replace punctuation with shuffled punctuation\n var index = 0;\n return characters.map(function (char) {\n if (_this.punctuationSymbols.includes(char)) {\n return shuffledPunctuation[index++];\n }\n return char;\n }).join(\"\");\n });\n // Join the shuffled words array into a single string with spaces\n return shuffledWords.join(\" \");\n };\n CrazyPunctuationJoke.prototype.start = function () {\n var _this = this;\n var items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).find('*').contents().filter(function (_, node) { return node.nodeType === Node.TEXT_NODE; });\n items.each(function (_, node) {\n node.textContent = _this.shufflePunctuation(node.textContent);\n });\n };\n return CrazyPunctuationJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar CrazyPunctuationJokeSettings = /** @class */ (function () {\n function CrazyPunctuationJokeSettings() {\n this.enabled = true;\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.post-content p';\n /**\n * Мигрирующие знаки\n */\n this.symbols = ',.;:?!-()[]{}\\'\"';\n }\n return CrazyPunctuationJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/crazy_punctuation.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\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n// import * as cursor_effects from \"cursor-effects\";\nvar 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 */\nvar CursorEffectsJoke = /** @class */ (function (_super) {\n __extends(CursorEffectsJoke, _super);\n function CursorEffectsJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'cursor_effects';\n _this.settings = new CursorEffectsJokeSettings;\n return _this;\n }\n /**\n * Разблокировать все варианты курсоров\n */\n CursorEffectsJoke.prototype.enableAll = function () {\n for (var _i = 0, _a = Object.keys(this.settings.effects); _i < _a.length; _i++) {\n var key = _a[_i];\n this.settings.effects[key].enabled = true;\n }\n };\n /**\n * Заблокировать все варианты курсоров\n */\n CursorEffectsJoke.prototype.disableAll = function () {\n for (var _i = 0, _a = Object.keys(this.settings.effects); _i < _a.length; _i++) {\n var key = _a[_i];\n this.settings.effects[key].enabled = false;\n }\n };\n CursorEffectsJoke.prototype.weight = function (effect) {\n var s = this.settings.effects[effect];\n return s.enabled ? s.weight : 0;\n };\n CursorEffectsJoke.prototype.getRandomEffect = function () {\n var _this = this;\n var elements = Object.keys(CursorEffectsEnum).map(function (e) { return e; });\n var totalWeight = elements.reduce(function (sum, element) { return sum + _this.weight(element); }, 0);\n var randomWeight = Math.random() * totalWeight;\n var currentWeight = 0;\n for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n var element = elements_1[_i];\n currentWeight += this.weight(element);\n if (randomWeight <= currentWeight) {\n return element;\n }\n }\n throw new Error(\"Тебя быть тут не должно...\");\n };\n CursorEffectsJoke.prototype.start = function () {\n var effect = this.getRandomEffect();\n var settings = this.settings.effects[effect];\n this.active_cursor_effect = resolveCursorEffectsEnum(effect, settings);\n };\n CursorEffectsJoke.prototype.stop = function () {\n this.active_cursor_effect.destroy();\n };\n return CursorEffectsJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.StopableJoke));\n\nvar CursorEffectsEnum;\n(function (CursorEffectsEnum) {\n CursorEffectsEnum[\"Rainbow\"] = \"rainbow\";\n CursorEffectsEnum[\"SpringyEmoji\"] = \"springy_emoji\";\n CursorEffectsEnum[\"FairyDust\"] = \"fairy_dust\";\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}\nvar CursorEffectsJokeSettings = /** @class */ (function () {\n function CursorEffectsJokeSettings() {\n var _a;\n this.enabled = true;\n this.chance = 100;\n this.effects = (_a = {},\n _a[CursorEffectsEnum.Rainbow] = new /** @class */ (function (_super) {\n __extends(class_1, _super);\n function class_1() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\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 return _this;\n }\n return class_1;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.FairyDust] = new /** @class */ (function (_super) {\n __extends(class_2, _super);\n function class_2() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Цвет звёздочек\n */\n _this.colors = [\"#ff0000\", \"#00ff00\", \"#0000ff\"];\n return _this;\n }\n return class_2;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.SpringyEmoji] = new /** @class */ (function (_super) {\n __extends(class_3, _super);\n function class_3() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Эмодзи \"на резинке\"\n */\n _this.emoji = \"🤪\";\n return _this;\n }\n return class_3;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.Emoji] = new /** @class */ (function (_super) {\n __extends(class_4, _super);\n function class_4() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Падающие эмодзи\n */\n _this.emoji = [\"🔥\", \"🐬\", \"🦆\"];\n return _this;\n }\n return class_4;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.Trailing] = new /** @class */ (function (_super) {\n __extends(class_5, _super);\n function class_5() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Количество элементов\n */\n _this.particles = 15;\n /**\n * Скорость частиц\n */\n _this.rate = 0.4;\n /**\n * Ссылка на картинку с курсором\n */\n _this.baseImageSrc = null;\n return _this;\n }\n return class_5;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.TextFlag] = new /** @class */ (function (_super) {\n __extends(class_6, _super);\n function class_6() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\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 return _this;\n }\n return class_6;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.FollowingDot] = new /** @class */ (function (_super) {\n __extends(class_7, _super);\n function class_7() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return class_7;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.Snowflake] = new /** @class */ (function (_super) {\n __extends(class_8, _super);\n function class_8() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.weight = 0;\n return _this;\n }\n return class_8;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.Clock] = new /** @class */ (function (_super) {\n __extends(class_9, _super);\n function class_9() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\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 return _this;\n }\n return class_9;\n }(DefaultCursorEffectsSetting)),\n _a[CursorEffectsEnum.Ghost] = new DefaultCursorEffectsSetting,\n _a[CursorEffectsEnum.Bubbles] = new DefaultCursorEffectsSetting,\n _a);\n }\n return CursorEffectsJokeSettings;\n}());\n\nvar DefaultCursorEffectsSetting = /** @class */ (function () {\n function DefaultCursorEffectsSetting() {\n /**\n * Флаг возможности срабатывания\n */\n this.enabled = false;\n /**\n * Весовой коэффициент вероятности курсора\n */\n this.weight = 50;\n }\n return DefaultCursorEffectsSetting;\n}());\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/cursor.ts?"); /***/ }), @@ -66,7 +76,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \****************************************/ /***/ ((__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 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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Ад гуманитария**\n *\n * Все \"тся\" заменяются на \"ться\", а все \"ться\" на \"тся\"\n *\n * @author Kozhilya\n */\nvar HumanitarianHellJoke = /** @class */ (function (_super) {\n __extends(HumanitarianHellJoke, _super);\n function HumanitarianHellJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'humanitarian_hell';\n _this.settings = new HumanitarianHellJokeSettings;\n return _this;\n }\n HumanitarianHellJoke.prototype.start = function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each(function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this).html(jquery__WEBPACK_IMPORTED_MODULE_1___default()(this).html().replace(/(ть?ся)/g, function (fnd) {\n return (fnd.indexOf('ь') > 0) ? 'тся' : 'ться';\n }));\n });\n };\n return HumanitarianHellJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar HumanitarianHellJokeSettings = /** @class */ (function () {\n function HumanitarianHellJokeSettings() {\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.post-content';\n }\n return HumanitarianHellJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/humanitarian_hell.ts?"); +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 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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Ад гуманитария**\n *\n * Все \"тся\" заменяются на \"ться\", а все \"ться\" на \"тся\"\n *\n * @author Kozhilya\n */\nvar HumanitarianHellJoke = /** @class */ (function (_super) {\n __extends(HumanitarianHellJoke, _super);\n function HumanitarianHellJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'humanitarian_hell';\n _this.settings = new HumanitarianHellJokeSettings;\n return _this;\n }\n HumanitarianHellJoke.prototype.start = function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).each(function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(this).html(jquery__WEBPACK_IMPORTED_MODULE_1___default()(this).html().replace(/(ть?ся)/g, function (fnd) {\n return (fnd.indexOf('ь') > 0) ? 'тся' : 'ться';\n }));\n });\n };\n return HumanitarianHellJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar HumanitarianHellJokeSettings = /** @class */ (function () {\n function HumanitarianHellJokeSettings() {\n this.enabled = true;\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.post-content';\n }\n return HumanitarianHellJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/humanitarian_hell.ts?"); /***/ }), @@ -76,7 +86,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \***********************************/ /***/ ((__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 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 _handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../handler */ \"./src/handler.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n/**\n * **Буквенный хаос**\n *\n * Все буквы в словах, кроме первой и последней, перемешены.\n *\n * @author Kozhilya\n */\nvar LetterChaosJoke = /** @class */ (function (_super) {\n __extends(LetterChaosJoke, _super);\n function LetterChaosJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'letter_chaos';\n _this.settings = new LetterChaosJokeSettings;\n _this.punctuationSymbols = null;\n return _this;\n }\n LetterChaosJoke.prototype.shuffleLetters = function (word) {\n var _a;\n // Check if the word has two or more letters\n if ((word.length < 3) || !_handler__WEBPACK_IMPORTED_MODULE_2__.AprilFoolsJokeClass.check(this.settings.shuffle_chance)) {\n return word;\n }\n // Split the word into an array of characters\n var characters = word.split(\"\");\n // Shuffle the characters between the first and last letters\n var middleCharacters = characters.slice(1, -1);\n for (var i = middleCharacters.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n _a = [middleCharacters[j], middleCharacters[i]], middleCharacters[i] = _a[0], middleCharacters[j] = _a[1];\n }\n // Join the shuffled characters back into a word\n return __spreadArray(__spreadArray([characters[0]], middleCharacters, true), [characters[characters.length - 1]], false).join(\"\");\n };\n LetterChaosJoke.prototype.processNode = function (node) {\n var _a;\n node.textContent = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.replace(/([А-Яа-яA-Za-z]+)/gm, this.shuffleLetters);\n };\n LetterChaosJoke.prototype.start = function () {\n var _this = this;\n var items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).find('*').contents().filter(function (_, node) { return node.nodeType === Node.TEXT_NODE; });\n items.each(function (_, node) { return _this.processNode(node); });\n };\n return LetterChaosJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar LetterChaosJokeSettings = /** @class */ (function () {\n function LetterChaosJokeSettings() {\n this.chance = 20;\n /**\n * Селектор всех элементов, которые будут затронуты\n */\n this.selector = '.post-content';\n /**\n * Вероятность того, что буквы будут перемешаны\n */\n this.shuffle_chance = 50;\n }\n return LetterChaosJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/letter_chaos.ts?"); +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 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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n/**\n * **Буквенный хаос**\n *\n * Все буквы в словах, кроме первой и последней, перемешены.\n *\n * @author Kozhilya\n */\nvar LetterChaosJoke = /** @class */ (function (_super) {\n __extends(LetterChaosJoke, _super);\n function LetterChaosJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'letter_chaos';\n _this.settings = new LetterChaosJokeSettings;\n _this.punctuationSymbols = null;\n return _this;\n }\n LetterChaosJoke.prototype.shuffleLetters = function (word) {\n var _a;\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 var characters = word.split(\"\");\n // Shuffle the characters between the first and last letters\n var middleCharacters = characters.slice(1, -1);\n for (var i = middleCharacters.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n _a = [middleCharacters[j], middleCharacters[i]], middleCharacters[i] = _a[0], middleCharacters[j] = _a[1];\n }\n // Join the shuffled characters back into a word\n return __spreadArray(__spreadArray([characters[0]], middleCharacters, true), [characters[characters.length - 1]], false).join(\"\");\n };\n LetterChaosJoke.prototype.processNode = function (node) {\n var _a;\n node.textContent = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.replace(/([А-Яа-яA-Za-z]+)/gm, this.shuffleLetters);\n };\n LetterChaosJoke.prototype.start = function () {\n var _this = this;\n var items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector).find('*').contents().filter(function (_, node) { return node.nodeType === Node.TEXT_NODE; });\n items.each(function (_, node) { return _this.processNode(node); });\n };\n return LetterChaosJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar LetterChaosJokeSettings = /** @class */ (function () {\n function LetterChaosJokeSettings() {\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 return LetterChaosJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/letter_chaos.ts?"); /***/ }), @@ -86,7 +96,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*****************************/ /***/ ((__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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Зеркало**\n *\n * Элементы форума отражаются (по крайней мере, пытаются)\n *\n * @author Kozhilya\n */\nvar MirrorJoke = /** @class */ (function (_super) {\n __extends(MirrorJoke, _super);\n function MirrorJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'mirror';\n _this.settings = new MirrorJokeSettings;\n return _this;\n }\n MirrorJoke.prototype.start = function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()('.post, .post h3, .post-links, .post-author, .post-content')\n .css('transform', 'scaleX(-1)').css('-moz-transform', 'scaleX(-1)').css('-moz-transform', 'scaleX(-1)').css('filter', 'FlipH').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 return MirrorJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar MirrorJokeSettings = /** @class */ (function () {\n function MirrorJokeSettings() {\n this.chance = 30;\n }\n return MirrorJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/mirror.ts?"); +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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Зеркало**\n *\n * Элементы форума отражаются (по крайней мере, пытаются)\n *\n * @author Kozhilya\n */\nvar MirrorJoke = /** @class */ (function (_super) {\n __extends(MirrorJoke, _super);\n function MirrorJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'mirror';\n _this.settings = new MirrorJokeSettings;\n return _this;\n }\n MirrorJoke.prototype.start = function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default()('.post, .post h3, .post-links, .post-author, .post-content')\n .css('transform', 'scaleX(-1)').css('-moz-transform', 'scaleX(-1)').css('-moz-transform', 'scaleX(-1)').css('filter', 'FlipH').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 return MirrorJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.Joke));\n\nvar MirrorJokeSettings = /** @class */ (function () {\n function MirrorJokeSettings() {\n this.enabled = true;\n this.chance = 30;\n }\n return MirrorJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/mirror.ts?"); /***/ }), @@ -96,7 +106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \****************************/ /***/ ((__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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Форумо-трясение**\n *\n * Страница форума начинает трястись\n *\n * @author Kozhilya\n */\nvar ShakeJoke = /** @class */ (function (_super) {\n __extends(ShakeJoke, _super);\n function ShakeJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'shake';\n _this.settings = new ShakeJokeSettings;\n _this.data_name = 'april-fools-shake';\n return _this;\n }\n ShakeJoke.prototype.rand = function (a) {\n return a + this.settings.force * (Math.random() * 2 - 1);\n };\n ShakeJoke.prototype.start = function () {\n var _this = this;\n this.items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector);\n this.items.each(function (_, elem) {\n var data = {};\n _this.settings.directions.forEach(function (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(function () {\n _this.items.each(function (_, elem) {\n var data = jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).data(_this.data_name);\n for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {\n var entry = _a[_i];\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).css('margin-' + entry[0], _this.rand(entry[1]));\n }\n });\n }, this.settings.interval);\n };\n ShakeJoke.prototype.stop = function () {\n var _this = this;\n clearInterval(this.interval_id);\n this.items.each(function (_, elem) {\n var data = {};\n _this.settings.directions.forEach(function (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 return ShakeJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.StopableJoke));\n\nvar ShakeJokeSettings = /** @class */ (function () {\n function ShakeJokeSettings() {\n this.chance = 1;\n /**\n * Направление тряски\n */\n this.directions = ['top', 'left', 'bottom', 'left'];\n /**\n * Селектор всех элементов, которые будут трястись\n */\n this.selector = '[id^=pun]';\n /**\n * Частота тряски\n */\n this.interval = 100;\n /**\n * Сила тряски\n */\n this.force = 0.5;\n }\n return ShakeJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/shake.ts?"); +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__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * **Форумо-трясение**\n *\n * Страница форума начинает трястись\n *\n * @author Kozhilya\n */\nvar ShakeJoke = /** @class */ (function (_super) {\n __extends(ShakeJoke, _super);\n function ShakeJoke() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = 'shake';\n _this.settings = new ShakeJokeSettings;\n _this.data_name = 'april-fools-shake';\n return _this;\n }\n ShakeJoke.prototype.rand = function (a) {\n return a + this.settings.force * (Math.random() * 2 - 1);\n };\n ShakeJoke.prototype.start = function () {\n var _this = this;\n this.items = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.settings.selector);\n this.items.each(function (_, elem) {\n var data = {};\n _this.settings.directions.forEach(function (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(function () {\n _this.items.each(function (_, elem) {\n var data = jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).data(_this.data_name);\n for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {\n var entry = _a[_i];\n jquery__WEBPACK_IMPORTED_MODULE_1___default()(elem).css('margin-' + entry[0], _this.rand(entry[1]));\n }\n });\n }, this.settings.interval);\n };\n ShakeJoke.prototype.stop = function () {\n var _this = this;\n clearInterval(this.interval_id);\n this.items.each(function (_, elem) {\n var data = {};\n _this.settings.directions.forEach(function (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 return ShakeJoke;\n}(_joke__WEBPACK_IMPORTED_MODULE_0__.StopableJoke));\n\nvar ShakeJokeSettings = /** @class */ (function () {\n function ShakeJokeSettings() {\n this.enabled = true;\n this.chance = 1;\n /**\n * Направление тряски\n */\n this.directions = ['top', 'left', 'bottom', 'left'];\n /**\n * Селектор всех элементов, которые будут трястись\n */\n this.selector = '[id^=pun]';\n /**\n * Частота тряски\n */\n this.interval = 100;\n /**\n * Сила тряски\n */\n this.force = 0.5;\n }\n return ShakeJokeSettings;\n}());\n\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/shake.ts?"); /***/ }), @@ -106,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handler */ \"./src/handler.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_crazy_punctuation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./jokes/crazy_punctuation */ \"./src/jokes/crazy_punctuation.ts\");\n/* harmony import */ var _jokes_letter_chaos__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jokes/letter_chaos */ \"./src/jokes/letter_chaos.ts\");\n\n\n\n\n\n\n\n\nwindow.AprilJokes = (function (jokes) {\n var cl = new _handler__WEBPACK_IMPORTED_MODULE_0__.AprilFoolsJokeClass();\n jokes.forEach(function (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_crazy_punctuation__WEBPACK_IMPORTED_MODULE_6__.CrazyPunctuationJoke,\n _jokes_letter_chaos__WEBPACK_IMPORTED_MODULE_7__.LetterChaosJoke,\n]);\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/main.ts?"); +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_crazy_punctuation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./jokes/crazy_punctuation */ \"./src/jokes/crazy_punctuation.ts\");\n/* harmony import */ var _jokes_letter_chaos__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jokes/letter_chaos */ \"./src/jokes/letter_chaos.ts\");\n/* harmony import */ var _jokes_cursor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./jokes/cursor */ \"./src/jokes/cursor.ts\");\n\n\n\n\n\n\n\n\n\nwindow.AprilJokes = (function (jokes) {\n var cl = new _joker__WEBPACK_IMPORTED_MODULE_0__.JokerClass();\n jokes.forEach(function (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_crazy_punctuation__WEBPACK_IMPORTED_MODULE_6__.CrazyPunctuationJoke,\n _jokes_letter_chaos__WEBPACK_IMPORTED_MODULE_7__.LetterChaosJoke,\n _jokes_cursor__WEBPACK_IMPORTED_MODULE_8__.CursorEffectsJoke,\n]);\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/main.ts?"); /***/ }), @@ -118,6 +128,16 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _han 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=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;e0)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=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{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{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=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{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=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=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{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=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;e0;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{g.matches?v():p()},p(),{destroy:v}};\n\n\n//# sourceURL=webpack://mybb-april-fools/./node_modules/cursor-effects/dist/cjs.cjs?"); + /***/ }) /******/ }); diff --git a/dist/april-fools.min.js b/dist/april-fools.min.js index 52d6340..905a914 100644 --- a/dist/april-fools.min.js +++ b/dist/april-fools.min.js @@ -1 +1 @@ -(()=>{"use strict";var t,n={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return n.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)n.o(o,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n)},o=(t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)},function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),r=function(){this.enabled=!0},e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n}(r),i=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),s=function(){function t(){this.core_settings=new c,this.jokes={}}return t.check=function(t){return Math.random()<.01*t},t.prototype.add=function(t){this.jokes[t.id]=t},t.prototype.addCustom=function(t,n,o){void 0===o&&(o=null);var e=new(function(o){function r(){var n=null!==o&&o.apply(this,arguments)||this;return n.id=t,n.settings={chance:10},n}return i(r,o),r.prototype.start=function(){n.call(this,this.settings)},r}(r));Object.assign(e.settings,null!=o?o:{}),this.add(e)},Object.defineProperty(t.prototype,"settings",{get:function(){var t={};t.core=this.core_settings;for(var n=0,o=Object.entries(this.jokes);n0?"тся":"ться"})))}))},n}(r),g=function(){this.chance=20,this.selector=".post-content"},d=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),O=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="mirror",n.settings=new w,n}return d(n,t),n.prototype.start=function(){f()(".post, .post h3, .post-links, .post-author, .post-content").css("transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("filter","FlipH").css("-ms-filter",'"FlipH"'),f()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),f()(".post h3 span").css("margin-right","25em")},n}(r),w=function(){this.chance=30},j=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),b=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="carnival",n.settings=new m,n}return j(n,t),n.prototype.start=function(){var t=this;f()(this.settings.selector).each((function(n,o){for(var r=[],e=0,i=Object.entries(t.settings.variants);e0&&f()(o).css({filter:r.join(" ")})}))},n}(r),m=function(){this.chance=30,this.selector='img[src*="/avatars/"]',this.variant_chance=20,this.variants={"sepia({0}%)":100,"saturate({0}%)":100,"hue-rotate({0}deg)":360,"invert({0}%)":100}},P=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),k=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="crazy_letters",n.settings=new E,n}return P(n,t),n.prototype.start=function(){var t=this;f()(this.settings.selector).each((function(n,o){for(var r=f()(t).text(),e="",i=0;i{"use strict";var t={442:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bubbleCursor=function(t){let e,n,i,o=t&&t.element,r=o||document.body,s=window.innerWidth,c=window.innerHeight,l={x:s/2,y:s/2},a=[],h=[];const u=window.matchMedia("(prefers-reduced-motion: reduce)");function d(){if(u.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",o?(e.style.position="absolute",r.appendChild(e),e.width=r.clientWidth,e.height=r.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=s,e.height=c),r.addEventListener("mousemove",A),r.addEventListener("touchmove",p,{passive:!0}),r.addEventListener("touchstart",p,{passive:!0}),window.addEventListener("resize",f),y()}function f(t){s=window.innerWidth,c=window.innerHeight,o?(e.width=r.clientWidth,e.height=r.clientHeight):(e.width=s,e.height=c)}function p(t){if(t.touches.length>0)for(let e=0;e=0;t--)a[t].lifeSpan<0&&a.splice(t,1);0==a.length&&n.clearRect(0,0,s,c)}}(),i=requestAnimationFrame(y)}function m(){e.remove(),cancelAnimationFrame(i),r.removeEventListener("mousemove",A),r.removeEventListener("touchmove",p),r.removeEventListener("touchstart",p),window.addEventListener("resize",f)}function v(t,e,n){const i=Math.floor(60*Math.random()+60);this.initialLifeSpan=i,this.lifeSpan=i,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/10),y:-1*Math.random()-.4},this.position={x:t,y:e},this.canv=n,this.baseDimension=4,this.update=function(t){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 e=.2+(this.initialLifeSpan-this.lifeSpan)/this.initialLifeSpan;t.fillStyle="#e6f1f7",t.strokeStyle="#3a92c5",t.beginPath(),t.arc(this.position.x-this.baseDimension/2*e,this.position.y-this.baseDimension/2,this.baseDimension*e,0,2*Math.PI),t.stroke(),t.fill(),t.closePath()}}return u.onchange=()=>{u.matches?m():d()},d(),{destroy:m}},e.clockCursor=function(t){let e,n,i,o=t&&t.element,r=o||document.body,s=window.innerWidth,c=window.innerHeight,l={x:s/2,y:s/2};const a=t&&t.dateColor||"blue",h=t&&t.faceColor||"black",u=t&&t.secondsColor||"red",d=t&&t.minutesColor||"black",f=t&&t.hoursColor||"black",p=.4;let A=new Date,g=A.getDate(),y=A.getYear()+1900;const m=(" "+["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"][A.getDay()]+" "+g+" "+["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"][A.getMonth()]+" "+y).split(""),v=["3","4","5","6","7","8","9","10","11","12","1","2"],w=v.length,x=["•","•","•"],E=["•","•","•","•"],b=["•","•","•","•","•"],C=360/w,M=360/m.length,L=45/6.5,S=[],B=[],_=[],R=[],Y=[],j=[],O=[],T=[],H=[];var W=parseInt(m.length+w+x.length+E.length+b.length)+1;const F=window.matchMedia("(prefers-reduced-motion: reduce)");function I(){if(F.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",o?(e.style.position="absolute",r.appendChild(e),e.width=r.clientWidth,e.height=r.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=s,e.height=c),n.font="10px sans-serif",n.textAlign="center",n.textBaseline="middle";for(let t=0;t0)if(o){const e=r.getBoundingClientRect();l.x=t.touches[0].clientX-e.left,l.y=t.touches[0].clientY-e.top}else l.x=t.touches[0].clientX,l.y=t.touches[0].clientY}function X(t){if(o){const e=r.getBoundingClientRect();l.x=t.clientX-e.left,l.y=t.clientY-e.top}else l.x=t.clientX,l.y=t.clientY}function P(){!function(){_[0]=Math.round(S[0]+=(l.y-S[0])*p),R[0]=Math.round(B[0]+=(l.x-B[0])*p);for(let t=1;t=c-80&&(S[t-1]=c-80),B[t-1]>=s-80&&(B[t-1]=s-80)}(),function(){n.clearRect(0,0,s,c);const t=new Date,e=t.getSeconds(),i=Math.PI*(e-15)/30,o=t.getMinutes(),r=Math.PI*(o-15)/30,l=t.getHours(),a=Math.PI*(l-3)/6+Math.PI*parseInt(t.getMinutes())/360;for(let t=0;t{F.matches?z():I()},I(),{destroy:z}},e.emojiCursor=function(t){const e=t&&t.emoji||["😀","😂","😆","😊"];let n=t&&t.element,i=n||document.body,o=window.innerWidth,r=window.innerHeight;const s={x:o/2,y:o/2},c={x:o/2,y:o/2};let l=0;const a=[],h=[];let u,d,f;const p=window.matchMedia("(prefers-reduced-motion: reduce)");function A(){if(p.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;u=document.createElement("canvas"),d=u.getContext("2d"),u.style.top="0px",u.style.left="0px",u.style.pointerEvents="none",n?(u.style.position="absolute",i.appendChild(u),u.width=i.clientWidth,u.height=i.clientHeight):(u.style.position="fixed",document.body.appendChild(u),u.width=o,u.height=r),d.font="21px serif",d.textBaseline="middle",d.textAlign="center",e.forEach((t=>{let e=d.measureText(t),n=document.createElement("canvas"),i=n.getContext("2d");n.width=e.width,n.height=2*e.actualBoundingBoxAscent,i.textAlign="center",i.font="21px serif",i.textBaseline="middle",i.fillText(t,n.width/2,e.actualBoundingBoxAscent),h.push(n)})),i.addEventListener("mousemove",m,{passive:!0}),i.addEventListener("touchmove",y,{passive:!0}),i.addEventListener("touchstart",y,{passive:!0}),window.addEventListener("resize",g),w()}function g(t){o=window.innerWidth,r=window.innerHeight,n?(u.width=i.clientWidth,u.height=i.clientHeight):(u.width=o,u.height=r)}function y(t){if(t.touches.length>0)for(let e=0;e{if(n){const e=i.getBoundingClientRect();s.x=t.clientX-e.left,s.y=t.clientY-e.top}else s.x=t.clientX,s.y=t.clientY;Math.hypot(s.x-c.x,s.y-c.y)>1&&(v(s.x,s.y,h[Math.floor(Math.random()*e.length)]),c.x=s.x,c.y=s.y,l=t.timeStamp)}))}function v(t,e,n){a.push(new E(t,e,n))}function w(){!function(){if(0!=a.length){d.clearRect(0,0,o,r);for(let t=0;t=0;t--)a[t].lifeSpan<0&&a.splice(t,1);0==a.length&&d.clearRect(0,0,o,r)}}(),f=requestAnimationFrame(w)}function x(){u.remove(),cancelAnimationFrame(f),i.removeEventListener("mousemove",m),i.removeEventListener("touchmove",y),i.removeEventListener("touchstart",y),window.addEventListener("resize",g)}function E(t,e,n){const i=Math.floor(60*Math.random()+80);this.initialLifeSpan=i,this.lifeSpan=i,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.4*Math.random()+.8},this.position={x:t,y:e},this.canv=n,this.update=function(t){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.05;const e=Math.max(this.lifeSpan/this.initialLifeSpan,0);t.drawImage(this.canv,this.position.x-this.canv.width/2*e,this.position.y-this.canv.height/2,this.canv.width*e,this.canv.height*e)}}return p.onchange=()=>{p.matches?x():A()},A(),{destroy:x}},e.fairyDustCursor=function(t){let e=t&&t.colors||["#D61C59","#E7D84B","#1B8798"],n=t&&t.element,i=n||document.body,o=window.innerWidth,r=window.innerHeight;const s={x:o/2,y:o/2},c={x:o/2,y:o/2},l=[],a=[];let h,u,d;const f=window.matchMedia("(prefers-reduced-motion: reduce)");function p(){if(f.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;h=document.createElement("canvas"),u=h.getContext("2d"),h.style.top="0px",h.style.left="0px",h.style.pointerEvents="none",n?(h.style.position="absolute",i.appendChild(h),h.width=i.clientWidth,h.height=i.clientHeight):(h.style.position="fixed",i.appendChild(h),h.width=o,h.height=r),u.font="21px serif",u.textBaseline="middle",u.textAlign="center",e.forEach((t=>{let e=u.measureText("*"),n=document.createElement("canvas"),i=n.getContext("2d");n.width=e.width,n.height=e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,i.fillStyle=t,i.textAlign="center",i.font="21px serif",i.textBaseline="middle",i.fillText("*",n.width/2,e.actualBoundingBoxAscent),a.push(n)})),i.addEventListener("mousemove",y),i.addEventListener("touchmove",g,{passive:!0}),i.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",A),v()}function A(t){o=window.innerWidth,r=window.innerHeight,n?(h.width=i.clientWidth,h.height=i.clientHeight):(h.width=o,h.height=r)}function g(t){if(t.touches.length>0)for(let e=0;e{if(n){const e=i.getBoundingClientRect();s.x=t.clientX-e.left,s.y=t.clientY-e.top}else s.x=t.clientX,s.y=t.clientY;Math.hypot(s.x-c.x,s.y-c.y)>1.5&&(m(s.x,s.y,a[Math.floor(Math.random()*e.length)]),c.x=s.x,c.y=s.y)}))}function m(t,e,n){l.push(new x(t,e,n))}function v(){!function(){if(0!=l.length){u.clearRect(0,0,o,r);for(let t=0;t=0;t--)l[t].lifeSpan<0&&l.splice(t,1);0==l.length&&u.clearRect(0,0,o,r)}}(),d=requestAnimationFrame(v)}function w(){h.remove(),cancelAnimationFrame(d),i.removeEventListener("mousemove",y),i.removeEventListener("touchmove",g),i.removeEventListener("touchstart",g),window.addEventListener("resize",A)}function x(t,e,n){const i=Math.floor(30*Math.random()+60);this.initialLifeSpan=i,this.lifeSpan=i,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.7*Math.random()+.9},this.position={x:t,y:e},this.canv=n,this.update=function(t){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.02;const e=Math.max(this.lifeSpan/this.initialLifeSpan,0);t.drawImage(this.canv,this.position.x-this.canv.width/2*e,this.position.y-this.canv.height/2,this.canv.width*e,this.canv.height*e)}}return f.onchange=()=>{f.matches?w():p()},p(),{destroy:w}},e.followingDotCursor=function(t){let e,n,i=t&&t.element,o=i||document.body,r=window.innerWidth,s=window.innerHeight,c={x:r/2,y:r/2},l=new function(t,e,n,i){this.position={x:t,y:e},this.width=10,this.lag=10,this.moveTowards=function(t,e,n){this.position.x+=(t-this.position.x)/this.lag,this.position.y+=(e-this.position.y)/this.lag,n.fillStyle=a,n.beginPath(),n.arc(this.position.x,this.position.y,this.width,0,2*Math.PI),n.fill(),n.closePath()}}(r/2,s/2,10,10),a=t?.color||"#323232a6";const h=window.matchMedia("(prefers-reduced-motion: reduce)");function u(){if(h.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",i?(e.style.position="absolute",o.appendChild(e),e.width=o.clientWidth,e.height=o.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=r,e.height=s),o.addEventListener("mousemove",f),window.addEventListener("resize",d),p()}function d(t){r=window.innerWidth,s=window.innerHeight,i?(e.width=o.clientWidth,e.height=o.clientHeight):(e.width=r,e.height=s)}function f(t){if(i){const e=o.getBoundingClientRect();c.x=t.clientX-e.left,c.y=t.clientY-e.top}else c.x=t.clientX,c.y=t.clientY}function p(){n.clearRect(0,0,r,s),l.moveTowards(c.x,c.y,n),requestAnimationFrame(p)}function A(){e.remove(),cancelAnimationFrame(p),o.removeEventListener("mousemove",f),window.addEventListener("resize",d)}return h.onchange=()=>{h.matches?A():u()},u(),{destroy:A}},e.ghostCursor=function(t){let e,n,i,o=t&&t.element,r=o||document.body,s=window.innerWidth,c=window.innerHeight,l={x:s/2,y:s/2},a=[],h=new Image;h.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 u=window.matchMedia("(prefers-reduced-motion: reduce)");function d(){if(u.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",o?(e.style.position="absolute",r.appendChild(e),e.width=r.clientWidth,e.height=r.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=s,e.height=c),r.addEventListener("mousemove",A),r.addEventListener("touchmove",p,{passive:!0}),r.addEventListener("touchstart",p,{passive:!0}),window.addEventListener("resize",f),y()}function f(t){s=window.innerWidth,c=window.innerHeight,o?(e.width=r.clientWidth,e.height=r.clientHeight):(e.width=s,e.height=c)}function p(t){if(t.touches.length>0)for(let e=0;e=0;t--)a[t].lifeSpan<0&&a.splice(t,1);0==a.length&&n.clearRect(0,0,s,c)}}(),i=requestAnimationFrame(y)}function m(){e.remove(),cancelAnimationFrame(i),r.removeEventListener("mousemove",A),r.removeEventListener("touchmove",p),r.removeEventListener("touchstart",p),window.addEventListener("resize",f)}function v(t,e,n){this.initialLifeSpan=40,this.lifeSpan=40,this.position={x:t,y:e},this.image=n,this.update=function(t){this.lifeSpan--;const e=Math.max(this.lifeSpan/this.initialLifeSpan,0);t.globalAlpha=e,t.drawImage(this.image,this.position.x,this.position.y)}}return u.onchange=()=>{u.matches?m():d()},d(),{destroy:m}},e.rainbowCursor=function(t){let e,n,i,o=t&&t.element,r=o||document.body,s=window.innerWidth,c=window.innerHeight,l={x:s/2,y:s/2},a=[];const h=t?.length||20,u=t?.colors||["#FE0000","#FD8C00","#FFE500","#119F0B","#0644B3","#C22EDC"],d=t?.size||3;let f=!1;const p=window.matchMedia("(prefers-reduced-motion: reduce)");function A(){if(p.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",o?(e.style.position="absolute",r.appendChild(e),e.width=r.clientWidth,e.height=r.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=s,e.height=c),r.addEventListener("mousemove",y),window.addEventListener("resize",g),m()}function g(t){s=window.innerWidth,c=window.innerHeight,o?(e.width=r.clientWidth,e.height=r.clientHeight):(e.width=s,e.height=c)}function y(t){if(o){const e=r.getBoundingClientRect();l.x=t.clientX-e.left,l.y=t.clientY-e.top}else l.x=t.clientX,l.y=t.clientY;if(!1===f){f=!0;for(let t=0;t{n.beginPath(),n.strokeStyle=e,t.length&&n.moveTo(t[0].x,t[0].y+i*(d-1)),t.forEach(((t,e)=>{0!==e&&n.lineTo(t.x,t.y+i*d)})),n.lineWidth=d,n.lineCap="round",n.stroke()}))}(),i=requestAnimationFrame(m)}function v(){e.remove(),cancelAnimationFrame(i),r.removeEventListener("mousemove",y),window.addEventListener("resize",g)}function w(t,e){this.position={x:t,y:e}}return p.onchange=()=>{p.matches?v():A()},A(),{destroy:v}},e.snowflakeCursor=function(t){let e,n,i,o=t&&t.element,r=o||document.body,s=["❄️"],c=window.innerWidth,l=window.innerHeight,a={x:c/2,y:c/2},h=[],u=[];const d=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(d.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",o?(e.style.position="absolute",r.appendChild(e),e.width=r.clientWidth,e.height=r.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=c,e.height=l),n.font="12px serif",n.textBaseline="middle",n.textAlign="center",s.forEach((t=>{let e=n.measureText(t),i=document.createElement("canvas"),o=i.getContext("2d");i.width=e.width,i.height=2*e.actualBoundingBoxAscent,o.textAlign="center",o.font="12px serif",o.textBaseline="middle",o.fillText(t,i.width/2,e.actualBoundingBoxAscent),u.push(i)})),r.addEventListener("mousemove",g),r.addEventListener("touchmove",A,{passive:!0}),r.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",p),m()}function p(t){c=window.innerWidth,l=window.innerHeight,o?(e.width=r.clientWidth,e.height=r.clientHeight):(e.width=c,e.height=l)}function A(t){if(t.touches.length>0)for(let e=0;e=0;t--)h[t].lifeSpan<0&&h.splice(t,1);0==h.length&&n.clearRect(0,0,c,l)}}(),i=requestAnimationFrame(m)}function v(){e.remove(),cancelAnimationFrame(i),r.removeEventListener("mousemove",g),r.removeEventListener("touchmove",A),r.removeEventListener("touchstart",A),window.addEventListener("resize",p)}function w(t,e,n){const i=Math.floor(60*Math.random()+80);this.initialLifeSpan=i,this.lifeSpan=i,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:1+Math.random()},this.position={x:t,y:e},this.canv=n,this.update=function(t){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 e=Math.max(this.lifeSpan/this.initialLifeSpan,0),n=2*this.lifeSpan*.0174533;t.translate(this.position.x,this.position.y),t.rotate(n),t.drawImage(this.canv,-this.canv.width/2*e,-this.canv.height/2,this.canv.width*e,this.canv.height*e),t.rotate(-n),t.translate(-this.position.x,-this.position.y)}}return d.onchange=()=>{d.matches?v():f()},f(),{destroy:v}},e.springyEmojiCursor=function(t){let e,n,i,o,r=t&&t.emoji||"🤪",s=t&&t.element,c=s||document.body,l=window.innerWidth,a=window.innerHeight,h={x:l/2,y:l/2},u=[];const d=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(d.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",s?(e.style.position="absolute",c.appendChild(e),e.width=c.clientWidth,e.height=c.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=l,e.height=a),n.font="16px serif",n.textBaseline="middle",n.textAlign="center";let t=n.measureText(r),i=document.createElement("canvas"),h=i.getContext("2d");i.width=t.width,i.height=2*t.actualBoundingBoxAscent,h.textAlign="center",h.font="16px serif",h.textBaseline="middle",h.fillText(r,i.width/2,t.actualBoundingBoxAscent),o=i;let f=0;for(f=0;f<7;f++)u[f]=new x(o);c.addEventListener("mousemove",g),c.addEventListener("touchmove",A,{passive:!0}),c.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",p),y()}function p(t){l=window.innerWidth,a=window.innerHeight,s?(e.width=c.clientWidth,e.height=c.clientHeight):(e.width=l,e.height=a)}function A(t){if(t.touches.length>0)if(s){const e=c.getBoundingClientRect();h.x=t.touches[0].clientX-e.left,h.y=t.touches[0].clientY-e.top}else h.x=t.touches[0].clientX,h.y=t.touches[0].clientY}function g(t){if(s){const e=c.getBoundingClientRect();h.x=t.clientX-e.left,h.y=t.clientY-e.top}else h.x=t.clientX,h.y=t.clientY}function y(){!function(){e.width=e.width,u[0].position.x=h.x,u[0].position.y=h.y;for(let t=1;t<7;t++){let i=new v(0,0);t>0&&w(t-1,t,i),t<6&&w(t+1,t,i);let o,r,s=new v(10*-u[t].velocity.x,10*-u[t].velocity.y),c=new v((i.X+s.X)/1,(i.Y+s.Y)/1+50);u[t].velocity.x+=.01*c.X,u[t].velocity.y+=.01*c.Y,Math.abs(u[t].velocity.x)<.1&&Math.abs(u[t].velocity.y)<.1&&Math.abs(c.X)<.1&&Math.abs(c.Y)<.1&&(u[t].velocity.x=0,u[t].velocity.y=0),u[t].position.x+=u[t].velocity.x,u[t].position.y+=u[t].velocity.y,o=e.clientHeight,r=e.clientWidth,u[t].position.y>=o-11-1&&(u[t].velocity.y>0&&(u[t].velocity.y=.7*-u[t].velocity.y),u[t].position.y=o-11-1),u[t].position.x>=r-11&&(u[t].velocity.x>0&&(u[t].velocity.x=.7*-u[t].velocity.x),u[t].position.x=r-11-1),u[t].position.x<0&&(u[t].velocity.x<0&&(u[t].velocity.x=.7*-u[t].velocity.x),u[t].position.x=0),u[t].draw(n)}}(),i=requestAnimationFrame(y)}function m(){e.remove(),cancelAnimationFrame(i),c.removeEventListener("mousemove",g),c.removeEventListener("touchmove",A),c.removeEventListener("touchstart",A),window.addEventListener("resize",p)}function v(t,e){this.X=t,this.Y=e}function w(t,e,n){let i=u[t].position.x-u[e].position.x,o=u[t].position.y-u[e].position.y,r=Math.sqrt(i*i+o*o);if(r>10){let t=10*(r-10);n.X+=i/r*t,n.Y+=o/r*t}}function x(t){this.position={x:h.x,y:h.y},this.velocity={x:0,y:0},this.canv=t,this.draw=function(t){t.drawImage(this.canv,this.position.x-this.canv.width/2,this.position.y-this.canv.height/2,this.canv.width,this.canv.height)}}return d.onchange=()=>{d.matches?m():f()},f(),{destroy:m}},e.textFlag=function(t){let e,n,i,o=t||{},r=t&&t.element,s=r||document.body,c=o.text?" "+t.text:" Your Text Here",l=o.font||"monospace",a=o.textSize||12,h=a+"px "+l,u=o.gap||a+2,d=0,f=[],p=window.innerWidth,A=window.innerHeight,g={x:p/2,y:p/2};for(let t=0;t0;t--)f[t].x=f[t-1].x+u,f[t].y=f[t-1].y,n.font=h,n.fillText(f[t].letter,f[t].x,f[t].y);let i=f[0].x,o=f[0].y;i+=(g.x-i)/5+t+2,o+=(g.y-o)/5+e,f[0].x=i,f[0].y=o}(),i=requestAnimationFrame(x)}function E(){e.remove(),cancelAnimationFrame(i),s.removeEventListener("mousemove",w),window.addEventListener("resize",v)}return y.onchange=()=>{y.matches?E():m()},m(),{destroy:E}},e.trailingCursor=function(t){let e,n,i,o=t&&t.element,r=o||document.body,s=window.innerWidth,c=window.innerHeight,l={x:s/2,y:s/2},a=[];const h=t?.particles||15,u=t?.rate||.4,d=t?.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 f=!1,p=new Image;p.src=d;const A=window.matchMedia("(prefers-reduced-motion: reduce)");function g(){if(A.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init"),!1;e=document.createElement("canvas"),n=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",o?(e.style.position="absolute",r.appendChild(e),e.width=r.clientWidth,e.height=r.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=s,e.height=c),r.addEventListener("mousemove",m),window.addEventListener("resize",y),v()}function y(t){s=window.innerWidth,c=window.innerHeight,o?(e.width=r.clientWidth,e.height=r.clientHeight):(e.width=s,e.height=c)}function m(t){if(o){const e=r.getBoundingClientRect();l.x=t.clientX-e.left,l.y=t.clientY-e.top}else l.x=t.clientX,l.y=t.clientY;if(!1===f){f=!0;for(let t=0;t{A.matches?w():g()},g(),{destroy:w}}}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t,e=(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),i=function(){function t(){}return t.prototype.check=function(t){return Math.random()<.01*t},t.prototype.enable=function(){this.settings.enabled=!0},t.prototype.disable=function(){this.settings.enabled=!1},t.prototype.toggle=function(t){void 0===t&&(t=null),this.settings.enabled=null===t?!this.settings.enabled:t},t}(),o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}(i),r=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),s=function(){function t(){this.core_settings=new c,this.jokes={}}return t.prototype.check=function(t){return Math.random()<.01*t},t.prototype.add=function(t){this.jokes[t.id]=t},t.prototype.addCustom=function(t,e,n){void 0===n&&(n=null);var o=new(function(n){function i(){var e=null!==n&&n.apply(this,arguments)||this;return e.id=t,e.settings={chance:10,enabled:!0},e}return r(i,n),i.prototype.start=function(){e.call(this,this.settings)},i}(i));Object.assign(o.settings,null!=n?n:{}),this.add(o)},Object.defineProperty(t.prototype,"settings",{get:function(){var t={};t.core=this.core_settings;for(var e=0,n=Object.entries(this.jokes);e0?"тся":"ться"})))}))},e}(i),g=function(){this.enabled=!0,this.chance=20,this.selector=".post-content"},y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="mirror",e.settings=new v,e}return y(e,t),e.prototype.start=function(){h()(".post, .post h3, .post-links, .post-author, .post-content").css("transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("filter","FlipH").css("-ms-filter",'"FlipH"'),h()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),h()(".post h3 span").css("margin-right","25em")},e}(i),v=function(){this.enabled=!1,this.chance=30},w=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="carnival",e.settings=new E,e}return w(e,t),e.prototype.start=function(){var t=this;h()(this.settings.selector).each((function(e,n){for(var i=[],o=0,r=Object.entries(t.settings.variants);o0&&h()(n).css({filter:i.join(" ")})}))},e}(i),E=function(){this.enabled=!0,this.chance=30,this.selector='img[src*="/avatars/"]',this.variant_chance=20,this.variants={"sepia({0}%)":100,"saturate({0}%)":100,"hue-rotate({0}deg)":360,"invert({0}%)":100}},b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="crazy_letters",e.settings=new M,e}return b(e,t),e.prototype.start=function(){var t=this;h()(this.settings.selector).each((function(e,n){for(var i=h()(t).text(),o="",r=0;r0;o--){var r=Math.floor(Math.random()*(o+1));e=[i[r],i[o]],i[o]=e[0],i[r]=e[1]}return R(R([n[0]],i,!0),[n[n.length-1]],!1).join("")},e.prototype.processNode=function(t){var e;t.textContent=null===(e=t.textContent)||void 0===e?void 0:e.replace(/([А-Яа-яA-Za-z]+)/gm,this.shuffleLetters)},e.prototype.start=function(){var t=this;h()(this.settings.selector).find("*").contents().filter((function(t,e){return e.nodeType===Node.TEXT_NODE})).each((function(e,n){return t.processNode(n)}))},e}(i),j=function(){this.enabled=!0,this.chance=20,this.selector=".post-content",this.shuffle_chance=50},O=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),T=n(442),H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="cursor_effects",e.settings=new I,e}return O(e,t),e.prototype.enableAll=function(){for(var t=0,e=Object.keys(this.settings.effects);t key].enabled = true; + } + } + + /** + * Заблокировать все варианты курсоров + */ + disableAll() { + for (const key of Object.keys(this.settings.effects)) { + this.settings.effects[ key].enabled = false; + } + } + + private weight(effect: CursorEffectsEnum): number { + const s = this.settings.effects[effect]; + return s.enabled ? s.weight : 0; + } + + getRandomEffect(): CursorEffectsEnum { + const elements = Object.keys(CursorEffectsEnum).map(e => e); + const totalWeight = elements.reduce((sum, element) => sum + this.weight(element), 0); + const randomWeight = Math.random() * totalWeight; + + let currentWeight = 0; + for (const element of elements) { + currentWeight += this.weight(element); + if (randomWeight <= currentWeight) { + return element; + } + } + + throw new Error("Тебя быть тут не должно..."); + } + + start(): void { + const effect = this.getRandomEffect(); + const settings = this.settings.effects[effect]; + + this.active_cursor_effect = resolveCursorEffectsEnum(effect, settings); + } + + stop(): void { + this.active_cursor_effect.destroy(); + } +} + +enum CursorEffectsEnum { + Rainbow = 'rainbow', + FairyDust = 'fairy_dust', + SpringyEmoji = 'springy_emoji', + Emoji = 'emoji', + Ghost = 'ghost', + Trailing = 'trailing', + TextFlag = 'text_flag', + FollowingDot = 'following_dot', + Bubbles = 'bubbles', + Snowflake = 'snowflake', + Clock = 'clock' +} + +function resolveCursorEffectsEnum(effect: CursorEffectsEnum|string, options: CursorEffectsSetting): any { + switch (effect) { + case CursorEffectsEnum.Rainbow: + return cursor_effects.rainbowCursor(options); + + case CursorEffectsEnum.FairyDust: + return cursor_effects.fairyDustCursor(options); + + case CursorEffectsEnum.SpringyEmoji: + return cursor_effects.springyEmojiCursor(options); + + case CursorEffectsEnum.Emoji: + return cursor_effects.emojiCursor(options); + + case CursorEffectsEnum.Ghost: + return cursor_effects.ghostCursor(options); + + case CursorEffectsEnum.Trailing: + return cursor_effects.trailingCursor(options); + + case CursorEffectsEnum.TextFlag: + return cursor_effects.textFlag(options); + + case CursorEffectsEnum.FollowingDot: + return cursor_effects.followingDotCursor(options); + + case CursorEffectsEnum.Bubbles: + return cursor_effects.bubbleCursor(options); + + case CursorEffectsEnum.Snowflake: + return cursor_effects.snowflakeCursor(options); + + case CursorEffectsEnum.Clock: + return cursor_effects.clockCursor(options); + } +} + +export class CursorEffectsJokeSettings implements JokeSettings { + enabled: boolean = true; + + chance: number = 100; + + effects: { [key in CursorEffectsEnum]?: CursorEffectsSetting } = { + /** + * Радужный след за курсором + */ + [CursorEffectsEnum.Rainbow]: new class extends DefaultCursorEffectsSetting { + /** + * Длина полосы + */ + length: number = 20; + + /** + * Ширина полосы + */ + size: number = 3; + + /** + * Цвета полос (сверху вниз) + */ + colors: string[] = [ + "#9400D3", + "#4B0082", + "#0000FF", + "#00FF00", + "#FFFF00", + "#FF7F00", + "#FF0000" + ]; + }, + + /** + * Цепочка из эмодзи "на резинке" под курсором + */ + [CursorEffectsEnum.SpringyEmoji]: new class extends DefaultCursorEffectsSetting { + /** + * Висящий эмодзи + */ + emoji: string = "🤪" + }, + + /** + * Падающие от курсора эмодзи + */ + [CursorEffectsEnum.Emoji]: new class extends DefaultCursorEffectsSetting { + /** + * Падающие эмодзи + */ + emoji: string[] = ["🔥", "🐬", "🦆"] + }, + + /** + * Падающие от курсора пылинки + */ + [CursorEffectsEnum.FairyDust]: new class extends DefaultCursorEffectsSetting { + /** + * Цвет пылинок + */ + colors: string[] = ["#ff0000", "#00ff00", "#0000ff"]; + }, + + /** + * След "зависших" курсоров + */ + [CursorEffectsEnum.Ghost]: new DefaultCursorEffectsSetting, + + /** + * След курсоров "на резинке" + */ + [CursorEffectsEnum.Trailing]: new class extends DefaultCursorEffectsSetting { + /** + * Количество элементов + */ + particles: number = 15; + + /** + * Скорость частиц + */ + rate: number = 0.4; + + /** + * Ссылка на картинку с курсором + * Используйте `null`, что бы использовать картинку курсора по умолчанию + */ + baseImageSrc: string | null = null; + }, + + /** + * Текст, развивающийся флагом от курсора + */ + [CursorEffectsEnum.TextFlag]: new class extends DefaultCursorEffectsSetting { + /** + * Отображаемый текст + */ + text: string = "С днём смеха!"; + + /** + * Цвет текста + */ + color: string = "#000000"; + + /** + * Шрифт текста + */ + font: string = "monospace"; + + /** + * Размер текста + */ + textSize: number = 12; + + /** + * Растояние между бквами + */ + gap: number = 14; + + /** + * Размер... чего-то. + */ + size: number = 3; + + }, + + /** + * Точка, преследующая курсор + */ + [CursorEffectsEnum.FollowingDot]: new class extends DefaultCursorEffectsSetting { + /** + * Цвет догоняющей точки + */ + color: string = "#323232a6"; + }, + + /** + * Пузырьки от курсора + */ + [CursorEffectsEnum.Bubbles]: new DefaultCursorEffectsSetting, + + /** + * Снежинки, летящие от курсора + * + * Отключено, потому что сейчас не зима :D + */ + [CursorEffectsEnum.Snowflake]: new class extends DefaultCursorEffectsSetting { + weight: number = 0; + }, + + /** + * Циферблат вокруг курсора + */ + [CursorEffectsEnum.Clock]: new class extends DefaultCursorEffectsSetting { + /** + * Цвет даты + */ + dateColor: string = "blue"; + + /** + * Цвет циферблата + */ + faceColor: string = "black"; + + /** + * Цвет секундной стрелки + */ + secondsColor: string = "red"; + + /** + * Цвет минутной стрелки + */ + minutesColor: string = "black"; + + /** + * Цвет часовой стрелки + */ + hoursColor: string = "black"; + }, + }; +} + +interface CursorEffectsSetting { + [key: string]: any; +} + +class DefaultCursorEffectsSetting implements CursorEffectsSetting { + /** + * Флаг возможности срабатывания + */ + enabled: boolean = true; + + /** + * Весовой коэффициент вероятности курсора + */ + weight: number = 50; +} diff --git a/src/jokes/humanitarian_hell.ts b/src/jokes/humanitarian_hell.ts index 93d8e6b..3e8e1bf 100644 --- a/src/jokes/humanitarian_hell.ts +++ b/src/jokes/humanitarian_hell.ts @@ -23,6 +23,8 @@ export class HumanitarianHellJoke extends Joke { } export class HumanitarianHellJokeSettings implements JokeSettings { + enabled: boolean = true; + chance: number = 20; /** diff --git a/src/jokes/letter_chaos.ts b/src/jokes/letter_chaos.ts index 25ddf9a..0defdda 100644 --- a/src/jokes/letter_chaos.ts +++ b/src/jokes/letter_chaos.ts @@ -1,6 +1,6 @@ import { Joke, JokeSettings, StopableJoke } from "../joke"; import $ from "jquery"; -import { AprilFoolsJokeClass } from "../handler"; +import { JokerClass } from "../joker"; /** * **Буквенный хаос** @@ -18,7 +18,7 @@ export class LetterChaosJoke extends Joke { private shuffleLetters(word: string): string { // Check if the word has two or more letters - if ((word.length < 3) || !AprilFoolsJokeClass.check(this.settings.shuffle_chance)) { + if ((word.length < 3) || !this.check(this.settings.shuffle_chance)) { return word; } @@ -48,6 +48,8 @@ export class LetterChaosJoke extends Joke { } export class LetterChaosJokeSettings implements JokeSettings { + enabled: boolean = true; + chance: number = 20; /** diff --git a/src/jokes/mirror.ts b/src/jokes/mirror.ts index 446a4c8..94a098d 100644 --- a/src/jokes/mirror.ts +++ b/src/jokes/mirror.ts @@ -22,5 +22,7 @@ export class MirrorJoke extends Joke { } export class MirrorJokeSettings implements JokeSettings { + enabled: boolean = false; + chance: number = 30; } \ No newline at end of file diff --git a/src/jokes/shake.ts b/src/jokes/shake.ts index a956356..47e3e1d 100644 --- a/src/jokes/shake.ts +++ b/src/jokes/shake.ts @@ -63,13 +63,20 @@ export class ShakeJoke extends StopableJoke { } export class ShakeJokeSettings implements JokeSettings { + enabled: boolean = true; + chance: number = 1; /** - * Направление тряски + * Направление тряски (тряска происходит путём изменения перечисленных направлений margin на значение ±force от стандартного значения) */ directions: string[] = ['top', 'left', 'bottom', 'left']; + /** + * Сила тряски - насколько отклоняется элемент от стандартного значения + */ + force: number = 0.5; + /** * Селектор всех элементов, которые будут трястись */ @@ -79,11 +86,6 @@ export class ShakeJokeSettings implements JokeSettings { * Частота тряски */ interval: number = 100; - - /** - * Сила тряски - */ - force: number = 0.5; } export interface ShakeJokeMargin { diff --git a/src/main.ts b/src/main.ts index e91bf4c..9636927 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { AprilFoolsJokeClass } from "./handler"; +import { JokerClass } from "./joker"; import { Joke } from "./joke"; import { ShakeJoke } from "./jokes/shake"; import { HumanitarianHellJoke } from "./jokes/humanitarian_hell"; @@ -7,9 +7,10 @@ import { CarnivalJoke } from "./jokes/carnival"; import { CrazyLettersJoke } from "./jokes/crazy_letters"; import { CrazyPunctuationJoke } from "./jokes/crazy_punctuation"; import { LetterChaosJoke } from "./jokes/letter_chaos"; +import { CursorEffectsJoke } from "./jokes/cursor" -(window as any).AprilJokes = ((jokes: JokeClassList): AprilFoolsJokeClass => { - const cl = new AprilFoolsJokeClass(); +(window as any).AprilJokes = ((jokes: JokeClassList): JokerClass => { + const cl = new JokerClass(); jokes.forEach(joke => { cl.add(new joke()); @@ -26,6 +27,7 @@ import { LetterChaosJoke } from "./jokes/letter_chaos"; CrazyLettersJoke, CrazyPunctuationJoke, LetterChaosJoke, + CursorEffectsJoke, ]); interface JokeClassList extends Array Joke> {} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index e1f013a..27937c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,12 @@ "noImplicitAny": true, "module": "es6", "target": "es5", - "allowJs": true + "allowJs": true, + "moduleResolution": "node", + "typeRoots": [ + "./node_modules/@types", + "./types" + ] }, "files": ["src/main.ts"] } \ No newline at end of file