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

line endings again, what a fucking mess

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