This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Configuration file reader module. Takes an absolute file path and the boolean watch as arguments. | |
* filePath is expected to be the path to a JSON file (with the .json extension). | |
* watch is optional and defaults to false. If set to true, the config file will be watched by fs and any changes made to it will be automatically reflected on the module instance. | |
Returns an object: | |
* filePath: The file currently in use. | |
* watching: Boolean, indicate if the config file is being monitored for changes. | |
* config: Object containg the parsed data of the config file. | |
* parseFile(path, watch): Parse a config file. If you specify a new file, set watch to true to start watching it for changes, too. As always, watch defaults to false. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Color = require('color'); | |
const colorifyTarget = Color("#bee6c1"); | |
let original = require('fs').readFileSync("original.css", {encoding: "utf-8"}); | |
console.log(original); | |
let colorified = original.replace(/(#{1}[0-g]{6})+/ig, (match) => { | |
console.log(match); | |
return Color(match).grayscale().mix(colorifyTarget, 0.3).hex(); // Edit colorify options here | |
}); | |
console.log(colorified); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(() => { | |
let update_form_listeners = () => { | |
// Always check that the onsubmit attribute ends by return false; otherwise the page will reload | |
$("form[onsubmit] input:last-of-type").each((index, element) => { | |
if ($(element).parents('form').attr('onsubmit').substr(-13) !== 'return false;') { | |
$(element).parents('form').attr('onsubmit', $(element).parents('form').attr('onsubmit')+'return false;'); | |
} | |
}); | |
$("form[onsubmit] input:last-of-type").keypress((e) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Déganimation</title> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> | |
<script> | |
window.cursorPos = {x: 0, y: 0}; |
NewerOlder