It's 2024. You should use tsup instead of this.
🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
✨ .d.ts bundle + type-checking
| import json | |
| import os | |
| import time | |
| import webbrowser | |
| import sys | |
| import re | |
| def handleWindows(extra_seconds): | |
| print("OS : Windows") |
| // <DIR>/src/hooks/useLocoScroll.js | |
| import gsap from "gsap"; | |
| import ScrollTrigger from "gsap/ScrollTrigger"; | |
| import { useEffect } from "react"; | |
| import LocomotiveScroll from "locomotive-scroll"; | |
| // REPLACE THIS WITH YOUR STYLES | |
| import "@styles/locomotive-scroll.scss"; |
It's 2024. You should use tsup instead of this.
🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
✨ .d.ts bundle + type-checking
I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:
const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing| Chapter 02. Your First Step with WebGL<br> | |
| ch02/HelloCanvas: https://jsfiddle.net/8Observer8/2gky294r/<br> | |
| ch02/HelloPoint1: https://jsfiddle.net/8Observer8/cc72u1u5/<br> | |
| ch02/HelloPoint2: https://jsfiddle.net/8Observer8/uxw657ud/<br> | |
| ch02/ClickedPoints: https://jsfiddle.net/8Observer8/xf4fnc0o/<br> | |
| ch02/ColoredPoints: https://jsfiddle.net/8Observer8/gkkmnpga/<br> | |
| Chapter 03. Drawing and Transforming Triangles<br> | |
| ch03/MultiPoint: https://jsfiddle.net/8Observer8/cty1120m/<br> | |
| ch03/HelloTriangle: https://jsfiddle.net/8Observer8/wk4sksnw/<br> |
| WebGl courses + tutorials | |
| --------------------------------------- | |
| 1. Great GLSL course | |
| https://thebookofshaders.com/ | |
| https://thebookofshaders.com/?lan=ru (russian language) | |
| 2. WebGl basics | |
| https://webglfundamentals.org | |
| https://webglfundamentals.org/webgl/lessons/ru (russian language) |
| /* | |
| To use it, simply declare: | |
| `const post = new PostFX(rendering);` | |
| Then on update, instead of: | |
| `rendering.render(scene, camera);` | |
| replace with: | |
| `post.render(scene, camera);` | |
| */ | |
| import { |
| /** | |
| * Will gracefuly scroll the page | |
| * This function will scroll the page using | |
| * an `ease-in-out` effect. | |
| * | |
| * You can use it to scroll to a given element, as well. | |
| * To do so, pass the element instead of a number as the position. | |
| * Optionally, you can pass a `queryString` for an element selector. | |
| * | |
| * The default duration is half a second (500ms) |
| const spy = jest.fn(); // or `jasmine.createSpy()` | |
| const testWidth = 420; | |
| beforeAll(() => { | |
| window.addEventListener('resize', spy); | |
| }); | |
| it('does not fire resize event by default', () => { | |
| expect(spy).not.toHaveBeenCalled(); | |
| expect(window.innerWidth).not.toBe(testWidth); |