generated from s9a/interweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeejay.js
82 lines (73 loc) · 5.42 KB
/
deejay.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// npm.im/varam
// ryanve.dev/varam
!function(n,m){function t(b){var d=!1,c=new f(b);b=m.querySelectorAll("[data-varam]");p(b,function(e){var h=e.getAttribute("data-varam");(h=h&&h.match(u))&&p(h,function(q){var v=c.get(q);d=r(e.style,"--"+q,v)||d})});a.state=c.toString();return d}function k(){return!1}function w(){return a(location.search)}function x(){return a("")}function r(b,d,c){var e=b.getPropertyValue(d);(e=c?e===c:!e)||b.setProperty(d,c);return!e}function p(b,d){for(var c=b.length;c--;)d(b[c])}var u=/\S+/g,f=n.URLSearchParams,
a=f?t:k,g=(m.querySelector||k).call(m,"meta[name=varam][content]");g=g&&g.content;var l="string"==typeof g;a.flow=f?w:k;a.fresh=r;a.help=function(){console.dir(a);return a.state};a.reset=f?x:k;a.state="";f&&a(l?l&&g:location.search);a.meta=l?a.state:!1;a.via=l?"meta":"flow";n.varam=a;"undefined"!=typeof module&&module.exports&&(module.exports=a)}(window,document);
// ¡! fragile
!function(willow, dolphin, lion) {
function zef(f) { f(0) }
function reset(elephant, name, value) {
var ph = elephant.style
ph.setProperty("--" + name, value)
}
var animal = willow.requestAnimationFrame || zef
var urchin = willow.URLSearchParams
var search = lion.search
var surprise = search === "?!"
var morf = dolphin.querySelector("form")
var bttm = morf.querySelector("button")
var thc = dolphin.querySelector("meta[name=theme-color]")
var all = [
"?tape-play=%23d819e6&tape-loud=%2361e5e3&tape-luvu=%2364e87e&tape-bluv=%235918f2&tape-blaq=%23eee833&tape-watt=%231b033f",
"?tape-play=%23fbbfff&tape-loud=%23eee833&tape-luvu=%2344f477&tape-bluv=%2311dff1&tape-blaq=%230091ff&tape-watt=%232f0b4c",
"?tape-play=%23da1fff&tape-loud=%233ce2b0&tape-luvu=%232adf5d&tape-bluv=%2311dff1&tape-blaq=%230b57d0&tape-watt=%23e0e0e0",
"?tape-play=%23c612d3&tape-loud=%23ef34d6&tape-luvu=%2344f477&tape-bluv=%2311dff1&tape-blaq=%23ffe74d&tape-watt=%23322f2f",
"?tape-play=%23fbbfff&tape-loud=%23eee833&tape-luvu=%2344f477&tape-bluv=%2311dff1&tape-blaq=%23523df0&tape-watt=%23e0e0e0",
"?tape-play=%23e4ec74&tape-loud=%234dffd2&tape-luvu=%23e208d0&tape-bluv=%2304b8c8&tape-blaq=%23560bb1&tape-watt=%23e0e0e0",
"?tape-play=%23e4ec74&tape-loud=%23ef34c6&tape-luvu=%236143f4&tape-bluv=%2304b8c8&tape-blaq=%23fbbfff&tape-watt=%23322f2f",
"?tape-play=%230e0e0e&tape-loud=%23250462&tape-luvu=%230e0e0e&tape-bluv=%230e0e0e&tape-blaq=%23eba3ff&tape-watt=%230e0e0e",
"?tape-play=%23a98aff&tape-loud=%23bae4ea&tape-luvu=%2300e1ff&tape-bluv=%238a9dff&tape-blaq=%23780099&tape-watt=%23bbaaee",
"?tape-play=%23fbbfff&tape-loud=%23eee833&tape-luvu=%2344f477&tape-bluv=%2311dff1&tape-blaq=%233719a4&tape-watt=%23bbaaee",
"?tape-play=%23fa3296&tape-loud=%23f8e93f&tape-luvu=%2341f6bd&tape-bluv=%238e38ff&tape-blaq=%23e0e0e0&tape-watt=%231c0313",
"?tape-play=%23fa3296&tape-loud=%23f8e93f&tape-luvu=%2340d9f7&tape-bluv=%238e38ff&tape-blaq=%23e0e0e0&tape-watt=%231c0313",
"?tape-play=%23fa3296&tape-loud=%23f8e93f&tape-luvu=%23ff7452&tape-bluv=%238e38ff&tape-blaq=%234bf0fb&tape-watt=%231c0313",
"?tape-play=%23fa3296&tape-loud=%23f8e93f&tape-luvu=%23eb52ff&tape-bluv=%238e38ff&tape-blaq=%2338fcff&tape-watt=%231c0313",
"?tape-play=%23ff5938&tape-loud=%23eee833&tape-luvu=%2338dbff&tape-bluv=%236f00ff&tape-blaq=%23d252ff&tape-watt=%231c0313",
"?tape-play=%23ff52f6&tape-loud=%239d52ff&tape-luvu=%233d5dff&tape-bluv=%23ffef3d&tape-blaq=%23bbeeee&tape-watt=%230e0e0e",
"?tape-play=%23ff52f6&tape-loud=%239d52ff&tape-luvu=%233d5dff&tape-bluv=%23ff8b33&tape-blaq=%23bbeeee&tape-watt=%23071079",
"?tape-bluv=%233d5dff&tape-loud=%23ff52c5&tape-luvu=%23673dff&tape-play=%23ff52f6&tape-blaq=%23bbeeee&tape-watt=%230e0e0e",
"?tape-play=%23d952ff&tape-loud=%235252ff&tape-luvu=%23ff52c5&tape-bluv=%238b52ff&tape-blaq=%23bbeeee&tape-watt=%230e0e0e",
"?tape-play=%23ff52ff&tape-loud=%238b52ff&tape-luvu=%23ff52c5&tape-bluv=%23c552ff&tape-blaq=%23bbeeee&tape-watt=%230e0e0e",
"?tape-play=%23ff52f6&tape-loud=%233d5dff&tape-luvu=%23d952ff&tape-bluv=%239d52ff&tape-blaq=%23bbeeee&tape-watt=%230e0e0e",
"?tape-play=%23ff52ff&tape-loud=%236f52ff&tape-luvu=%23ff52c5&tape-bluv=%23ff8b52&tape-blaq=%23bbeeee&tape-watt=%230e0e0e",
"?tape-play=%23ff913d&tape-loud=%239d52ff&tape-luvu=%233d5dff&tape-bluv=%23ffee33&tape-blaq=%23bbeeee&tape-watt=%23071079",
"?tape-play=%233dff3d&tape-loud=%239d52ff&tape-luvu=%233d5dff&tape-bluv=%23ffef3d&tape-blaq=%23bbeeee&tape-watt=%23071079",
"?tape-play=%23d952ff&tape-loud=%23ffef3d&tape-luvu=%2300d5ff&tape-bluv=%238e38ff&tape-blaq=%23fbbfff&tape-watt=%231c0313",
"?tape-play=%23fbbfff&tape-loud=%23eeee77&tape-luvu=%23bae4ea&tape-bluv=%238a2be2&tape-blaq=%2300bfff&tape-watt=%230e0e0e" // AiR
]
if (surprise) random()
else if (urchin && search) new urchin(search)
.forEach(function(hex, ki) {
var input = morf[ki]
if (!input) return
var value = input.value
if (value !== hex) input.value = hex
if ("tape-blaq" === ki) thc.setAttribute("content", hex)
})
function random() {
var nookie = Math.floor(Math.random() * all.length)
var sh = all[nookie]
if (sh === search) lion.href = "?"
if (sh) lion.href = sh
}
morf.addEventListener("change", function(e) {
var input = e.target
var name = input.name
var value = input.value
var label = input.parentNode
animal(function() {
reset(label, name, value)
reset(bttm, name, value)
})
})
dolphin.title = "illbang ¡! remixyz"
}(window, document, location);