Back Home
TOC Loading..
Keyframes
References
Github Repo
Webflow Cloneable

Animated copy to clipboard button

No items found.

This code makes any element with data-copy-url copy the current page URL when clicked and adds a class to the button for 2.5s. Allowing for some fun confirmation animations with css.

JavaScript

1document.querySelectorAll('[data-copy-url]').forEach(function(copyTriggerElement) {
2  copyTriggerElement.addEventListener('click', function() {
3    navigator.clipboard.writeText(window.location.href).then(function() {
4      copyTriggerElement.classList.add('is-copied');
5      setTimeout(function() {
6        copyTriggerElement.classList.remove('is-copied');
7      }, 2500);
8    });
9  });
10});

HTML Attributes

<button data-copy-url>Copy URL</button>

CSS Animation Example

1[data-copy-url] {
2  transition: all 0.3s ease;
3}
4
5[data-copy-url].is-copied {
6  background-color: #10b981;
7  color: white;
8}
9
10[data-copy-url].is-copied::after {
11  content: " ✓ Copied!";
12}
Writings

How (and why) to add keyboard shortcuts to your Webflow site

A small keyboard shortcut can make a marketing site feel faster, more intentional, and “app-like” with almost no extra design or development

Understanding the FS Attributes API

Since Finsweet released its attributes as open source, I've been dipping in and out to understand how the API works and how it can be used effectively. Here's an explanation of the API methods and properties that I use pretty frequently to open more doors in my projects.

Useful GSAP utilities

A practical, code-heavy dive into GSAP’s utility functions—keyframes, pipe, clamp, normalize, and interpolate—and why they’re so much more than just shortcuts for animation math.

Using Functions as Property Values in GSAP (And Why You Probably Should)

GSAP lets you pass _functions_ as property values. I've known this for a while but never really explored it particularly deeply. Over the last couple of weeks I've been testing, experimenting and getting creative with it to deepen my understanding.

Organising JavaScript in Webflow: Exploring Scalable Patterns

Exploring ways to keep JavaScript modular and maintainable in Webflow — from Slater to GitHub to a custom window.functions pattern. A look at what’s worked (and what hasn’t) while building more scalable websites.

Building a Scroll-Based Image Sequencer with GSAP

An exploration in building a scroll-driven image sequence animation using GSAP and HTML5 canvas. Using Avif file compression with the Avif CLI, hosting strategies (Webflow vs AWS), GSAP and the quirks of working with canvas.