Skip to content

Instantly share code, notes, and snippets.

@toybreaker
toybreaker / index.html
Created May 12, 2025 16:26
untitled.brian
<!--
Sections animate in and out on scroll. Scroll up or down and the sections will wrap around after hitting the start or end. Uses GSAP for the animations.
-->
<header>
<div>Animated</div>
<div><a href="https://codepen.io/BrianCross/pen/PoWapLP">Originalhere</a></div>
</header>
<section class="first">
<div class="outer">
@toybreaker
toybreaker / don-t-flip-keep-going.markdown
Created May 12, 2025 13:58
Don't Flip, keep going!

Don't Flip, keep going!

simple flip on click with plain vanilla javascript

A Pen by rokma on CodePen.

License.

@toybreaker
toybreaker / index.html
Created May 12, 2025 08:54
TOTONTO Turtle
<div class="wrapper">
<div class="turtle">
<div class="leg"></div>
<div class="body"></div>
<div class="head"></div>
</div>
</div>
@toybreaker
toybreaker / Mouse Searchlight Circle.md
Last active April 21, 2025 12:05
Mouse Searchlight Circle
@toybreaker
toybreaker / css-automatic-wcag-contrast-font-color-depending-on-element-background.markdown
Last active September 18, 2023 12:27
CSS Automatic WCAG contrast font-color depending on element background

PRETTY COOL CSS Automatic WCAG contrast font-color depending on element background

This pen is based on a talk by Dag-Inge Aas & Ida Aalen at CSSconf EU 2018. They implemented automatic contrast generation and secondary colors from a user-selectable base color, using javascript and the "color" NPM package. I achieved the same effect with just a couple lines of pure CSS :)

With the theme based on RGB color declarations, and having each base color as a CSS Custom Property, I apply some Luma (perceived brightness) calcs in order to style the text as black or white.

Also generates an automatic secondary color via filter:hue-rotate, and applies a darkened border if the background luma is too high to improve visibility.

@toybreaker
toybreaker / index.html
Created July 13, 2023 05:39
Turtle Lost
<div class="wrapper">
<div class="turtle">
<div class="leg"></div>
<div class="body"></div>
<div class="head"></div>
</div>
</div>
@toybreaker
toybreaker / index.html
Created July 12, 2023 03:00
Randomized Circle Groups With Background Lines
<svg
viewBox="0 0 1000 1000"
width="1000"
height="1000"
role="img"
>
<title>
A geometric pattern composed of nested circles and squiggly lines.
Inspired by Legends of Zelda: Tears of the Kingdom
</title>
@toybreaker
toybreaker / index.html
Created April 22, 2023 07:24
Squiggly Text
<div class="test" contenteditable>
Squiggly Text
<p class="small">– with – <p/>
SVG Filters
<p class="small">(you can even edit this text)</p>
<p class="smaller">(only tested on Chrome so far)</p>
</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
@toybreaker
toybreaker / animated-svg-turbulence-filter.markdown
Created April 22, 2023 06:11
Animated SVG Turbulence Filter