Set localStorage
Store an array of surfer names in localStorage as a JSON string.
By Jared Malan
Bind function to window
Defines an empty global function doSomethingInAnotherFile.
By Jared Malan
Copy to Clipboard
Copy text to clipboard on button click with visual feedback and console log.
By Jared Malan
Hide scrollbars
CSS class to hide scrollbars
By Jared Malan
Basic scrollTrigger setup
Animate elements based on scroll position using GSAP and ScrollTrigger.
By Digipop
Load All CMS Items
This JavaScript code parses and displays CMS items from a webpage, storing them in an array and rendering them in a specified div.
By Jared Malan
Animated American Flag
Render and animate an American flag on a canvas with dynamic waving effects.
By Jared Malan
Navbar color change depending on hovered section
Dynamically update element colors on scroll based on visible section attributes.
By Digipop
Rive Instance
This code creates a new Rive animation, sets its properties, and starts playing it when it's loaded.
By Jeff McAvoy
Click Something Based on ID in URL
Automatically triggers a click on an element if URL hash matches "#example".
By Corey Moen
Currency to Number
Convert currency string to number by removing non-digit characters and parsing to float. Throws error for invalid input.
By Jared Malan
Richtext Reset
Removes top margin of the first and bottom margin of the last child elements in a rich text container.
By Jared Malan
Rive Input - Update Number
This code lets you update the value of a Rive number input variable.
By Jeff McAvoy
Filter Out Selection
Filter array elements matching button text on button click.
By Jared Malan
Validation - Website
Validates URLs using regex and handles validation on input blur.
By Jared Malan
Number to Currency
Formats a string input as US dollar currency without decimal places.
By Jared Malan
Improved Font Rendering
CSS for font smoothing, text rendering, and scroll behavior on the body element.
By Jared Malan
Fetch - Get
A JavaScript code snippet that fetches data from a URL, converts the response to JSON, and logs the data or any error to the console.
By Jared Malan