From 137b8f5eb7f77b14a147ba940b90c201e46f4d29 Mon Sep 17 00:00:00 2001 From: kozhilya Date: Mon, 1 Apr 2024 00:50:15 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BE=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D0=B8=201.1.2=20(=D1=84=D0=B8=D0=BD=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=B4=D0=BB=D1=8F=201=20=D0=B0=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=BB=D1=8F=202024=20=D0=B3=D0=BE=D0=B4=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/april-fools.js | 4 ++-- dist/april-fools.min.js | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/april-fools.js b/dist/april-fools.js index 7ea765f..745d47f 100644 --- a/dist/april-fools.js +++ b/dist/april-fools.js @@ -1,5 +1,5 @@ /*! - * mybb-april-fools 1.1.1 (22.03.2024) + * mybb-april-fools 1.1.2 (01.04.2024) * https://forumd.ru/viewtopic.php?id=7372 * Система первоапрельских розыгрышей для форумов MyBB * @author kozhilya @@ -164,7 +164,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FreshGrassJoke: () => (/* binding */ FreshGrassJoke),\n/* harmony export */ FreshGrassJokeSettings: () => (/* binding */ FreshGrassJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _types_html_d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types/html.d */ \"./src/types/html.d.ts\");\n/* harmony import */ var _types_html_d__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_types_html_d__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _html_joke_fresh_glass_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../html/joke-fresh_glass.html */ \"./src/html/joke-fresh_glass.html\");\n/* harmony import */ var _lib_vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/vector */ \"./src/lib/vector.ts\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common */ \"./src/common.ts\");\n\n\n\n\n\n\n/**\n * **Свежая трава**\n *\n * Предложение потрогать траву\n * @author Идея: Magia\n * @author Kozhilya\n */\nclass FreshGrassJoke extends _joke__WEBPACK_IMPORTED_MODULE_1__.Joke {\n constructor() {\n super(...arguments);\n this.id = 'fresh_grass';\n this.title = 'Свежая трава';\n this.description = 'Предложение потрогать траву';\n this._settings = new FreshGrassJokeSettings();\n }\n /**\n * Запуск шутки\n */\n start() {\n jquery__WEBPACK_IMPORTED_MODULE_2___default()(() => this.init());\n }\n /**\n * Основная загрузка шутки\n */\n init() {\n const $body = jquery__WEBPACK_IMPORTED_MODULE_2___default()(document.body);\n document.body.style.setProperty('--fresh-grass-body-top', `-${window.scrollY}px`);\n this.container = jquery__WEBPACK_IMPORTED_MODULE_2___default()(_html_joke_fresh_glass_html__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n this.container.hide(0);\n $body.append(this.container);\n this.container.fadeIn(500);\n this.fleeingGrass();\n }\n /**\n * Отладка\n * @param {string} str\n */\n debug(str) {\n if (!_common__WEBPACK_IMPORTED_MODULE_5__.debugEnabled)\n return;\n jquery__WEBPACK_IMPORTED_MODULE_2___default()('small', this.container).html(`
${str}
`);\n }\n /**\n * Анимация убегания травы от пользователя\n */\n fleeingGrass() {\n this.movement = new Movement(this.settings);\n const $img = jquery__WEBPACK_IMPORTED_MODULE_2___default()('img.april-fools__joke__fresh-grass__image', this.container);\n $img.on('mousedown', () => {\n this.close();\n });\n jquery__WEBPACK_IMPORTED_MODULE_2___default()(window).on('mousemove', (e) => {\n this.movement.mouse = new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector(e.clientX - window.innerWidth / 2, e.clientY - window.innerHeight / 2);\n });\n this.intervalIndex = setInterval(() => {\n const img = $img[0].getBoundingClientRect();\n this.movement.step(img);\n // this.debug(this.movement.debugLines.join('\\n'));\n $img.css('transform', this.movement.state.position.toTransform());\n }, Math.floor(1000 * this.movement.dt));\n }\n /**\n * Закрыть окно\n */\n close() {\n clearInterval(this.intervalIndex);\n this.container.fadeOut({\n duration: 500,\n // eslint-disable-next-line\n // @ts-ignore\n complete: () => {\n this.container.remove();\n scrollTo(0, -parseInt(document.body.style.getPropertyValue('--fresh-grass-body-top')));\n },\n });\n }\n}\n/**\n * Класс обработки движения\n */\nclass Movement {\n /**\n * Конструктор\n * @param {FreshGrassJokeSettings} settings\n */\n constructor(settings) {\n this.settings = settings;\n this.state = {\n position: new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector(),\n velocity: _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(Math.random() * 2 * Math.PI, Math.random() *\n (this.settings.maxVelocity - this.settings.minVelocity) +\n this.settings.minVelocity),\n acceleration: new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector(),\n };\n this.mouse = new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector();\n this.dt = 1.0 / this.settings.tickPerSecond;\n }\n /**\n * Координата движения\n */\n get position() {\n return this.state.position;\n }\n /**\n * Скорость движения\n */\n get velocity() {\n return this.state.velocity;\n }\n /**\n * Ускорение движения\n */\n get acceleration() {\n return this.state.acceleration;\n }\n /**\n * Произвести вычисление\n * @param {DOMRect} img Изображение\n */\n step(img) {\n this.last = this.state;\n this.debugLines = [];\n this.forces = {};\n // Обработка сил\n this.processForces();\n this.processMovement();\n this.processCollisions(img);\n }\n /**\n * Обработка сил\n */\n processForces() {\n // Притяжение к центру\n this.forces.gravity = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(this.last.position.angle + Math.PI, this.settings.gravity);\n // Коррекция скорости\n if (this.last.velocity.length < this.settings.minVelocity) {\n this.forces.correction = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(this.last.velocity.angle, this.settings.correctionForce *\n Math.pow(this.last.velocity.length - this.settings.minVelocity, 2));\n }\n else if (this.last.velocity.length > this.settings.maxVelocity) {\n this.forces.correction = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(this.last.velocity.angle + Math.PI, this.settings.correctionForce *\n Math.pow(this.last.velocity.length - this.settings.maxVelocity, 2));\n }\n // Отталкивание от мыши\n const toMouseVector = this.mouse.add(this.last.position.reverse());\n if (toMouseVector.length < this.settings.keepDistance &&\n toMouseVector.length > 0) {\n this.forces.running = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(toMouseVector.angle + Math.PI, this.settings.mouseForceMax -\n Math.pow(Math.abs(toMouseVector.length / this.settings.keepDistance - 1), this.settings.mouseForcePow));\n }\n }\n /**\n * Обработка движения\n */\n processMovement() {\n // Ускорение\n this.debugLines.push('Forces:');\n let acceleration = new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector();\n for (const [name, force] of Object.entries(this.forces)) {\n acceleration = acceleration.add(force);\n this.debugLines.push(` [${name}] ${force}`);\n }\n acceleration = acceleration.multiply(1 / this.settings.mass);\n this.state = {\n position: this.last.position,\n velocity: this.last.velocity,\n acceleration: acceleration,\n };\n this.state.velocity = this.velocity.add(this.acceleration.multiply(this.dt));\n this.state.position = this.position.add(this.velocity.multiply(this.dt));\n this.debugLines.push(`acceleration: ${this.acceleration}`);\n this.debugLines.push(`velocity: ${this.velocity}`);\n this.debugLines.push(`position: ${this.position}`);\n }\n /**\n * Обработка столкновения с границами окна\n * @param {DOMRect} img Изображение\n */\n processCollisions(img) {\n const limitX = (window.innerWidth - img.width) / 2;\n const limitY = (window.innerHeight - img.height) / 2;\n if (this.position.x < -limitX) {\n // Left\n this.position.x = -2 * limitX - this.position.x;\n this.velocity.x = -this.velocity.x * this.settings.collisionElasticity;\n }\n if (this.position.x > limitX) {\n // Right\n this.position.x = 2 * limitX - this.position.x;\n this.velocity.x = -this.velocity.x * this.settings.collisionElasticity;\n }\n if (this.position.y < -limitY) {\n // Top\n this.position.y = -2 * limitY - this.position.y;\n this.velocity.y = -this.velocity.y * this.settings.collisionElasticity;\n }\n if (this.position.y > limitY) {\n // Bottom\n this.position.y = 2 * limitY - this.position.y;\n this.velocity.y = -this.velocity.y * this.settings.collisionElasticity;\n }\n }\n /**\n * Нормально распределённая случайная величина\n * @param {number} mean\n * @param {number} stdev\n * @return {number}\n * @private\n */\n randomGaussian(mean = 0, stdev = 1) {\n const u = 1 - Math.random(); // Converting [0,1) to (0,1]\n const v = Math.random();\n const z = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);\n // Transform to the desired mean and standard deviation:\n return z * stdev + mean;\n }\n}\n/**\n * Класс настроек для шутки \"Свежая трава\"\n */\nclass FreshGrassJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 100;\n /**\n * Расстояние, на котором трава начнёт убегать\n */\n this.keepDistance = 200;\n /**\n * Максимальная скорость картинки (в пикселях в секунду)\n */\n this.maxVelocity = 500;\n /**\n * Минимальная скорость картинки (в пикселях в секунду)\n */\n this.minVelocity = 20;\n /**\n * Количество отметок времени за секунду\n */\n this.tickPerSecond = 50;\n this.gravity = 20;\n this.correctionForce = 0.8;\n this.mouseForceMax = 5000;\n this.mouseForcePow = 5;\n this.mass = 1;\n this.collisionElasticity = 0.9;\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/fresh_grass.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FreshGrassJoke: () => (/* binding */ FreshGrassJoke),\n/* harmony export */ FreshGrassJokeSettings: () => (/* binding */ FreshGrassJokeSettings)\n/* harmony export */ });\n/* harmony import */ var _types_html_d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types/html.d */ \"./src/types/html.d.ts\");\n/* harmony import */ var _types_html_d__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_types_html_d__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _joke__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../joke */ \"./src/joke.ts\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _html_joke_fresh_glass_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../html/joke-fresh_glass.html */ \"./src/html/joke-fresh_glass.html\");\n/* harmony import */ var _lib_vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/vector */ \"./src/lib/vector.ts\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common */ \"./src/common.ts\");\n\n\n\n\n\n\n/**\n * **Свежая трава**\n *\n * Предложение потрогать траву\n * @author Идея: Magia\n * @author Kozhilya\n */\nclass FreshGrassJoke extends _joke__WEBPACK_IMPORTED_MODULE_1__.Joke {\n constructor() {\n super(...arguments);\n this.id = 'fresh_grass';\n this.title = 'Свежая трава';\n this.description = 'Предложение потрогать траву';\n this._settings = new FreshGrassJokeSettings();\n }\n /**\n * Запуск шутки\n */\n start() {\n jquery__WEBPACK_IMPORTED_MODULE_2___default()(() => this.init());\n }\n /**\n * Основная загрузка шутки\n */\n init() {\n const $body = jquery__WEBPACK_IMPORTED_MODULE_2___default()(document.body);\n document.body.style.setProperty('--fresh-grass-body-top', `-${window.scrollY}px`);\n this.container = jquery__WEBPACK_IMPORTED_MODULE_2___default()(_html_joke_fresh_glass_html__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n this.container.hide(0);\n $body.append(this.container);\n this.container.fadeIn(500);\n this.fleeingGrass();\n }\n /**\n * Отладка\n * @param {string} str\n */\n debug(str) {\n if (!_common__WEBPACK_IMPORTED_MODULE_5__.debugEnabled)\n return;\n jquery__WEBPACK_IMPORTED_MODULE_2___default()('small', this.container).html(`
${str}
`);\n }\n /**\n * Анимация убегания травы от пользователя\n */\n fleeingGrass() {\n this.movement = new Movement(this.settings);\n const $img = jquery__WEBPACK_IMPORTED_MODULE_2___default()('img.april-fools__joke__fresh-grass__image', this.container);\n $img.on('mousedown', () => {\n this.close();\n });\n jquery__WEBPACK_IMPORTED_MODULE_2___default()(window).on('mousemove', (e) => {\n this.movement.mouse = new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector(e.clientX - window.innerWidth / 2, e.clientY - window.innerHeight / 2);\n });\n this.intervalIndex = setInterval(() => {\n const img = $img[0].getBoundingClientRect();\n this.movement.step(img);\n // this.debug(this.movement.debugLines.join('\\n'));\n $img.css('transform', this.movement.state.position.toTransform());\n }, Math.floor(1000 * this.movement.dt));\n }\n /**\n * Закрыть окно\n */\n close() {\n clearInterval(this.intervalIndex);\n this.container.fadeOut({\n duration: 500,\n // eslint-disable-next-line\n // @ts-ignore\n complete: () => {\n this.container.remove();\n scrollTo(0, -parseInt(document.body.style.getPropertyValue('--fresh-grass-body-top')));\n },\n });\n }\n}\n/**\n * Класс обработки движения\n */\nclass Movement {\n /**\n * Конструктор\n * @param {FreshGrassJokeSettings} settings\n */\n constructor(settings) {\n this.settings = settings;\n this.state = {\n position: new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector(),\n velocity: _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(Math.random() * 2 * Math.PI, Math.random() *\n (this.settings.maxVelocity - this.settings.minVelocity) +\n this.settings.minVelocity),\n acceleration: new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector(),\n };\n this.mouse = new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector();\n this.dt = 1.0 / this.settings.tickPerSecond;\n }\n /**\n * Координата движения\n */\n get position() {\n return this.state.position;\n }\n /**\n * Скорость движения\n */\n get velocity() {\n return this.state.velocity;\n }\n /**\n * Ускорение движения\n */\n get acceleration() {\n return this.state.acceleration;\n }\n /**\n * Произвести вычисление\n * @param {DOMRect} img Изображение\n */\n step(img) {\n this.last = this.state;\n this.debugLines = [];\n this.forces = {};\n // Обработка сил\n this.processForces();\n this.processMovement();\n this.processCollisions(img);\n }\n /**\n * Обработка сил\n */\n processForces() {\n // Притяжение к центру\n this.forces.gravity = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(this.last.position.angle + Math.PI, this.settings.gravity);\n // Коррекция скорости\n if (this.last.velocity.length < this.settings.minVelocity) {\n this.forces.correction = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(this.last.velocity.angle, this.settings.correctionForce *\n Math.pow(this.last.velocity.length - this.settings.minVelocity, 2));\n }\n else if (this.last.velocity.length > this.settings.maxVelocity) {\n this.forces.correction = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(this.last.velocity.angle + Math.PI, this.settings.correctionForce *\n Math.pow(this.last.velocity.length - this.settings.maxVelocity, 2));\n }\n // Отталкивание от мыши\n const toMouseVector = this.mouse.add(this.last.position.reverse());\n if (toMouseVector.length < this.settings.keepDistance &&\n toMouseVector.length > 0) {\n this.forces.running = _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector.fromLengthAngle(toMouseVector.angle + Math.PI, this.settings.mouseForceMax -\n Math.pow(Math.abs(toMouseVector.length / this.settings.keepDistance - 1), this.settings.mouseForcePow));\n }\n }\n /**\n * Обработка движения\n */\n processMovement() {\n // Ускорение\n this.debugLines.push('Forces:');\n let acceleration = new _lib_vector__WEBPACK_IMPORTED_MODULE_4__.Vector();\n for (const [name, force] of Object.entries(this.forces)) {\n acceleration = acceleration.add(force);\n this.debugLines.push(` [${name}] ${force}`);\n }\n acceleration = acceleration.multiply(1 / this.settings.mass);\n this.state = {\n position: this.last.position,\n velocity: this.last.velocity,\n acceleration: acceleration,\n };\n this.state.velocity = this.velocity.add(this.acceleration.multiply(this.dt));\n this.state.position = this.position.add(this.velocity.multiply(this.dt));\n this.debugLines.push(`acceleration: ${this.acceleration}`);\n this.debugLines.push(`velocity: ${this.velocity}`);\n this.debugLines.push(`position: ${this.position}`);\n }\n /**\n * Обработка столкновения с границами окна\n * @param {DOMRect} img Изображение\n */\n processCollisions(img) {\n const limitX = (window.innerWidth - img.width) / 2;\n const limitY = (window.innerHeight - img.height) / 2;\n if (this.position.x < -limitX) {\n // Left\n this.position.x = -2 * limitX - this.position.x;\n this.velocity.x = -this.velocity.x * this.settings.collisionElasticity;\n }\n if (this.position.x > limitX) {\n // Right\n this.position.x = 2 * limitX - this.position.x;\n this.velocity.x = -this.velocity.x * this.settings.collisionElasticity;\n }\n if (this.position.y < -limitY) {\n // Top\n this.position.y = -2 * limitY - this.position.y;\n this.velocity.y = -this.velocity.y * this.settings.collisionElasticity;\n }\n if (this.position.y > limitY) {\n // Bottom\n this.position.y = 2 * limitY - this.position.y;\n this.velocity.y = -this.velocity.y * this.settings.collisionElasticity;\n }\n }\n /**\n * Нормально распределённая случайная величина\n * @param {number} mean\n * @param {number} stdev\n * @return {number}\n * @private\n */\n randomGaussian(mean = 0, stdev = 1) {\n const u = 1 - Math.random(); // Converting [0,1) to (0,1]\n const v = Math.random();\n const z = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);\n // Transform to the desired mean and standard deviation:\n return z * stdev + mean;\n }\n}\n/**\n * Класс настроек для шутки \"Свежая трава\"\n */\nclass FreshGrassJokeSettings {\n constructor() {\n this.enabled = true;\n this.chance = 100;\n /**\n * Расстояние, на котором трава начнёт убегать\n */\n this.keepDistance = 200;\n /**\n * Максимальная скорость картинки (в пикселях в секунду)\n */\n this.maxVelocity = 500;\n /**\n * Минимальная скорость картинки (в пикселях в секунду)\n */\n this.minVelocity = 20;\n /**\n * Количество отметок времени за секунду\n */\n this.tickPerSecond = 50;\n /**\n * Сила притяжения в центр\n */\n this.gravity = 20;\n /**\n * Сила исправления скорости\n */\n this.correctionForce = 0.8;\n /**\n * Максимальная сила отталкивания от курсора\n */\n this.mouseForceMax = 5000;\n /**\n * Степень увеличения силы отталкивания от курсора\n */\n this.mouseForcePow = 5;\n /**\n * Общая масса картинки\n */\n this.mass = 1;\n /**\n * Доля скорости, сохраняемой при столкновении со стеной\n */\n this.collisionElasticity = 0.9;\n }\n}\n\n\n//# sourceURL=webpack://mybb-april-fools/./src/jokes/fresh_grass.ts?"); /***/ }), diff --git a/dist/april-fools.min.js b/dist/april-fools.min.js index 9ae9a2b..09bcc27 100644 --- a/dist/april-fools.min.js +++ b/dist/april-fools.min.js @@ -1,7 +1,7 @@ /*! - * mybb-april-fools 1.1.1 (21.03.2024) + * mybb-april-fools 1.1.2 (01.04.2024) * https://forumd.ru/viewtopic.php?id=7372 * Система первоапрельских розыгрышей для форумов MyBB * @author kozhilya * @license https://forumd.ru/viewtopic.php?id=5751#rule - */(()=>{"use strict";var __webpack_modules__={915:(e,t,i)=>{i.d(t,{A:()=>n});const n=' '},841:(e,t,i)=>{i.d(t,{A:()=>n});const n=' '},863:(e,t,i)=>{i.d(t,{A:()=>n});const n='
'},248:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>JokerUI});var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(669),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),_html_button_html__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(915),_html_styles_html__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(841),_html_window_html__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(863);class JokerUI{constructor(e){this.joker=e,jquery__WEBPACK_IMPORTED_MODULE_0___default()('link[rel="stylesheet"]').eq(0).before(_html_styles_html__WEBPACK_IMPORTED_MODULE_1__.A);e=this.button;e.hide(),e.mybbModal({title:"Настройки первоапрельских шуток",content:()=>this.render(),closer:!0,noscroll:!0,escClose:!0})}get button(){let e=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__button");return e=0===e.length?jquery__WEBPACK_IMPORTED_MODULE_0___default()(_html_button_html__WEBPACK_IMPORTED_MODULE_2__.A).appendTo("body"):e}show(){this.button.show()}render(){const result=jquery__WEBPACK_IMPORTED_MODULE_0___default()("
").html(_html_window_html__WEBPACK_IMPORTED_MODULE_3__.A),rowTemplate=jquery__WEBPACK_IMPORTED_MODULE_0___default()("#april-fools__window-row",result).html(),jokeContainer=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__jokes",result);for(const joke of Object.values(this.joker.jokes)){const row=jquery__WEBPACK_IMPORTED_MODULE_0___default()(eval("`"+rowTemplate+"`"));jquery__WEBPACK_IMPORTED_MODULE_0___default()('input[type="checkbox"]',row).prop("checked",joke.settings.enabled).on("click",e=>{e=e.currentTarget;this.joker.toggleJoke(joke.id,e.checked)}),jokeContainer.append(row)}return jquery__WEBPACK_IMPORTED_MODULE_0___default()("button",result).on("click",async()=>{await this.joker.clearUserStates(),window.location.reload()}),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__content",result)}}},669:e=>{e.exports=jQuery}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];return void 0!==t||(t=__webpack_module_cache__[e]={exports:{}},__webpack_modules__[e](t,t.exports,__webpack_require__)),t.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{class s{constructor(){this.enabled=!0,this.chance=20}}class o{get settings(){return this._settings}set settings(e){for(const n of Object.entries(e)){var t=n[0],i=n[1];switch(t){case"name":case"title":this.title=i;break;case"description":this.description=i;break;default:this._settings[t]=i}}}check(e){return Math.random()<.01*e}enable(){this.settings.enabled=!0}disable(){this.settings.enabled=!1}toggle(e=null){this.settings.enabled=null===e?!this.settings.enabled:e}}class i extends o{}var r,e=__webpack_require__(248),t=__webpack_require__(669),a=__webpack_require__.n(t);function n(e){return a()(e).find("*").contents().filter((e,t)=>t.nodeType===Node.TEXT_NODE)}let l=(t=document.currentScript)instanceof HTMLScriptElement&&!/\.min\.js$/.test(t.src);function c(...e){l&&console.log(...e)}class h{constructor(){this.ui=new e.m(this),this.core_settings=new d,this.jokes={}}get settings(){var e={};e.core=this.core_settings;for(const n of Object.entries(this.jokes)){var t=n[0],i=n[1];e[t]=i.settings}return e}set settings(e){for(const n of Object.entries(e)){var t=n[0],i=n[1],t="core"===t?this.core_settings:this.jokes[t].settings;Object.assign(t,i)}}check(e){return Math.random()<.01*e}add(e){this.jokes[e.id]=e}addCustom(e,t,i=null){var n=new class extends o{constructor(){super(...arguments),this.id=e,this.title="Пользовательская шутка",this.description="Для шутки не определено описание",this._settings=new s}start(){t.call(this,this.settings)}};return n.settings=i,this.add(n),n}enable(){this.core_settings.enabled=!0}disable(){this.core_settings.enabled=!1}enableAll(){for(const e of Object.keys(this.jokes))this.jokes[e].enable()}disableAll(){for(const e of Object.keys(this.jokes))this.jokes[e].disable()}toggleJoke(e,t){e=this.jokes[e];e.settings.enabled=t,e instanceof i&&!t&&e.stop(),this.saveUserStates()}saveUserStates(){var e={};for(const t of Object.keys(this.jokes))e[t]=this.jokes[t].settings.enabled;fetch("/api.php?"+$.param({method:"storage.set",user_id:window.UserID,key:"april-fools",token:window.ForumAPITicket,value:JSON.stringify(e),timer:1440})).then(e=>{})}async loadUserStates(){var e=await(await fetch("/api.php?"+$.param({method:"storage.get",user_id:window.UserID,key:"april-fools"}))).json();if(!e.error){var t=JSON.parse(e.response.storage.data["april-fools"]);for(const i of Object.keys(this.jokes))this.jokes[i].settings.enabled=t[i]}}async clearUserStates(){await fetch("/api.php?"+$.param({method:"storage.delete",user_id:window.UserID,key:"april-fools",token:window.ForumAPITicket}))}start(e,t=!1){e in this.jokes&&(e=this.jokes[e],t||e.settings.enabled&&this.check(e.settings.chance)?(c(e.title,"- шутка включена"),e.start()):c(e.title,"- шутка не включена"))}startAll(e=!1){for(const t of Object.keys(this.jokes))this.start(t,e)}regularCheck(){var e,t;return!!this.core_settings.enabled&&(0<=this.core_settings.testers.indexOf(window.UserID)||(e=(t=new Date).getMonth()+1,t=t.getDate(),4===e&&1===t&&this.check(this.core_settings.chance)))}async regularStart(){this.regularCheck()&&(await this.loadUserStates(),this.ui.show(),this.startAll())}}class d{constructor(){this.chance=100,this.enabled=!0,this.testers=[]}}i;class u{constructor(){this.enabled=!1,this.chance=1,this.directions=["top","left","bottom","left"],this.force=.5,this.selector="[id^=pun]",this.interval=100}}o;class p{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content"}}o;class g{constructor(){this.enabled=!1,this.chance=30}}o;class f{constructor(){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}}}o;class A{constructor(){this.enabled=!0,this.chance=20,this.selector=".pa-author a"}}o;class m{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content",this.shuffle_chance=50}}function w(e){let s,o,n,r,a=e&&e.emoji||"🤪",l=e&&e.element,c=l||document.body,h=window.innerWidth,d=window.innerHeight,u={x:h/2,y:h/2},p=[];const g=window.matchMedia("(prefers-reduced-motion: reduce)");function t(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");s=document.createElement("canvas"),o=s.getContext("2d"),s.style.top="0px",s.style.left="0px",s.style.pointerEvents="none",l?(s.style.position="absolute",c.appendChild(s),s.width=c.clientWidth,s.height=c.clientHeight):(s.style.position="fixed",document.body.appendChild(s),s.width=h,s.height=d),o.font="16px serif",o.textBaseline="middle",o.textAlign="center";var e=o.measureText(a),t=document.createElement("canvas"),i=t.getContext("2d");t.width=e.width,t.height=2*e.actualBoundingBoxAscent,i.textAlign="center",i.font="16px serif",i.textBaseline="middle",i.fillText(a,t.width/2,e.actualBoundingBoxAscent),r=t;let n=0;for(n=0;n<7;n++)p[n]=new y(r);c.addEventListener("mousemove",m),c.addEventListener("touchmove",A,{passive:!0}),c.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",f),w()}function f(e){h=window.innerWidth,d=window.innerHeight,l?(s.width=c.clientWidth,s.height=c.clientHeight):(s.width=h,s.height=d)}function A(e){var t;0=i-11-1&&(0=t-11&&(0{(g.matches?i:t)()},t(),{destroy:i}}function _(e){let t,o,i,s=e&&e.element,r=s||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[];const d=e?.particles||15,u=e?.rate||.4,n=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 p=!1,g=new Image;g.src=n;const f=window.matchMedia("(prefers-reduced-motion: reduce)");function A(){if(f.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),o=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",s?(t.style.position="absolute",r.appendChild(t),t.width=r.clientWidth,t.height=r.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=a,t.height=l),r.addEventListener("mousemove",w),window.addEventListener("resize",m),_()}function m(e){a=window.innerWidth,l=window.innerHeight,s?(t.width=r.clientWidth,t.height=r.clientHeight):(t.width=a,t.height=l)}function w(e){if(s){const t=r.getBoundingClientRect();c.x=e.clientX-t.left,c.y=e.clientY-t.top}else c.x=e.clientX,c.y=e.clientY;if(!1===p){p=!0;for(let e=0;e{(f.matches?v:A)()},A(),{destroy:v}}function v(e){let t,r,i,n=e&&e.element,s=n||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[];const o=e?.length||20,d=e?.colors||["#FE0000","#FD8C00","#FFE500","#119F0B","#0644B3","#C22EDC"],u=e?.size||3;let p=!1;const g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),r=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",n?(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=a,t.height=l),s.addEventListener("mousemove",m),window.addEventListener("resize",A),w()}function A(e){a=window.innerWidth,l=window.innerHeight,n?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=a,t.height=l)}function m(e){if(n){const t=s.getBoundingClientRect();c.x=e.clientX-t.left,c.y=e.clientY-t.top}else c.x=e.clientX,c.y=e.clientY;if(!1===p){p=!0;for(let e=0;e{r.beginPath(),r.strokeStyle=e,n.length&&r.moveTo(n[0].x,n[0].y+i*(u-1)),n.forEach((e,t)=>{0!==t&&r.lineTo(e.x,e.y+i*u)}),r.lineWidth=u,r.lineCap="round",r.stroke()})}i=requestAnimationFrame(w)}function _(){t.remove(),cancelAnimationFrame(i),s.removeEventListener("mousemove",m),window.addEventListener("resize",A)}function v(e,t){this.position={x:e,y:t}}return g.onchange=()=>{(g.matches?_:f)()},f(),{destroy:_}}function y(e){let t,o,r,i=e&&e.element,n=i||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2};const I=e&&e.dateColor||"blue",W=e&&e.faceColor||"black",Y=e&&e.secondsColor||"red",H=e&&e.minutesColor||"black",P=e&&e.hoursColor||"black",h=.4,F=e&&e.theDays||["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"],U=e&&e.theMonths||["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"];var e=new Date,X=e.getDate(),z=e.getYear()+1900;const s=(" "+F[e.getDay()]+" "+X+" "+U[e.getMonth()]+" "+z).split(""),d=["3","4","5","6","7","8","9","10","11","12","1","2"],u=d.length,p=["•","•","•"],g=["•","•","•","•"],f=["•","•","•","•","•"],A=360/u,m=360/s.length,w=45/6.5,_=[],v=[],y=[],x=[],E=[],b=[],M=[],k=[],C=[];var j=parseInt(s.length+u+p.length+g.length+f.length)+1;const L=window.matchMedia("(prefers-reduced-motion: reduce)");function B(){if(L.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),o=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",i?(t.style.position="absolute",n.appendChild(t),t.width=n.clientWidth,t.height=n.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=a,t.height=l),o.font="10px sans-serif",o.textAlign="center",o.textBaseline="middle";for(let e=0;e=l-80&&(_[e-1]=l-80),v[e-1]>=a-80&&(v[e-1]=a-80);o.clearRect(0,0,a,l);var e=new Date,t=e.getSeconds(),i=Math.PI*(t-15)/30,t=e.getMinutes(),n=Math.PI*(t-15)/30,t=e.getHours(),s=Math.PI*(t-3)/6+Math.PI*parseInt(e.getMinutes())/360;for(let e=0;e{(L.matches?O:B)()},B(),{destroy:O}}function x(e){let t,s,o,i=e||{},n=e&&e.element,r=n||document.body,a=i.text?" "+e.text:" Your Text Here",l=e?.color||"#000000",c=i.font||"monospace",h=i.textSize||12,d=h+"px "+c,u=i.gap||h+2,p=0,g=[],f=window.innerWidth,A=window.innerHeight,m={x:f/2,y:f/2};for(let e=0;e{(w.matches?E:_)()},_(),{destroy:E}}i;(t=r=r||{}).Rainbow="rainbow",t.FairyDust="fairy_dust",t.SpringyEmoji="springy_emoji",t.Emoji="emoji",t.Ghost="ghost",t.Trailing="trailing",t.TextFlag="text_flag",t.FollowingDot="following_dot",t.Bubbles="bubbles",t.Snowflake="snowflake",t.Clock="clock";class E{constructor(){this.enabled=!0,this.chance=100,this.effects={[r.Rainbow]:new class extends b{constructor(){super(...arguments),this.length=20,this.size=3,this.colors=["#9400D3","#4B0082","#0000FF","#00FF00","#FFFF00","#FF7F00","#FF0000"]}},[r.SpringyEmoji]:new class extends b{constructor(){super(...arguments),this.emoji="🤪"}},[r.Emoji]:new class extends b{constructor(){super(...arguments),this.emoji=["🔥","🐬","🦆"]}},[r.FairyDust]:new class extends b{constructor(){super(...arguments),this.colors=["#ff0000","#00ff00","#0000ff"]}},[r.Ghost]:new b,[r.Trailing]:new class extends b{constructor(){super(...arguments),this.particles=15,this.rate=.4,this.baseImageSrc=null}},[r.TextFlag]:new class extends b{constructor(){super(...arguments),this.text="С днём смеха!",this.color="#000000",this.font="monospace",this.textSize=12,this.gap=14,this.size=3}},[r.FollowingDot]:new class extends b{constructor(){super(...arguments),this.color="#323232a6"}},[r.Bubbles]:new b,[r.Snowflake]:new class extends b{constructor(){super(...arguments),this.weight=0}},[r.Clock]:new class extends b{constructor(){super(...arguments),this.dateColor="blue",this.faceColor="black",this.secondsColor="red",this.minutesColor="black",this.hoursColor="black"}}}}}class b extends class{}{constructor(){super(...arguments),this.enabled=!0,this.weight=50}}o;class M{constructor(){this.enabled=!0,this.chance=100,this.gender_resolver=null,this.rude=!1,this.change_frequency=5,this.schemas={"{adj} {noun}{p}":10,"{noun} {adj}{p}":3,"{adj}, {adj} {noun}{p}":10,"{adj} и очень {adj} {noun}{p}":10,"{adj} {noun} {verb}{p}":10,"{adj} {noun} {adv} {verb}{p}":5,"{adj} {noun} {verb} {place}{p}":5,"{adj} {noun} {adv} {verb} {place}{p}":5},this.variants={adj:{},noun:{},verb:{},place:{},adv:{},p:{"":new k({weight:15}),".":new k({weight:10}),"...":new k({weight:5}),"!":new k({weight:5}),"!!!":new k({weight:2}),"?":new k({weight:2}),"?!":new k({weight:1})}}}}class k{constructor(e){this.weight=10,this.enabled=!0,this.rude=!1,(this.gender=null)==this.weight&&(this.weight=e.weight),null==this.enabled&&(this.enabled=e.enabled),null==this.rude&&(this.rude=e.rude),null==this.gender&&(this.gender=e.gender)}}function C(i,e){const n={};return e.split(",").map(e=>e.trim()).forEach(e=>{var t=e.replace(/[^А-ЯЁа-яёA-Za-z\- ]/g,"");""!==t&&(n[t]=new k({gender:i,rude:0<=e.indexOf("$"),enabled:e.indexOf("!")<0,weight:10*(0<=e.indexOf("$")?.5:1)*(0<=e.indexOf("%")?.5:1)*(0<=e.indexOf("^")?2:1)}))}),n}window.BuildStupidTitleVariant=C;o;class j{constructor(){this.enabled=!0,this.chance=10}}o;class L{constructor(){this.enabled=!0,this.chance=10,this.selector=".post-content",this.ruToEn={"а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"e","ж":"j","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"shch","ъ":"ie","ы":"y","ь":"","э":"e","ю":"u","я":"ya"},this.enToRu={a:"а",b:"б",c:"с",d:"д",e:"е",f:"ф",gh:"ж",g:"г",h:"х",i:"и",j:"й",k:"к",l:"л",m:"м",n:"н",o:"о",p:"п",q:"кью",r:"р",s:"с",t:"т",u:"ю",v:"в",w:"в",x:"кс",y:"ы",z:"з"}}}window.AprilJokes=(e=>{const t=new h;return e.forEach(e=>{t.add(new e)}),$(()=>t.regularStart()),t})([class extends i{constructor(){super(...arguments),this.id="shake",this.title="Форумо-трясение",this.description="Страница форума начинает трястись",this._settings=new u,this.dataName="april-fools-shake"}rand(e){return e+this.settings.force*(2*Math.random()-1)}start(){this.items=a()(this.settings.selector),this.items.each((e,t)=>{const i={};this.settings.directions.forEach(e=>{i[e]=parseInt(a()(t).css("margin-"+e))}),a()(t).data(this.dataName,i)}),this.intervalId=setInterval(()=>{this.items.each((e,t)=>{var i=a()(t).data(this.dataName);for(const n of Object.entries(i))a()(t).css("margin-"+n[0],this.rand(n[1]))})},this.settings.interval)}stop(){clearInterval(this.intervalId),this.items.each((e,t)=>{const i={};this.settings.directions.forEach(e=>{a()(t).css("margin-"+e,i[e])}),a()(t).data(this.dataName,i)})}},class extends o{constructor(){super(...arguments),this.id="humanitarian_hell",this.title="Ад гуманитария",this.description='Все "тся" заменяются на "ться", а все "ться" на "тся"',this._settings=new p}processText(e){return e.replace(/(ть?ся)/g,function(e){return 0{t.textContent=this.processText(t.textContent)})}},class extends o{constructor(){super(...arguments),this.id="mirror",this.title="Зеркало",this.description="Элементы форума отражаются (по крайней мере, пытаются)",this._settings=new g}start(){a()(".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"'),a()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),a()(".post h3 span").css("margin-right","25em")}},class extends o{constructor(){super(...arguments),this.id="carnival",this.title="Карнавал",this.description="Аватарки приобретают интересные цвета",this._settings=new f}start(){a()(this.settings.selector).each((e,t)=>{var i=[];for(const n of Object.entries(this.settings.variants))this.check(this.settings.variant_chance)&&i.push(n[0].replace("{0}",Math.round(Math.random()*n[1]).toString()));0{var i=a()(t).text();let n="";for(let e=0;ethis.shuffleLetters(t))}start(){n(this.settings.selector).each((e,t)=>this.processNode(t))}},class extends i{constructor(){super(...arguments),this.id="cursor_effects",this.title="Красивый курсор",this.description="Эффекты, следующие за курсором",this._settings=new E}enableAll(){for(const e of Object.keys(this.settings.effects))this.settings.effects[e].enabled=!0}disableAll(){for(const e of Object.keys(this.settings.effects))this.settings.effects[e].enabled=!1}weight(e){e=this.settings.effects[e];return e.enabled?e.weight:0}getRandomEffect(){var e=Object.values(r).map(e=>e),t=e.reduce((e,t)=>e+this.weight(t),0),i=Math.random()*t;let n=0;for(const s of e)if(i<=(n+=this.weight(s)))return s;throw new Error("Тебя быть тут не должно...")}start(){var e=this.getRandomEffect(),t=this.settings.effects[e];this.active_cursor_effect=function(e,t){switch(e){case r.Rainbow:return v(t);case r.FairyDust:return function(e){let t=e&&e.colors||["#D61C59","#E7D84B","#1B8798"],i=e&&e.element,n=i||document.body,s=window.innerWidth,o=window.innerHeight;const r={x:s/2,y:s/2},a={x:s/2,y:s/2},l=[],c=[];let h,d,u;const p=window.matchMedia("(prefers-reduced-motion: reduce)");function g(){if(p.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");h=document.createElement("canvas"),d=h.getContext("2d"),h.style.top="0px",h.style.left="0px",h.style.pointerEvents="none",i?(h.style.position="absolute",n.appendChild(h),h.width=n.clientWidth,h.height=n.clientHeight):(h.style.position="fixed",n.appendChild(h),h.width=s,h.height=o),d.font="21px serif",d.textBaseline="middle",d.textAlign="center",t.forEach(e=>{var t=d.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),c.push(i)}),n.addEventListener("mousemove",m),n.addEventListener("touchmove",A,{passive:!0}),n.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",f),_()}function f(e){s=window.innerWidth,o=window.innerHeight,i?(h.width=n.clientWidth,h.height=n.clientHeight):(h.width=s,h.height=o)}function A(t){if(0{if(i){const t=n.getBoundingClientRect();r.x=e.clientX-t.left,r.y=e.clientY-t.top}else r.x=e.clientX,r.y=e.clientY;1.5{(p.matches?v:g)()},g(),{destroy:v}}(t);case r.SpringyEmoji:return w(t);case r.Emoji:return function(e){const t=e&&e.emoji||["😀","😂","😆","😊"];let i=e&&e.element,n=i||document.body,s=window.innerWidth,o=window.innerHeight;const r={x:s/2,y:s/2},a={x:s/2,y:s/2};let l=0;const c=[],h=[];let d,u,p;const g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");d=document.createElement("canvas"),u=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",document.body.appendChild(d),d.width=s,d.height=o),u.font="21px serif",u.textBaseline="middle",u.textAlign="center",t.forEach(e=>{var t=u.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),h.push(i)}),n.addEventListener("mousemove",w,{passive:!0}),n.addEventListener("touchmove",m,{passive:!0}),n.addEventListener("touchstart",m,{passive:!0}),window.addEventListener("resize",A),v()}function A(e){s=window.innerWidth,o=window.innerHeight,i?(d.width=n.clientWidth,d.height=n.clientHeight):(d.width=s,d.height=o)}function m(t){if(0{if(i){const t=n.getBoundingClientRect();r.x=e.clientX-t.left,r.y=e.clientY-t.top}else r.x=e.clientX,r.y=e.clientY;1{(g.matches?y:f)()},f(),{destroy:y}}(t);case r.Ghost:return function(e){let t,i,n,s=e&&e.element,o=s||document.body,r=e&&e.randomDelay,a=e&&e.minDelay||5,l=e&&e.maxDelay||50,c=window.innerWidth,h=window.innerHeight,d={x:c/2,y:c/2},u=[],p=new Image;e&&e.image?p.src=e.image:p.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 g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),i=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",s?(t.style.position="absolute",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=c,t.height=h),o.addEventListener("mousemove",y),o.addEventListener("touchmove",m,{passive:!0}),o.addEventListener("touchstart",m,{passive:!0}),window.addEventListener("resize",A),E()}function A(e){c=window.innerWidth,h=window.innerHeight,s?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=c,t.height=h)}function m(t){if(0{(g.matches?b:f)()};let w=()=>Math.floor(Math.random()*(l-a+1))+a,_=Date.now(),v=w();function y(e){if(r){if(_+v>Date.now())return;_=Date.now(),v=w()}var t;s?(t=o.getBoundingClientRect(),d.x=e.clientX-t.left,d.y=e.clientY-t.top):(d.x=e.clientX,d.y=e.clientY),x(d.x,d.y,p)}function x(e,t,i){u.push(new M(e,t,i))}function E(){if(0!=u.length){i.clearRect(0,0,c,h);for(let e=0;e{(h.matches?f:d)()},d(),{destroy:f}}(t);case r.Bubbles:return function(e){let t,i,n,s=e&&e.element,o=s||document.body,r=window.innerWidth,a=window.innerHeight,l={x:r/2,y:r/2},c=[],h=[];const d=window.matchMedia("(prefers-reduced-motion: reduce)");function u(){if(d.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),i=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",s?(t.style.position="absolute",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=r,t.height=a),o.addEventListener("mousemove",f),o.addEventListener("touchmove",g,{passive:!0}),o.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",p),m()}function p(e){r=window.innerWidth,a=window.innerHeight,s?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=r,t.height=a)}function g(t){if(0{(d.matches?w:u)()},u(),{destroy:w}}(t);case r.Snowflake:return function(e){let t,s,i,n=e&&e.element,o=n||document.body,r=["❄️"],a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[],d=[];const u=window.matchMedia("(prefers-reduced-motion: reduce)");function p(){if(u.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),s=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=a,t.height=l),s.font="12px serif",s.textBaseline="middle",s.textAlign="center",r.forEach(e=>{var t=s.measureText(e),i=document.createElement("canvas"),n=i.getContext("2d");i.width=t.width,i.height=2*t.actualBoundingBoxAscent,n.textAlign="center",n.font="12px serif",n.textBaseline="middle",n.fillText(e,i.width/2,t.actualBoundingBoxAscent),d.push(i)}),o.addEventListener("mousemove",A),o.addEventListener("touchmove",f,{passive:!0}),o.addEventListener("touchstart",f,{passive:!0}),window.addEventListener("resize",g),w()}function g(e){a=window.innerWidth,l=window.innerHeight,n?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=a,t.height=l)}function f(t){if(0{(u.matches?_:p)()},p(),{destroy:_}}(t);case r.Clock:return y(t)}}(e,t)}stop(){this.active_cursor_effect.destroy()}},class extends o{constructor(){super(...arguments),this.id="stupid_title",this.title="Глупые статусы",this.description="Каждому пользователю даётся новый глупый статус",this._settings=new M,this.loadedGenders=null,this.variantsGenerated=!1,this.seed=0}async loadGenders(){var e=a()(".pa-author a").map((e,t)=>t.innerText).toArray().reduce((e,t)=>(e.indexOf(t)<0&&e.push(t),e),[]),e="/api.php?"+a().param({method:"users.get",fields:"username,sex",username:e}),e=await(await fetch(e)).json();this.loadedGenders={},e.error||null!=(e=e.response)&&e.users.forEach(e=>{"0"!==e.sex&&(this.loadedGenders[e.username]="1"===e.sex)})}resolveGender(e){return null!==this.settings.gender_resolver?!!this.settings.gender_resolver.call(this,e):e in this.loadedGenders?!!this.loadedGenders[e]:(this.resetSeed(),"m"===this.selectRandom(e,{m:1,f:1}))}async start(){var e;this.variantsGenerated||((e=this.settings.variants).adj=Object.assign(Object.assign(Object.assign({},C(!0,"адекватный,$адский,активный,алчный,%ангельский,банальный,безнадёжный,$бесполезный,былой,верный,виртуальный,вкусный,воспитанный,выгодный,выходной,гигантский,$глупый,гордый,грамотный,громадный,грубый,далекий,двуличный,деятельный,доброжелательный,$жалкий,жёсткий,жестокий,$жирный,заинтересованный,запасной,застенчивый,знакомый,иностранный,истинный,конструктивный,креативный,ласковый,любимый,мелочный,^мирный,мстительный,небесный,невозможный,независимый,низкий,нужный,объективный,обыкновенный,опрятный,^оригинальный,особенный,острый,откровенный,открытый,пестрый,повседневный,подземный,пожилой,показательный,последний,посторонний,провинциальный,пышный,робкий,родной,самовлюблённый,северный,седой,семейный,серьёзный,сногсшибательный,^солнечный,спокойный,суровый,терпеливый,уверенный в себе,ударный,^удачливый,формальный,хладнокровный,целый,чистый,чрезвычайный,чужой,южный")),C(!1,"адекватная,$адская,активная,алчная,%ангельская,банальная,безнадёжная,$бесполезная,былая,верная,виртуальная,вкусная,воспитанная,выгодная,выходная,гигантская,$глупая,гордая,грамотная,громадная,грубая,далекая,двуличная,деятельная,доброжелательная,$жалкая,жёсткая,жестокая,$жирная,заинтересованная,запасная,застенчивая,знакомая,иностранная,истинная,конструктивная,креативная,ласковая,любимая,мелочная,^мирная,мстительная,небесная,невозможная,независимая,низкая,нужная,объективная,обыкновенная,опрятная,^оригинальная,особенная,острая,откровенная,открытая,пестрая,повседневная,подземная,пожилая,показательная,последняя,посторонняя,провинциальная,пышная,робкая,родная,самовлюблённая,северная,седая,семейная,серьезная,сногсшибательная,^солнечная,спокаяная,суровая,терпеливая,уверенная в себе,ударная,^удачливая,формальная,хладнокровная,целая,чистая,чрезвычайная,чужая,южная")),e.adj),e.noun=Object.assign(Object.assign(Object.assign({},C(!0,"актёр,$балбес,бард,басурманин,борец,бродяга,бруталище,волк,дворф,%дед,%дедушка,джентльмен,диван,динозавр,дракон,ёж,%ёжик,жук,зайц,$злоумышленник,зомби,карасик,кентавр,кит,кот,кролик,кулак,лев,ледник,лесоруб,%мальчег,мальчик,манекен,массажист,мачо,монах,монстр,наследник,ниндзя,носорог,одиночка,организм,орёл,отец,принц,проказник,пузырь,$раб,рыцарь,спортсмен,сурикат,сын,%сынок,тигр,товарищ,хоббит,эльф")),C(!1,"актриса,акула,$бабка,бабочка,%бабушка,бактерия,белочка,бусинка,валькирия,$ведьма,волторна,волчица,горгулья,дворфиха,девочка,деревяшка,детка,%деффачка,%дочка,дочь,заноза,$злоумышленница,знаменитость,каруселька,килька,конфетка,косточка,кошка,красотка,крышка,леди,$личинка,львица,мать,машина,милашка,монашка,мышь,наследница,орлица,панда,пиранья,принцесса,простуда,$рабыня,русалочка,рыбка,рыбка,скамеечка,спортсменка,тигрица,травка,черепашка,чертовка,эльфийка")),e.noun),e.verb=Object.assign(Object.assign(Object.assign(Object.assign({},C(null,"бежит,берёт и делает,болеет,встаёт,говорит,думает,забывает,замирает,заходит,идёт,%имеет план и придерживается его,ловит,меняется,молчит,нарушает,оглядывается,орёт,освобождает,отвечает,отказаться куда-то идти,отказывается,отказывается вставать,отказывается что-то делать,оформляет,плывёт,поглядывает,поздравляет,поздравляет,получает,прибывает,приказывает,просыпается,прощает,работает,радуется,скрывается,снимает,снимает,снимается в сериале,снимается в фильме,собирается,соединяет,спрашивает,тянет,указывает,учит,читает,что-то скрывает,чувствует опасность,шепчет")),C(!0,"взял и сделал,додумался,женился,женится,заработался,не спал,не успел,обиделся,познал дзен,присел,проснулся,скрылся,смог,успел")),C(!1,"взяла и сделала,выходит замуж,вышла замуж,додумалась,заработалась,не спала,не успела,обиделась,познала дзен,присела,проснулась,скрылась,смогла,успела")),e.verb),e.place=Object.assign(Object.assign({},C(null,"в джунглях,в квартире,в космосе,в лесу,в очереди,в пустыне,в театре,%в тёплой и уютной квартире,в филармонии,где-то,на заснеженной вершине,на конференции,на пляже,на форуме,под водой,под дождём,%под проливным дождём")),e.place),e.adv=Object.assign(Object.assign({},C(null,"безрассудно,быстро,внезапно,вновь,$грубо,грустно,медленно,%молниеносно,немедленно,опять,осмысленно,позже,предсказуемо,расчётливо,регулярно,счастливо,уже,уныло")),e.adv),this.variantsGenerated=!0),await this.loadGenders();const n={};a()(".post-author").each((e,t)=>{var i=a()(".pa-author a",t).text();i&&(i in n||(this.resetSeed(),n[i]=this.generatePhrase(i)),a()(".pa-title",t).text(n[i]))})}generatePhrase(i){const n=this.resolveGender(i);var e=this.selectRandom(i,this.settings.schemas);return this.capitalizeFirst(e.replace(/\{(.+?)}/g,(e,t)=>{t=this.buildVariants(t,n);return this.selectRandom(i,t)}))}prng(i,e,t){let n=3735928559^e,s=1103547991^e;for(let e=0,t;e>>16,2246822507)^Math.imul(s^s>>>13,3266489909);e=4294967296*(2097151&(s=Math.imul(s^s>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0);return Math.floor(Math.pow(Math.sin(e),2)*t)%t}resetSeed(){var e=new Date,t=60*e.getUTCHours()+e.getUTCMinutes();0===this.settings.change_frequency?this.seed=60*t+e.getUTCSeconds():this.seed=Math.floor(t/this.settings.change_frequency)}selectRandom(e,i){var t=Object.keys(i),n=t.reduce((e,t)=>e+i[t],0),s=this.prng(e,this.seed++,n);let o=0;for(const r of t)if(s<=(o+=i[r]))return r;throw new Error("Тебя быть тут не должно...")}buildVariants(e,t){var i={},e=this.settings.variants[e];for(const o of Object.entries(e)){var n=o[0],s=o[1];!s.enabled||s.gender===!t||!this.settings.rude&&s.rude||(i[n]=s.weight)}return i}capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}},class extends o{constructor(){super(...arguments),this.id="inverted_scroll",this.title="Обратная гравитация",this.description="Скролл в обратную сторону",this._settings=new j}start(){document.addEventListener("wheel",e=>{e.preventDefault(),scrollBy(0,-e.deltaY)},{passive:!1})}},class extends o{constructor(){super(...arguments),this.id="latinization",this.title="Латинизация",this.description="Все символы на странице или только в постах или еще где-то местами - латиницей вместо кириллицы и наоборот",this._settings=new L}start(){n(this.settings.selector).each((e,t)=>this.processNode(t))}latinize(e){if(/[а-яА-ЯёЁ0-9_-]+/.test(e))for(var[t,i]of Object.entries(this.settings.ruToEn))e=e.replace(new RegExp(t,"g"),i).replace(new RegExp(t.toUpperCase(),"gi"),i.toUpperCase());else if(/[a-zA-Z0-9_-]+/.test(e))for(var[n,s]of Object.entries(this.settings.enToRu))e=e.replace(new RegExp(n,"g"),s).replace(new RegExp(n.toUpperCase(),"gi"),s.toUpperCase());return e}processNode(e){e.textContent=null==(e=e.textContent)?void 0:e.replace(/([А-Яа-яA-Za-z]+)/gm,(e,t)=>this.latinize(t))}}])})()})(); \ No newline at end of file + */(()=>{"use strict";var __webpack_modules__={915:(t,e,i)=>{i.d(e,{A:()=>n});const n=' '},841:(t,e,i)=>{i.d(e,{A:()=>n});const n=' '},863:(t,e,i)=>{i.d(e,{A:()=>n});const n='
'},248:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>JokerUI});var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(669),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),_html_button_html__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(915),_html_styles_html__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(841),_html_window_html__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(863);class JokerUI{constructor(t){this.joker=t,jquery__WEBPACK_IMPORTED_MODULE_0___default()('link[rel="stylesheet"]').eq(0).before(_html_styles_html__WEBPACK_IMPORTED_MODULE_1__.A);t=this.button;t.hide(),t.mybbModal({title:"Настройки первоапрельских шуток",content:()=>this.render(),closer:!0,noscroll:!0,escClose:!0})}get button(){let t=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__button");return t=0===t.length?jquery__WEBPACK_IMPORTED_MODULE_0___default()(_html_button_html__WEBPACK_IMPORTED_MODULE_2__.A).appendTo("body"):t}show(){this.button.show()}render(){const result=jquery__WEBPACK_IMPORTED_MODULE_0___default()("
").html(_html_window_html__WEBPACK_IMPORTED_MODULE_3__.A),rowTemplate=jquery__WEBPACK_IMPORTED_MODULE_0___default()("#april-fools__window-row",result).html(),jokeContainer=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__jokes",result);for(const joke of Object.values(this.joker.jokes)){const row=jquery__WEBPACK_IMPORTED_MODULE_0___default()(eval("`"+rowTemplate+"`"));jquery__WEBPACK_IMPORTED_MODULE_0___default()('input[type="checkbox"]',row).prop("checked",joke.settings.enabled).on("click",t=>{t=t.currentTarget;this.joker.toggleJoke(joke.id,t.checked)}),jokeContainer.append(row)}return jquery__WEBPACK_IMPORTED_MODULE_0___default()("button",result).on("click",async()=>{await this.joker.clearUserStates(),window.location.reload()}),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__content",result)}}},669:t=>{t.exports=jQuery}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];return void 0!==e||(e=__webpack_module_cache__[t]={exports:{}},__webpack_modules__[t](e,e.exports,__webpack_require__)),e.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var __webpack_exports__={};(()=>{class s{constructor(){this.enabled=!0,this.chance=20}}class o{get settings(){return this._settings}set settings(t){for(const n of Object.entries(t)){var e=n[0],i=n[1];switch(e){case"name":case"title":this.title=i;break;case"description":this.description=i;break;default:this._settings[e]=i}}}check(t){return Math.random()<.01*t}enable(){this.settings.enabled=!0}disable(){this.settings.enabled=!1}toggle(t=null){this.settings.enabled=null===t?!this.settings.enabled:t}}class i extends o{}var r,t=__webpack_require__(248),e=__webpack_require__(669),a=__webpack_require__.n(e);function n(t){return a()(t).find("*").contents().filter((t,e)=>e.nodeType===Node.TEXT_NODE)}let h=(e=document.currentScript)instanceof HTMLScriptElement&&!/\.min\.js$/.test(e.src);function l(...t){h&&console.log(...t)}function c(e,...i){let n="";for(let t=0;t{})}async loadUserStates(){var t=await(await fetch("/api.php?"+$.param({method:"storage.get",user_id:window.UserID,key:"april-fools"}))).json();if(!t.error){var e=JSON.parse(t.response.storage.data["april-fools"]);for(const i of Object.keys(this.jokes))this.jokes[i].settings.enabled=e[i]}}async clearUserStates(){await fetch("/api.php?"+$.param({method:"storage.delete",user_id:window.UserID,key:"april-fools",token:window.ForumAPITicket}))}start(t,e=!1){t in this.jokes&&(t=this.jokes[t],e||t.settings.enabled&&this.check(t.settings.chance)?(l(t.title,"- шутка включена"),t.start()):l(t.title,"- шутка не включена"))}startAll(t=!1){for(const e of Object.keys(this.jokes))this.start(e,t)}regularCheck(){var t,e;return!!this.core_settings.enabled&&(0<=this.core_settings.testers.indexOf(window.UserID)||(t=(e=new Date).getMonth()+1,e=e.getDate(),4===t&&1===e&&this.check(this.core_settings.chance)))}async regularStart(){this.regularCheck()&&(await this.loadUserStates(),this.ui.show(),this.startAll())}}class u{constructor(){this.chance=100,this.enabled=!0,this.testers=[]}}i;class p{constructor(){this.enabled=!1,this.chance=1,this.directions=["top","left","bottom","left"],this.force=.5,this.selector="[id^=pun]",this.interval=100}}o;class g{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content"}}o;class f{constructor(){this.enabled=!1,this.chance=30}}o;class m{constructor(){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}}}o;class A{constructor(){this.enabled=!0,this.chance=20,this.selector=".pa-author a"}}o;class w{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content",this.shuffle_chance=50}}function _(t){let s,o,n,r,a=t&&t.emoji||"🤪",h=t&&t.element,l=h||document.body,c=window.innerWidth,d=window.innerHeight,u={x:c/2,y:c/2},p=[];const g=window.matchMedia("(prefers-reduced-motion: reduce)");function e(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");s=document.createElement("canvas"),o=s.getContext("2d"),s.style.top="0px",s.style.left="0px",s.style.pointerEvents="none",h?(s.style.position="absolute",l.appendChild(s),s.width=l.clientWidth,s.height=l.clientHeight):(s.style.position="fixed",document.body.appendChild(s),s.width=c,s.height=d),o.font="16px serif",o.textBaseline="middle",o.textAlign="center";var t=o.measureText(a),e=document.createElement("canvas"),i=e.getContext("2d");e.width=t.width,e.height=2*t.actualBoundingBoxAscent,i.textAlign="center",i.font="16px serif",i.textBaseline="middle",i.fillText(a,e.width/2,t.actualBoundingBoxAscent),r=e;let n=0;for(n=0;n<7;n++)p[n]=new y(r);l.addEventListener("mousemove",A),l.addEventListener("touchmove",m,{passive:!0}),l.addEventListener("touchstart",m,{passive:!0}),window.addEventListener("resize",f),w()}function f(t){c=window.innerWidth,d=window.innerHeight,h?(s.width=l.clientWidth,s.height=l.clientHeight):(s.width=c,s.height=d)}function m(t){var e;0=i-11-1&&(0=e-11&&(0{(g.matches?i:e)()},e(),{destroy:i}}function v(t){let e,o,i,s=t&&t.element,r=s||document.body,a=window.innerWidth,h=window.innerHeight,l={x:a/2,y:a/2},c=[];const d=t?.particles||15,u=t?.rate||.4,n=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 p=!1,g=new Image;g.src=n;const f=window.matchMedia("(prefers-reduced-motion: reduce)");function m(){if(f.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");e=document.createElement("canvas"),o=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",s?(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=a,e.height=h),r.addEventListener("mousemove",w),window.addEventListener("resize",A),_()}function A(t){a=window.innerWidth,h=window.innerHeight,s?(e.width=r.clientWidth,e.height=r.clientHeight):(e.width=a,e.height=h)}function w(t){if(s){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===p){p=!0;for(let t=0;t{(f.matches?v:m)()},m(),{destroy:v}}function y(t){let e,r,i,n=t&&t.element,s=n||document.body,a=window.innerWidth,h=window.innerHeight,l={x:a/2,y:a/2},c=[];const o=t?.length||20,d=t?.colors||["#FE0000","#FD8C00","#FFE500","#119F0B","#0644B3","#C22EDC"],u=t?.size||3;let p=!1;const g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");e=document.createElement("canvas"),r=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",n?(e.style.position="absolute",s.appendChild(e),e.width=s.clientWidth,e.height=s.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=a,e.height=h),s.addEventListener("mousemove",A),window.addEventListener("resize",m),w()}function m(t){a=window.innerWidth,h=window.innerHeight,n?(e.width=s.clientWidth,e.height=s.clientHeight):(e.width=a,e.height=h)}function A(t){if(n){const e=s.getBoundingClientRect();l.x=t.clientX-e.left,l.y=t.clientY-e.top}else l.x=t.clientX,l.y=t.clientY;if(!1===p){p=!0;for(let t=0;t{r.beginPath(),r.strokeStyle=t,n.length&&r.moveTo(n[0].x,n[0].y+i*(u-1)),n.forEach((t,e)=>{0!==e&&r.lineTo(t.x,t.y+i*u)}),r.lineWidth=u,r.lineCap="round",r.stroke()})}i=requestAnimationFrame(w)}function _(){e.remove(),cancelAnimationFrame(i),s.removeEventListener("mousemove",A),window.addEventListener("resize",m)}function v(t,e){this.position={x:t,y:e}}return g.onchange=()=>{(g.matches?_:f)()},f(),{destroy:_}}function x(t){let e,o,r,i=t&&t.element,n=i||document.body,a=window.innerWidth,h=window.innerHeight,l={x:a/2,y:a/2};const O=t&&t.dateColor||"blue",W=t&&t.faceColor||"black",P=t&&t.secondsColor||"red",Y=t&&t.minutesColor||"black",F=t&&t.hoursColor||"black",c=.4,H=t&&t.theDays||["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"],U=t&&t.theMonths||["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"];var t=new Date,X=t.getDate(),z=t.getYear()+1900;const s=(" "+H[t.getDay()]+" "+X+" "+U[t.getMonth()]+" "+z).split(""),d=["3","4","5","6","7","8","9","10","11","12","1","2"],u=d.length,p=["•","•","•"],g=["•","•","•","•"],f=["•","•","•","•","•"],m=360/u,A=360/s.length,w=45/6.5,_=[],v=[],y=[],x=[],b=[],E=[],M=[],k=[],C=[];var j=parseInt(s.length+u+p.length+g.length+f.length)+1;const L=window.matchMedia("(prefers-reduced-motion: reduce)");function B(){if(L.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");e=document.createElement("canvas"),o=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",i?(e.style.position="absolute",n.appendChild(e),e.width=n.clientWidth,e.height=n.clientHeight):(e.style.position="fixed",document.body.appendChild(e),e.width=a,e.height=h),o.font="10px sans-serif",o.textAlign="center",o.textBaseline="middle";for(let t=0;t=h-80&&(_[t-1]=h-80),v[t-1]>=a-80&&(v[t-1]=a-80);o.clearRect(0,0,a,h);var t=new Date,e=t.getSeconds(),i=Math.PI*(e-15)/30,e=t.getMinutes(),n=Math.PI*(e-15)/30,e=t.getHours(),s=Math.PI*(e-3)/6+Math.PI*parseInt(t.getMinutes())/360;for(let t=0;t{(L.matches?T:B)()},B(),{destroy:T}}function b(t){let e,s,o,i=t||{},n=t&&t.element,r=n||document.body,a=i.text?" "+t.text:" Your Text Here",h=t?.color||"#000000",l=i.font||"monospace",c=i.textSize||12,d=c+"px "+l,u=i.gap||c+2,p=0,g=[],f=window.innerWidth,m=window.innerHeight,A={x:f/2,y:f/2};for(let t=0;t{(w.matches?b:_)()},_(),{destroy:b}}i;(e=r=r||{}).Rainbow="rainbow",e.FairyDust="fairy_dust",e.SpringyEmoji="springy_emoji",e.Emoji="emoji",e.Ghost="ghost",e.Trailing="trailing",e.TextFlag="text_flag",e.FollowingDot="following_dot",e.Bubbles="bubbles",e.Snowflake="snowflake",e.Clock="clock";class E{constructor(){this.enabled=!0,this.chance=100,this.effects={[r.Rainbow]:new class extends M{constructor(){super(...arguments),this.length=20,this.size=3,this.colors=["#9400D3","#4B0082","#0000FF","#00FF00","#FFFF00","#FF7F00","#FF0000"]}},[r.SpringyEmoji]:new class extends M{constructor(){super(...arguments),this.emoji="🤪"}},[r.Emoji]:new class extends M{constructor(){super(...arguments),this.emoji=["🔥","🐬","🦆"]}},[r.FairyDust]:new class extends M{constructor(){super(...arguments),this.colors=["#ff0000","#00ff00","#0000ff"]}},[r.Ghost]:new M,[r.Trailing]:new class extends M{constructor(){super(...arguments),this.particles=15,this.rate=.4,this.baseImageSrc=null}},[r.TextFlag]:new class extends M{constructor(){super(...arguments),this.text="С днём смеха!",this.color="#000000",this.font="monospace",this.textSize=12,this.gap=14,this.size=3}},[r.FollowingDot]:new class extends M{constructor(){super(...arguments),this.color="#323232a6"}},[r.Bubbles]:new M,[r.Snowflake]:new class extends M{constructor(){super(...arguments),this.weight=0}},[r.Clock]:new class extends M{constructor(){super(...arguments),this.dateColor="blue",this.faceColor="black",this.secondsColor="red",this.minutesColor="black",this.hoursColor="black"}}}}}class M extends class{}{constructor(){super(...arguments),this.enabled=!0,this.weight=50}}o;class k{constructor(){this.enabled=!0,this.chance=100,this.gender_resolver=null,this.rude=!1,this.change_frequency=5,this.schemas={"{adj} {noun}{p}":10,"{noun} {adj}{p}":3,"{adj}, {adj} {noun}{p}":10,"{adj} и очень {adj} {noun}{p}":10,"{adj} {noun} {verb}{p}":10,"{adj} {noun} {adv} {verb}{p}":5,"{adj} {noun} {verb} {place}{p}":5,"{adj} {noun} {adv} {verb} {place}{p}":5},this.variants={adj:{},noun:{},verb:{},place:{},adv:{},p:{"":new C({weight:15}),".":new C({weight:10}),"...":new C({weight:5}),"!":new C({weight:5}),"!!!":new C({weight:2}),"?":new C({weight:2}),"?!":new C({weight:1})}}}}class C{constructor(t){this.weight=10,this.enabled=!0,this.rude=!1,(this.gender=null)==this.weight&&(this.weight=t.weight),null==this.enabled&&(this.enabled=t.enabled),null==this.rude&&(this.rude=t.rude),null==this.gender&&(this.gender=t.gender)}}function j(i,t){const n={};return t.split(",").map(t=>t.trim()).forEach(t=>{var e=t.replace(/[^А-ЯЁа-яёA-Za-z\- ]/g,"");""!==e&&(n[e]=new C({gender:i,rude:0<=t.indexOf("$"),enabled:t.indexOf("!")<0,weight:10*(0<=t.indexOf("$")?.5:1)*(0<=t.indexOf("%")?.5:1)*(0<=t.indexOf("^")?2:1)}))}),n}window.BuildStupidTitleVariant=j;o;class L{constructor(){this.enabled=!0,this.chance=10}}o;class B{constructor(){this.enabled=!0,this.chance=10,this.selector=".post-content",this.ruToEn={"а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"e","ж":"j","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"shch","ъ":"ie","ы":"y","ь":"","э":"e","ю":"u","я":"ya"},this.enToRu={a:"а",b:"б",c:"с",d:"д",e:"е",f:"ф",gh:"ж",g:"г",h:"х",i:"и",j:"й",k:"к",l:"л",m:"м",n:"н",o:"о",p:"п",q:"кью",r:"р",s:"с",t:"т",u:"ю",v:"в",w:"в",x:"кс",y:"ы",z:"з"}}}class R{constructor(t=0,e=0){this.x=t,this.y=e}get angle(){return Math.atan2(this.y,this.x)}set angle(t){var e=this.length;this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}get length(){return Math.distance(this.x,this.y)}set length(t){var e=this.angle;this.x=Math.cos(e)*t,this.y=Math.sin(e)*t}static addVectors(t,e){return new R(t.x+e.x,t.y+e.y)}static dotProduct(t,e){return t.x*e.x+t.y*e.y}static fromLengthAngle(t,e){var i=new R;return i.length=e,i.angle=t,i}reverse(){return new R(-this.x,-this.y)}add(t){return R.addVectors(this,t)}multiply(t){return new R(t*this.x,t*this.y)}toTransform(){return`translate(${this.x}px, ${this.y}px)`}toString(){return c`Vector(x=${this.x}, y=${this.y}, `+c`length=${this.length}, angle=${this.angle})`}}Math.distance=(t,e)=>Math.sqrt(t*t+e*e);o;class D{constructor(t){this.settings=t,this.state={position:new R,velocity:R.fromLengthAngle(2*Math.random()*Math.PI,Math.random()*(this.settings.maxVelocity-this.settings.minVelocity)+this.settings.minVelocity),acceleration:new R},this.mouse=new R,this.dt=1/this.settings.tickPerSecond}get position(){return this.state.position}get velocity(){return this.state.velocity}get acceleration(){return this.state.acceleration}step(t){this.last=this.state,this.debugLines=[],this.forces={},this.processForces(),this.processMovement(),this.processCollisions(t)}processForces(){this.forces.gravity=R.fromLengthAngle(this.last.position.angle+Math.PI,this.settings.gravity),this.last.velocity.lengththis.settings.maxVelocity&&(this.forces.correction=R.fromLengthAngle(this.last.velocity.angle+Math.PI,this.settings.correctionForce*Math.pow(this.last.velocity.length-this.settings.maxVelocity,2)));var t=this.mouse.add(this.last.position.reverse());t.lengthe&&(this.position.x=2*e-this.position.x,this.velocity.x=-this.velocity.x*this.settings.collisionElasticity),this.position.y<-t&&(this.position.y=-2*t-this.position.y,this.velocity.y=-this.velocity.y*this.settings.collisionElasticity),this.position.y>t&&(this.position.y=2*t-this.position.y,this.velocity.y=-this.velocity.y*this.settings.collisionElasticity)}randomGaussian(t=0,e=1){var i=1-Math.random(),n=Math.random();return Math.sqrt(-2*Math.log(i))*Math.cos(2*Math.PI*n)*e+t}}class S{constructor(){this.enabled=!0,this.chance=100,this.keepDistance=200,this.maxVelocity=500,this.minVelocity=20,this.tickPerSecond=50,this.gravity=20,this.correctionForce=.8,this.mouseForceMax=5e3,this.mouseForcePow=5,this.mass=1,this.collisionElasticity=.9}}window.AprilJokes=(t=>{const e=new d;return t.forEach(t=>{e.add(new t)}),$(()=>e.regularStart()),e})([class extends i{constructor(){super(...arguments),this.id="shake",this.title="Форумо-трясение",this.description="Страница форума начинает трястись",this._settings=new p,this.dataName="april-fools-shake"}rand(t){return t+this.settings.force*(2*Math.random()-1)}start(){this.items=a()(this.settings.selector),this.items.each((t,e)=>{const i={};this.settings.directions.forEach(t=>{i[t]=parseInt(a()(e).css("margin-"+t))}),a()(e).data(this.dataName,i)}),this.intervalId=setInterval(()=>{this.items.each((t,e)=>{var i=a()(e).data(this.dataName);for(const n of Object.entries(i))a()(e).css("margin-"+n[0],this.rand(n[1]))})},this.settings.interval)}stop(){clearInterval(this.intervalId),this.items.each((t,e)=>{const i={};this.settings.directions.forEach(t=>{a()(e).css("margin-"+t,i[t])}),a()(e).data(this.dataName,i)})}},class extends o{constructor(){super(...arguments),this.id="humanitarian_hell",this.title="Ад гуманитария",this.description='Все "тся" заменяются на "ться", а все "ться" на "тся"',this._settings=new g}processText(t){return t.replace(/(ть?ся)/g,function(t){return 0{e.textContent=this.processText(e.textContent)})}},class extends o{constructor(){super(...arguments),this.id="mirror",this.title="Зеркало",this.description="Элементы форума отражаются (по крайней мере, пытаются)",this._settings=new f}start(){a()(".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"'),a()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),a()(".post h3 span").css("margin-right","25em")}},class extends o{constructor(){super(...arguments),this.id="carnival",this.title="Карнавал",this.description="Аватарки приобретают интересные цвета",this._settings=new m}start(){a()(this.settings.selector).each((t,e)=>{var i=[];for(const n of Object.entries(this.settings.variants))this.check(this.settings.variant_chance)&&i.push(n[0].replace("{0}",Math.round(Math.random()*n[1]).toString()));0{var i=a()(e).text();let n="";for(let t=0;tthis.shuffleLetters(e))}start(){n(this.settings.selector).each((t,e)=>this.processNode(e))}},class extends i{constructor(){super(...arguments),this.id="cursor_effects",this.title="Красивый курсор",this.description="Эффекты, следующие за курсором",this._settings=new E}enableAll(){for(const t of Object.keys(this.settings.effects))this.settings.effects[t].enabled=!0}disableAll(){for(const t of Object.keys(this.settings.effects))this.settings.effects[t].enabled=!1}weight(t){t=this.settings.effects[t];return t.enabled?t.weight:0}getRandomEffect(){var t=Object.values(r).map(t=>t),e=t.reduce((t,e)=>t+this.weight(e),0),i=Math.random()*e;let n=0;for(const s of t)if(i<=(n+=this.weight(s)))return s;throw new Error("Тебя быть тут не должно...")}start(){var t=this.getRandomEffect(),e=this.settings.effects[t];this.active_cursor_effect=function(t,e){switch(t){case r.Rainbow:return y(e);case r.FairyDust:return function(t){let e=t&&t.colors||["#D61C59","#E7D84B","#1B8798"],i=t&&t.element,n=i||document.body,s=window.innerWidth,o=window.innerHeight;const r={x:s/2,y:s/2},a={x:s/2,y:s/2},h=[],l=[];let c,d,u;const p=window.matchMedia("(prefers-reduced-motion: reduce)");function g(){if(p.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");c=document.createElement("canvas"),d=c.getContext("2d"),c.style.top="0px",c.style.left="0px",c.style.pointerEvents="none",i?(c.style.position="absolute",n.appendChild(c),c.width=n.clientWidth,c.height=n.clientHeight):(c.style.position="fixed",n.appendChild(c),c.width=s,c.height=o),d.font="21px serif",d.textBaseline="middle",d.textAlign="center",e.forEach(t=>{var e=d.measureText("*"),i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,n.fillStyle=t,n.textAlign="center",n.font="21px serif",n.textBaseline="middle",n.fillText("*",i.width/2,e.actualBoundingBoxAscent),l.push(i)}),n.addEventListener("mousemove",A),n.addEventListener("touchmove",m,{passive:!0}),n.addEventListener("touchstart",m,{passive:!0}),window.addEventListener("resize",f),_()}function f(t){s=window.innerWidth,o=window.innerHeight,i?(c.width=n.clientWidth,c.height=n.clientHeight):(c.width=s,c.height=o)}function m(e){if(0{if(i){const e=n.getBoundingClientRect();r.x=t.clientX-e.left,r.y=t.clientY-e.top}else r.x=t.clientX,r.y=t.clientY;1.5{(p.matches?v:g)()},g(),{destroy:v}}(e);case r.SpringyEmoji:return _(e);case r.Emoji:return function(t){const e=t&&t.emoji||["😀","😂","😆","😊"];let i=t&&t.element,n=i||document.body,s=window.innerWidth,o=window.innerHeight;const r={x:s/2,y:s/2},a={x:s/2,y:s/2};let h=0;const l=[],c=[];let d,u,p;const g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");d=document.createElement("canvas"),u=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",document.body.appendChild(d),d.width=s,d.height=o),u.font="21px serif",u.textBaseline="middle",u.textAlign="center",e.forEach(t=>{var e=u.measureText(t),i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=2*e.actualBoundingBoxAscent,n.textAlign="center",n.font="21px serif",n.textBaseline="middle",n.fillText(t,i.width/2,e.actualBoundingBoxAscent),c.push(i)}),n.addEventListener("mousemove",w,{passive:!0}),n.addEventListener("touchmove",A,{passive:!0}),n.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",m),v()}function m(t){s=window.innerWidth,o=window.innerHeight,i?(d.width=n.clientWidth,d.height=n.clientHeight):(d.width=s,d.height=o)}function A(e){if(0{if(i){const e=n.getBoundingClientRect();r.x=t.clientX-e.left,r.y=t.clientY-e.top}else r.x=t.clientX,r.y=t.clientY;1{(g.matches?y:f)()},f(),{destroy:y}}(e);case r.Ghost:return function(t){let e,i,n,s=t&&t.element,o=s||document.body,r=t&&t.randomDelay,a=t&&t.minDelay||5,h=t&&t.maxDelay||50,l=window.innerWidth,c=window.innerHeight,d={x:l/2,y:l/2},u=[],p=new Image;t&&t.image?p.src=t.image:p.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 g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");e=document.createElement("canvas"),i=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",s?(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=l,e.height=c),o.addEventListener("mousemove",y),o.addEventListener("touchmove",A,{passive:!0}),o.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",m),b()}function m(t){l=window.innerWidth,c=window.innerHeight,s?(e.width=o.clientWidth,e.height=o.clientHeight):(e.width=l,e.height=c)}function A(e){if(0{(g.matches?E:f)()};let w=()=>Math.floor(Math.random()*(h-a+1))+a,_=Date.now(),v=w();function y(t){if(r){if(_+v>Date.now())return;_=Date.now(),v=w()}var e;s?(e=o.getBoundingClientRect(),d.x=t.clientX-e.left,d.y=t.clientY-e.top):(d.x=t.clientX,d.y=t.clientY),x(d.x,d.y,p)}function x(t,e,i){u.push(new M(t,e,i))}function b(){if(0!=u.length){i.clearRect(0,0,l,c);for(let t=0;t{(c.matches?f:d)()},d(),{destroy:f}}(e);case r.Bubbles:return function(t){let e,i,n,s=t&&t.element,o=s||document.body,r=window.innerWidth,a=window.innerHeight,h={x:r/2,y:r/2},l=[],c=[];const d=window.matchMedia("(prefers-reduced-motion: reduce)");function u(){if(d.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");e=document.createElement("canvas"),i=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",s?(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=a),o.addEventListener("mousemove",f),o.addEventListener("touchmove",g,{passive:!0}),o.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",p),A()}function p(t){r=window.innerWidth,a=window.innerHeight,s?(e.width=o.clientWidth,e.height=o.clientHeight):(e.width=r,e.height=a)}function g(e){if(0{(d.matches?w:u)()},u(),{destroy:w}}(e);case r.Snowflake:return function(t){let e,s,i,n=t&&t.element,o=n||document.body,r=["❄️"],a=window.innerWidth,h=window.innerHeight,l={x:a/2,y:a/2},c=[],d=[];const u=window.matchMedia("(prefers-reduced-motion: reduce)");function p(){if(u.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");e=document.createElement("canvas"),s=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",n?(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=a,e.height=h),s.font="12px serif",s.textBaseline="middle",s.textAlign="center",r.forEach(t=>{var e=s.measureText(t),i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=2*e.actualBoundingBoxAscent,n.textAlign="center",n.font="12px serif",n.textBaseline="middle",n.fillText(t,i.width/2,e.actualBoundingBoxAscent),d.push(i)}),o.addEventListener("mousemove",m),o.addEventListener("touchmove",f,{passive:!0}),o.addEventListener("touchstart",f,{passive:!0}),window.addEventListener("resize",g),w()}function g(t){a=window.innerWidth,h=window.innerHeight,n?(e.width=o.clientWidth,e.height=o.clientHeight):(e.width=a,e.height=h)}function f(e){if(0{(u.matches?_:p)()},p(),{destroy:_}}(e);case r.Clock:return x(e)}}(t,e)}stop(){this.active_cursor_effect.destroy()}},class extends o{constructor(){super(...arguments),this.id="stupid_title",this.title="Глупые статусы",this.description="Каждому пользователю даётся новый глупый статус",this._settings=new k,this.loadedGenders=null,this.variantsGenerated=!1,this.seed=0}async loadGenders(){var t=a()(".pa-author a").map((t,e)=>e.innerText).toArray().reduce((t,e)=>(t.indexOf(e)<0&&t.push(e),t),[]),t="/api.php?"+a().param({method:"users.get",fields:"username,sex",username:t}),t=await(await fetch(t)).json();this.loadedGenders={},t.error||null!=(t=t.response)&&t.users.forEach(t=>{"0"!==t.sex&&(this.loadedGenders[t.username]="1"===t.sex)})}resolveGender(t){return null!==this.settings.gender_resolver?!!this.settings.gender_resolver.call(this,t):t in this.loadedGenders?!!this.loadedGenders[t]:(this.resetSeed(),"m"===this.selectRandom(t,{m:1,f:1}))}async start(){var t;this.variantsGenerated||((t=this.settings.variants).adj=Object.assign(Object.assign(Object.assign({},j(!0,"адекватный,$адский,активный,алчный,%ангельский,банальный,безнадёжный,$бесполезный,былой,верный,виртуальный,вкусный,воспитанный,выгодный,выходной,гигантский,$глупый,гордый,грамотный,громадный,грубый,далекий,двуличный,деятельный,доброжелательный,$жалкий,жёсткий,жестокий,$жирный,заинтересованный,запасной,застенчивый,знакомый,иностранный,истинный,конструктивный,креативный,ласковый,любимый,мелочный,^мирный,мстительный,небесный,невозможный,независимый,низкий,нужный,объективный,обыкновенный,опрятный,^оригинальный,особенный,острый,откровенный,открытый,пестрый,повседневный,подземный,пожилой,показательный,последний,посторонний,провинциальный,пышный,робкий,родной,самовлюблённый,северный,седой,семейный,серьёзный,сногсшибательный,^солнечный,спокойный,суровый,терпеливый,уверенный в себе,ударный,^удачливый,формальный,хладнокровный,целый,чистый,чрезвычайный,чужой,южный")),j(!1,"адекватная,$адская,активная,алчная,%ангельская,банальная,безнадёжная,$бесполезная,былая,верная,виртуальная,вкусная,воспитанная,выгодная,выходная,гигантская,$глупая,гордая,грамотная,громадная,грубая,далекая,двуличная,деятельная,доброжелательная,$жалкая,жёсткая,жестокая,$жирная,заинтересованная,запасная,застенчивая,знакомая,иностранная,истинная,конструктивная,креативная,ласковая,любимая,мелочная,^мирная,мстительная,небесная,невозможная,независимая,низкая,нужная,объективная,обыкновенная,опрятная,^оригинальная,особенная,острая,откровенная,открытая,пестрая,повседневная,подземная,пожилая,показательная,последняя,посторонняя,провинциальная,пышная,робкая,родная,самовлюблённая,северная,седая,семейная,серьезная,сногсшибательная,^солнечная,спокаяная,суровая,терпеливая,уверенная в себе,ударная,^удачливая,формальная,хладнокровная,целая,чистая,чрезвычайная,чужая,южная")),t.adj),t.noun=Object.assign(Object.assign(Object.assign({},j(!0,"актёр,$балбес,бард,басурманин,борец,бродяга,бруталище,волк,дворф,%дед,%дедушка,джентльмен,диван,динозавр,дракон,ёж,%ёжик,жук,зайц,$злоумышленник,зомби,карасик,кентавр,кит,кот,кролик,кулак,лев,ледник,лесоруб,%мальчег,мальчик,манекен,массажист,мачо,монах,монстр,наследник,ниндзя,носорог,одиночка,организм,орёл,отец,принц,проказник,пузырь,$раб,рыцарь,спортсмен,сурикат,сын,%сынок,тигр,товарищ,хоббит,эльф")),j(!1,"актриса,акула,$бабка,бабочка,%бабушка,бактерия,белочка,бусинка,валькирия,$ведьма,волторна,волчица,горгулья,дворфиха,девочка,деревяшка,детка,%деффачка,%дочка,дочь,заноза,$злоумышленница,знаменитость,каруселька,килька,конфетка,косточка,кошка,красотка,крышка,леди,$личинка,львица,мать,машина,милашка,монашка,мышь,наследница,орлица,панда,пиранья,принцесса,простуда,$рабыня,русалочка,рыбка,рыбка,скамеечка,спортсменка,тигрица,травка,черепашка,чертовка,эльфийка")),t.noun),t.verb=Object.assign(Object.assign(Object.assign(Object.assign({},j(null,"бежит,берёт и делает,болеет,встаёт,говорит,думает,забывает,замирает,заходит,идёт,%имеет план и придерживается его,ловит,меняется,молчит,нарушает,оглядывается,орёт,освобождает,отвечает,отказаться куда-то идти,отказывается,отказывается вставать,отказывается что-то делать,оформляет,плывёт,поглядывает,поздравляет,поздравляет,получает,прибывает,приказывает,просыпается,прощает,работает,радуется,скрывается,снимает,снимает,снимается в сериале,снимается в фильме,собирается,соединяет,спрашивает,тянет,указывает,учит,читает,что-то скрывает,чувствует опасность,шепчет")),j(!0,"взял и сделал,додумался,женился,женится,заработался,не спал,не успел,обиделся,познал дзен,присел,проснулся,скрылся,смог,успел")),j(!1,"взяла и сделала,выходит замуж,вышла замуж,додумалась,заработалась,не спала,не успела,обиделась,познала дзен,присела,проснулась,скрылась,смогла,успела")),t.verb),t.place=Object.assign(Object.assign({},j(null,"в джунглях,в квартире,в космосе,в лесу,в очереди,в пустыне,в театре,%в тёплой и уютной квартире,в филармонии,где-то,на заснеженной вершине,на конференции,на пляже,на форуме,под водой,под дождём,%под проливным дождём")),t.place),t.adv=Object.assign(Object.assign({},j(null,"безрассудно,быстро,внезапно,вновь,$грубо,грустно,медленно,%молниеносно,немедленно,опять,осмысленно,позже,предсказуемо,расчётливо,регулярно,счастливо,уже,уныло")),t.adv),this.variantsGenerated=!0),await this.loadGenders();const n={};a()(".post-author").each((t,e)=>{var i=a()(".pa-author a",e).text();i&&(i in n||(this.resetSeed(),n[i]=this.generatePhrase(i)),a()(".pa-title",e).text(n[i]))})}generatePhrase(i){const n=this.resolveGender(i);var t=this.selectRandom(i,this.settings.schemas);return this.capitalizeFirst(t.replace(/\{(.+?)}/g,(t,e)=>{e=this.buildVariants(e,n);return this.selectRandom(i,e)}))}prng(i,t,e){let n=3735928559^t,s=1103547991^t;for(let t=0,e;t>>16,2246822507)^Math.imul(s^s>>>13,3266489909);t=4294967296*(2097151&(s=Math.imul(s^s>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0);return Math.floor(Math.pow(Math.sin(t),2)*e)%e}resetSeed(){var t=new Date,e=60*t.getUTCHours()+t.getUTCMinutes();0===this.settings.change_frequency?this.seed=60*e+t.getUTCSeconds():this.seed=Math.floor(e/this.settings.change_frequency)}selectRandom(t,i){var e=Object.keys(i),n=e.reduce((t,e)=>t+i[e],0),s=this.prng(t,this.seed++,n);let o=0;for(const r of e)if(s<=(o+=i[r]))return r;throw new Error("Тебя быть тут не должно...")}buildVariants(t,e){var i={},t=this.settings.variants[t];for(const o of Object.entries(t)){var n=o[0],s=o[1];!s.enabled||s.gender===!e||!this.settings.rude&&s.rude||(i[n]=s.weight)}return i}capitalizeFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}},class extends o{constructor(){super(...arguments),this.id="inverted_scroll",this.title="Обратная гравитация",this.description="Скролл в обратную сторону",this._settings=new L}start(){document.addEventListener("wheel",t=>{t.preventDefault(),scrollBy(0,-t.deltaY)},{passive:!1})}},class extends o{constructor(){super(...arguments),this.id="latinization",this.title="Латинизация",this.description="Все символы на странице или только в постах или еще где-то местами - латиницей вместо кириллицы и наоборот",this._settings=new B}start(){n(this.settings.selector).each((t,e)=>this.processNode(e))}latinize(t){if(/[а-яА-ЯёЁ0-9_-]+/.test(t))for(var[e,i]of Object.entries(this.settings.ruToEn))t=t.replace(new RegExp(e,"g"),i).replace(new RegExp(e.toUpperCase(),"gi"),i.toUpperCase());else if(/[a-zA-Z0-9_-]+/.test(t))for(var[n,s]of Object.entries(this.settings.enToRu))t=t.replace(new RegExp(n,"g"),s).replace(new RegExp(n.toUpperCase(),"gi"),s.toUpperCase());return t}processNode(t){t.textContent=null==(t=t.textContent)?void 0:t.replace(/([А-Яа-яA-Za-z]+)/gm,(t,e)=>this.latinize(e))}},class extends o{constructor(){super(...arguments),this.id="fresh_grass",this.title="Свежая трава",this.description="Предложение потрогать траву",this._settings=new S}start(){a()(()=>this.init())}init(){var t=a()(document.body);document.body.style.setProperty("--fresh-grass-body-top",`-${window.scrollY}px`),this.container=a()('

А ты трогал сегодня траву?

Здесь должная быть трава, но что-то сломалось... Притворись, что она здесь есть, хорошо? Изображение травы взято с WikiMedia под лицензией CC BY-SA 4.0 DEED.
'),this.container.hide(0),t.append(this.container),this.container.fadeIn(500),this.fleeingGrass()}debug(t){h&&a()("small",this.container).html(`
${t}
`)}fleeingGrass(){this.movement=new D(this.settings);const e=a()("img.april-fools__joke__fresh-grass__image",this.container);e.on("mousedown",()=>{this.close()}),a()(window).on("mousemove",t=>{this.movement.mouse=new R(t.clientX-window.innerWidth/2,t.clientY-window.innerHeight/2)}),this.intervalIndex=setInterval(()=>{var t=e[0].getBoundingClientRect();this.movement.step(t),e.css("transform",this.movement.state.position.toTransform())},Math.floor(1e3*this.movement.dt))}close(){clearInterval(this.intervalIndex),this.container.fadeOut({duration:500,complete:()=>{this.container.remove(),scrollTo(0,-parseInt(document.body.style.getPropertyValue("--fresh-grass-body-top")))}})}}])})()})(); \ No newline at end of file diff --git a/package.json b/package.json index b464028..4477096 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.1", + "version": "1.1.2", "name": "mybb-april-fools", "description": "Система первоапрельских розыгрышей для форумов MyBB", "homepage": "https://forumd.ru/viewtopic.php?id=7372",