Commit 013b082a authored by Akari Labs's avatar Akari Labs

line endings again, what a fucking mess

parent 2cc74041
MIT License MIT License
Copyright (c) 2019 caela and astra akari (lp0 and nocebo) Copyright (c) 2019 caela and astra akari (lp0 and nocebo)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
# gltchrr # gltchrr
an artificial text corruption system an artificial text corruption system
## to use ## to use
run `npm install`, followed by `npm run build` run `npm install`, followed by `npm run build`
this will emit the standalone html and the pleromafe userscript this will emit the standalone html and the pleromafe userscript
you can also use gltchrr as a node module in a project with `npm install git+https://git.agiri.ninja/lp0/gltchrr.git` you can also use gltchrr as a node module in a project with `npm install git+https://git.agiri.ninja/lp0/gltchrr.git`
\ No newline at end of file
This diff is collapsed.
module.exports = { module.exports = {
css(data) { css(data) {
const style = document.createElement('style'); const style = document.createElement('style');
style.innerHTML = data; style.innerHTML = data;
document.head.appendChild(style); document.head.appendChild(style);
} }
} }
\ No newline at end of file
const _gltchrr = require('gltchrr'); const _gltchrr = require('gltchrr');
const kwm = require('kwm'); const kwm = require('kwm');
const { Window } = kwm; const { Window } = kwm;
function GltchrrWindow(attr) { function GltchrrWindow(attr) {
const me = attr.instance; const me = attr.instance;
const gltchrr = me.gltchrr; const gltchrr = me.gltchrr;
const options = attr.options; const options = attr.options;
const controls = {}; const controls = {};
function updateBase(e) { function updateBase(e) {
controls.intesity_echo.innerText = gltchrr.parameters.base = e.target.value / 100; controls.intesity_echo.innerText = gltchrr.parameters.base = e.target.value / 100;
me.onupdate(); me.onupdate();
} }
function updateDecay(e) { function updateDecay(e) {
controls.decay_echo.innerText = gltchrr.parameters.decayTo = e.target.value / 100; controls.decay_echo.innerText = gltchrr.parameters.decayTo = e.target.value / 100;
me.onupdate(); me.onupdate();
} }
function updateMode(e) { function updateMode(e) {
gltchrr.state.mode = e.target.value; gltchrr.state.mode = e.target.value;
me.onupdate(); me.onupdate();
} }
return <Window title="gltchrr config" x={options.x || 32} y={options.y || 128} height="348"> return <Window title="gltchrr config" x={options.x || 32} y={options.y || 128} height="348">
<label>enabled? <input type="checkbox" checked={gltchrr.state.enabled} onchange={e => { gltchrr.state.enabled = e.target.checked; me.onupdate(); }} /></label><br /> <label>enabled? <input type="checkbox" checked={gltchrr.state.enabled} onchange={e => { gltchrr.state.enabled = e.target.checked; me.onupdate(); }} /></label><br />
<br /> <br />
<label>intensity {controls.intesity_echo = <span style="float:right;">{gltchrr.parameters.base}</span>} <label>intensity {controls.intesity_echo = <span style="float:right;">{gltchrr.parameters.base}</span>}
<input type="range" min="0" max="700" value={gltchrr.parameters.base * 100} oninput={updateBase} /> <input type="range" min="0" max="700" value={gltchrr.parameters.base * 100} oninput={updateBase} />
</label><br /> </label><br />
<br /> <br />
<label>mode</label><br /> <label>mode</label><br />
{Object.keys(gltchrr.preprocess) {Object.keys(gltchrr.preprocess)
.map(k => [<label><input type="radio" name="mode" value={k} checked={gltchrr.state.mode === k} onchange={updateMode} /> {k}</label>, <br />]) .map(k => [<label><input type="radio" name="mode" value={k} checked={gltchrr.state.mode === k} onchange={updateMode} /> {k}</label>, <br />])
.reduce((p, c) => p.concat(c))} .reduce((p, c) => p.concat(c))}
<br /> <br />
<label>override text <label>override text
<input type="text" value={gltchrr.parameters.text} oninput={e => { gltchrr.parameters.text = e.target.value; me.onupdate(); }} /> <input type="text" value={gltchrr.parameters.text} oninput={e => { gltchrr.parameters.text = e.target.value; me.onupdate(); }} />
</label><br /> </label><br />
<br /> <br />
<label>decay? <input type="checkbox" checked={gltchrr.state.decay} onchange={e => { gltchrr.state.decay = e.target.checked; me.onupdate(); }} /></label><br /> <label>decay? <input type="checkbox" checked={gltchrr.state.decay} onchange={e => { gltchrr.state.decay = e.target.checked; me.onupdate(); }} /></label><br />
<label>target intensity {controls.decay_echo = <span style="float:right;">{gltchrr.parameters.decayTo}</span>} <label>target intensity {controls.decay_echo = <span style="float:right;">{gltchrr.parameters.decayTo}</span>}
<input type="range" min="0" max="700" value={gltchrr.parameters.decayTo * 100} oninput={updateDecay} /> <input type="range" min="0" max="700" value={gltchrr.parameters.decayTo * 100} oninput={updateDecay} />
</label> </label>
</Window> </Window>
} }
module.exports = function (options) { module.exports = function (options) {
options = options || {}; `` options = options || {}; ``
this.gltchrr = new _gltchrr(); this.gltchrr = new _gltchrr();
this.onupdate = () => { }; this.onupdate = () => { };
this.show = function () { this.show = function () {
if (!this.window) { if (!this.window) {
kwm.init(); kwm.init();
this.window = <GltchrrWindow instance={this} options={options} /> this.window = <GltchrrWindow instance={this} options={options} />
kwm.append(this.window); kwm.append(this.window);
} }
else { else {
this.window.style.display = ''; this.window.style.display = '';
} }
}; };
this.hide = function () { this.hide = function () {
this.window.style.display = 'none'; this.window.style.display = 'none';
}; };
} }
\ No newline at end of file
{ {
"friendly_name": "gltchrr", "friendly_name": "gltchrr",
"depends": [ "depends": [
"nanopack_kwm" "nanopack_kwm"
], ],
"modules": { "modules": {
"inject": { "inject": {
"filename": "modules/inject.js" "filename": "modules/inject.js"
}, },
"@index": { "@index": {
"filename": "modules/gltchrr.js" "filename": "modules/gltchrr.js"
}, },
"ui": { "ui": {
"filename": "modules/ui.jsx", "filename": "modules/ui.jsx",
"type": "jsx" "type": "jsx"
} }
} }
} }
\ No newline at end of file
const ui = new (require('gltchrr!ui'))(); const ui = new (require('gltchrr!ui'))();
const gltchrr = ui.gltchrr; const gltchrr = ui.gltchrr;
// expose the control functions through window.gltchrr // expose the control functions through window.gltchrr
window.gltchrr = ui.gltchrr.control; window.gltchrr = ui.gltchrr.control;
var showing = false; var showing = false;
module.exports = { module.exports = {
selfbot: { selfbot: {
callbacks: [gltchrr.processText], callbacks: [gltchrr.processText],
commands: { commands: {
gltoggle: { gltoggle: {
description: 'Toggle showing the gltchrr UI', description: 'Toggle showing the gltchrr UI',
action: m => { action: m => {
if (showing) { if (showing) {
ui.hide(); ui.hide();
showing = false; showing = false;
} }
else { else {
ui.show(); ui.show();
showing = true; showing = true;
} }
m.content = ''; m.content = '';
} }
} }
} }
} }
}; };
\ No newline at end of file
{ {
"friendly_name": "gltchrr_discord", "friendly_name": "gltchrr_discord",
"depends": [ "depends": [
"../..", "../..",
"nanopack_tsundiscord" "nanopack_tsundiscord"
], ],
"modules": { "modules": {
"@index": { "@index": {
"filename": "hook.js", "filename": "hook.js",
"doCallbacks": true "doCallbacks": true
} }
}, },
"main": [ "main": [
"gltchrr_discord" "gltchrr_discord"
] ]
} }
\ No newline at end of file
const ui = new (require('gltchrr!ui'))(); const ui = new (require('gltchrr!ui'))();
const gltchrr = ui.gltchrr; const gltchrr = ui.gltchrr;
// expose the control functions through window.gltchrr // expose the control functions through window.gltchrr
window.gltchrr = ui.gltchrr.control; window.gltchrr = ui.gltchrr.control;
module.exports = { module.exports = {
ready() { ready() {
ui.show(); ui.show();
}, },
cascade: { cascade: {
postCtor: [ postCtor: [
{ {
condition: info => condition: info =>
info.module.exports && info.module.exports &&
info.module.exports.default && info.module.exports.default &&
info.module.exports.default.postStatus && info.module.exports.default.postStatus &&
info.module.exports.default.register, info.module.exports.default.register,
callback: info => { callback: info => {
const _postStatus = info.module.exports.default.postStatus; const _postStatus = info.module.exports.default.postStatus;
info.module.exports.default.postStatus = e => (e.status = gltchrr.processText(e.status), _postStatus(e)); info.module.exports.default.postStatus = e => (e.status = gltchrr.processText(e.status), _postStatus(e));
} }
} }
] ]
} }
}; };
\ No newline at end of file
{ {
"friendly_name": "gltchrr_pleromafe", "friendly_name": "gltchrr_pleromafe",
"depends": [ "depends": [
"../..", "../..",
"nanopack_cascade" "nanopack_cascade"
], ],
"modules": { "modules": {
"@index": { "@index": {
"filename": "hook.js", "filename": "hook.js",
"doCallbacks": true "doCallbacks": true
} }
}, },
"main": [ "main": [
"gltchrr_pleromafe" "gltchrr_pleromafe"
] ]
} }
\ No newline at end of file
const ui = new (require('gltchrr!ui'))(); const ui = new (require('gltchrr!ui'))();
const gltchrr = ui.gltchrr; const gltchrr = ui.gltchrr;
// expose the control functions through window.gltchrr // expose the control functions through window.gltchrr
window.gltchrr = ui.gltchrr.control; window.gltchrr = ui.gltchrr.control;
window.onload = () => { window.onload = () => {
ui.show(); ui.show();
const __send = Meteor.connection._send; const __send = Meteor.connection._send;
Meteor.connection._send = e => { Meteor.connection._send = e => {
if (e.msg === 'method') if (e.msg === 'method')
switch (e.method) { switch (e.method) {
case 'sendMessage': case 'sendMessage':
e.params[0].msg = gltchrr.processText(e.params[0].msg); e.params[0].msg = gltchrr.processText(e.params[0].msg);
break; break;
} }
__send.apply(Meteor.connection, [e]); __send.apply(Meteor.connection, [e]);
} }
}; };
\ No newline at end of file
{ {
"friendly_name": "gltchrr_rocketchat", "friendly_name": "gltchrr_rocketchat",
"depends": [ "depends": [
"../.." "../.."
], ],
"modules": { "modules": {
"@index": { "@index": {
"filename": "hook.js" "filename": "hook.js"
} }
}, },
"main": [ "main": [
"gltchrr_rocketchat" "gltchrr_rocketchat"
] ]
} }
\ No newline at end of file
{ {
"friendly_name": "gltchrr_standalone", "friendly_name": "gltchrr_standalone",
"depends": [ "depends": [
"../.." "../.."
], ],
"modules": { "modules": {
"index.css": { "index.css": {
"filename": "standalone.css", "filename": "standalone.css",
"type": "css" "type": "css"
}, },
"@index": { "@index": {
"filename": "standalone.jsx", "filename": "standalone.jsx",
"type": "jsx" "type": "jsx"
} }
}, },
"main": [ "main": [
"gltchrr_standalone" "gltchrr_standalone"
] ]
} }
\ No newline at end of file
.s_box { .s_box {
word-wrap: break-word; word-wrap: break-word;
display: block; display: block;
margin-bottom: 4px; margin-bottom: 4px;
} }
\ No newline at end of file
const kwm = require('kwm'); const kwm = require('kwm');
const { Window } = kwm; const { Window } = kwm;
const ui = new (require('gltchrr!ui'))({ const ui = new (require('gltchrr!ui'))({
x: 512 + 8 * 2, x: 512 + 8 * 2,
y: 8 y: 8
}); });
const gltchrr = ui.gltchrr; const gltchrr = ui.gltchrr;
window.onload = () => { window.onload = () => {
var input, result; var input, result;
ui.onupdate = e => result.value = gltchrr.processText(input.value); ui.onupdate = e => result.value = gltchrr.processText(input.value);
const win = <Window title="gltchrr" width="512" height="512" x="8" y="8" resizable> const win = <Window title="gltchrr" width="512" height="512" x="8" y="8" resizable>
{input = <textarea style="word-wrap: break-word; display: block; margin-bottom: 4px;" placeholder="put text in" oninput={ui.onupdate} />} {input = <textarea style="word-wrap: break-word; display: block; margin-bottom: 4px;" placeholder="put text in" oninput={ui.onupdate} />}
{result = <textarea style="word-wrap: break-word; display: block;" placeholder="g̨̰̓̅̽et gçgglitch ou̜̬̞̓̒t" readonly />} {result = <textarea style="word-wrap: break-word; display: block;" placeholder="g̨̰̓̅̽et gçgglitch ou̜̬̞̓̒t" readonly />}
</Window> </Window>
kwm.append(win); kwm.append(win);
// css is too hard // css is too hard
(win.onresize = () => Array.prototype.forEach.call( (win.onresize = () => Array.prototype.forEach.call(
win.kwm.parts.body.children, win.kwm.parts.body.children,
x => x.style.height = (win.offsetHeight - win.kwm.parts.header.offsetHeight - 16) / 2 + 'px' x => x.style.height = (win.offsetHeight - win.kwm.parts.header.offsetHeight - 16) / 2 + 'px'
))(); ))();
gltchrr.state.enabled = true; gltchrr.state.enabled = true;
ui.show(); ui.show();
} }
\ No newline at end of file
module.exports = { module.exports = {
finalize: true, finalize: true,
minify: true, minify: true,
header: `// ==UserScript== header: `// ==UserScript==
// @name gltchrr for Discord // @name gltchrr for Discord
// @namespace http://akari.vii/ // @namespace http://akari.vii/
// @version 1.2.5 // @version 1.2.5
// @description g̴̐͋litcc̣̟̭̿cch // @description g̴̐͋litcc̣̟̭̿cch
// @author lp0 and nocebo // @author lp0 and nocebo
// @match https://discordapp.com/* // @match https://discordapp.com/*
// @grant none // @grant none
// @run-at document-start // @run-at document-start
// ==/UserScript== // ==/UserScript==
`, `,
packages: [ packages: [
'./packages/discord' './packages/discord'
], ],
output: 'gltchrr_discord.userscript.js' output: 'gltchrr_discord.userscript.js'
}; };
\ No newline at end of file
module.exports = { module.exports = {
finalize: true, finalize: true,
minify: true, minify: true,
header: `// ==UserScript== header: `// ==UserScript==
// @name gltchrr for Pleroma // @name gltchrr for Pleroma
// @namespace http://akari.vii/ // @namespace http://akari.vii/
// @version 1.2.5 // @version 1.2.5
// @description g̴̐͋litcc̣̟̭̿cch // @description g̴̐͋litcc̣̟̭̿cch
// @author lp0 and nocebo // @author lp0 and nocebo
// @match https://girldick.icu/* // @match https://girldick.icu/*
// @grant none // @grant none
// @run-at document-start // @run-at document-start
// ==/UserScript== // ==/UserScript==
`, `,
packages: [ packages: [
'./packages/pleromafe' './packages/pleromafe'
], ],
output: 'gltchrr_pleromafe.userscript.js' output: 'gltchrr_pleromafe.userscript.js'
}; };
\ No newline at end of file
module.exports = { module.exports = {
finalize: true, finalize: true,
minify: true, minify: true,
header: `// ==UserScript== header: `// ==UserScript==
// @name gltchrr for rocket.chat // @name gltchrr for rocket.chat
// @namespace http://akari.vii/ // @namespace http://akari.vii/
// @version 1.2.5 // @version 1.2.5
// @description g̴̐͋litcc̣̟̭̿cch // @description g̴̐͋litcc̣̟̭̿cch
// @author lp0 and nocebo // @author lp0 and nocebo
// @match https://meow.natalie.ee/* // @match https://meow.natalie.ee/*
// @grant none // @grant none
// @run-at document-start // @run-at document-start
// ==/UserScript== // ==/UserScript==
`, `,
packages: [ packages: [
'./packages/rocketchat' './packages/rocketchat'
], ],
output: 'gltchrr_rocketchat.userscript.js' output: 'gltchrr_rocketchat.userscript.js'
}; };
\ No newline at end of file
{ {
"finalize": true, "finalize": true,
"minify": true, "minify": true,
"header": "<!DOCTYPE HTML><html><head><meta charset=\"utf-8\"><script>", "header": "<!DOCTYPE HTML><html><head><meta charset=\"utf-8\"><script>",
"footer": "</script></head><body><noscript><h1>this page requires javascript, sorry!</h1></noscript></body></html>", "footer": "</script></head><body><noscript><h1>this page requires javascript, sorry!</h1></noscript></body></html>",
"packages": [ "packages": [
"./packages/standalone" "./packages/standalone"
], ],
"output": "gltchrr.html" "output": "gltchrr.html"
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment