This file contains hidden or 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
| { | |
| "name": "rose_pine", | |
| "schemaVersion": 1, | |
| "colors": { | |
| "background": { "hex": "#232137", "palette": 234 }, | |
| "foreground": { "hex": "#908caa", "palette": 254 }, | |
| "focused_border": { "hex": "#eb6f92", "palette": 160 }, | |
| "text_focused": { "hex": "#ebbcba", "palette": 160 }, | |
| "text_active": { "hex": "#f6c177", "palette": 64 }, | |
| "text_disabled": { "hex": "#908caa", "palette": 245 }, |
This file contains hidden or 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
| { | |
| "name": "poimandres", | |
| "schemaVersion": 1, | |
| "colors": { | |
| "background": { | |
| "hex": "#1b1e28", | |
| "palette": 235 | |
| }, | |
| "foreground": { | |
| "hex": "#7f8bbc", |
This file contains hidden or 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
| export function trapFocus(node) { | |
| const previous = document.activeElement; | |
| function focusable() { | |
| return Array.from(node.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')); | |
| } | |
| function handleKeydown(event) { | |
| if (event.key !== 'Tab') return; |
This file contains hidden or 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 createStoreImpl = (createState) => { | |
| let state; | |
| const listeners = /* @__PURE__ */ new Set(); | |
| const setState = (partial, replace) => { | |
| const nextState = typeof partial === "function" ? partial(state) : partial; | |
| if (!Object.is(nextState, state)) { | |
| const previousState = state; | |
| state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState); | |
| listeners.forEach((listener) => listener(state, previousState)); |
This file contains hidden or 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
| /** | |
| * Limit OrbitControls pan | |
| */ | |
| const controls = useRef(); | |
| const minPan = new THREE.Vector3(-2, 1, 0); | |
| const maxPan = new THREE.Vector3(2, -1, 0); | |
| useEffect(() => { | |
| const _v = new THREE.Vector3(); |
This file contains hidden or 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
| float map(float value, float low1, float high1, float low2, float high2) { | |
| return low2 + (value - low1) * (high2 - low2) / (high1 - low1); | |
| } |
This file contains hidden or 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
| // Hex to RGB | |
| // e.g. vec3 rgbBlue = hexToRGB(0xD0F5F7); | |
| vec3 hexToRGB(int h) { | |
| float rValue = float(h / 256 / 256); | |
| float gValue = float(h / 256 - int(rValue * 256.0)); | |
| float bValue = float(h - int(rValue * 256.0 * 256.0) - int(gValue * 256.0)); | |
| return vec3(rValue / 255.0, gValue / 255.0, bValue / 255.0); | |
| } |
This file contains hidden or 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
| /** | |
| * A simple parallax plugin for Vue | |
| * Add the v-parallax directive to elements you want to... parallaxify. | |
| * Directive argument should be an object with single argument, 'target' | |
| * Target specifies the final offset amount (in px) for the element | |
| * | |
| * For example: | |
| * | |
| * <my-element v-parallax="{ target: -500 }"> | |
| */ |
This file contains hidden or 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
| /** | |
| * Returns the element height including margins | |
| * @param element - element | |
| * @returns {number} | |
| */ | |
| function outerHeight(element) { | |
| const height = element.offsetHeight, | |
| style = window.getComputedStyle(element) | |
| return ['top', 'bottom'] |
This file contains hidden or 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
| /** | |
| * From: https://stackoverflow.com/a/23529943 | |
| * | |
| * Add or update a query string parameter. If no URI is given, we use the current | |
| * window.location.href value for the URI. | |
| * | |
| * Based on the DOM URL parser described here: | |
| * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ | |
| * | |
| * @param (string) uri Optional: The URI to add or update a parameter in |
NewerOlder