Skip to content

Instantly share code, notes, and snippets.

@mikhailsdv
Last active May 27, 2024 17:13
Show Gist options
  • Save mikhailsdv/333b5a87fb742b6c0e1ac012916b7043 to your computer and use it in GitHub Desktop.
Save mikhailsdv/333b5a87fb742b6c0e1ac012916b7043 to your computer and use it in GitHub Desktop.
Hack Random for randstuff.ru
// ==UserScript==
// @name Hack Random for randstuff.ru
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author mikhailsdv
// @match https://randstuff.ru/number/
// @icon https://www.google.com/s2/favicons?sz=64&domain=randstuff.ru
// @grant none
// ==/UserScript==
;(function () {
"use strict"
// напишите свои числа через запятую между квадратных скобок ниже
const numbers = [11, 12, 13, 14, 15]
$("#button.number").off()
const el = document.querySelector("#number")
let i = 0
$("#button.number").on("click", () => {
const number = numbers[i]
? String(numbers[i++])
: String(Math.round(Math.random() * 100))
const caption = $("#caption")
const container = $("#number")
caption.text(caption.data("txt"))
container.attr("class", "single")
let html = '<span class="new">'
for (let a = 0; a < number.length; a++) {
html += `<span>${number.charAt(a)}</span>`
}
html += "</span>"
container.find(".new").attr("class", "cur")
container.find(".cur").remove()
container.append(html)
let b = 1
container.find(".new span").each(function () {
$(this)
.delay(parseInt(200 / number.length) * b++)
.animate({bottom: 0}, 200, "easeOutQuint")
})
})
})()
@blagohood
Copy link

8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment