Skip to content

Instantly share code, notes, and snippets.

float aafract(float x) { // --- antialiased fract
// https://www.shadertoy.com/view/wtjGzt
float v = fract(x),
w = fwidth(x); // NB: x must not be discontinuous or factor discont out
return v < 1.-w ? v/(1.-w) : (1.-v)/w; // replace right step by down slope (-> chainsaw is continuous).
// shortened slope : added downslope near v=1
}
float aafract2(float x) { // --- antialiased fract
@opheliagame
opheliagame / sign.json
Created January 21, 2022 10:47
console signature πŸŽ‰
{
"sign": [
"%c - hand made by - \n%cβ––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––β––\n%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––\n%cβ––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––%cβ–š%cβ––β––\n%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–šβ–š%cβ––%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ––β––β––%cβ–š%cβ––%cβ–š%cβ––\n%cβ––β––β––β––β––β––β––β––β––%cβ–šβ–š%cβ––β––β––β––β––β•΄β––β––%c▝%cβ–‡%cβ–Ž%cβ–š%cβ––β––β––β––%cβ–šβ–š%cβ––β––β––%cβ–ƒ%cβ–ƒ%cβ–‰%cβ––β––β––β––%c▝%cβ–‚%cβ––β––β––β––β––%cβ–š%cβ––β––β––β––%cβ–šβ–š%cβ––β––β––β––%cβ–šβ–š%cβ––β––β––β––%cβ–š%cβ––%cβ–š%cβ––β––β––β––%cβ–š%cβ––β––β––β––β––β––β––β––β––\n%cβ––β––%cβ–š%cβ––%cβ–š%cβ––%cβ–š%cβ–—%cβ–†%cβ–ƒ%cβ–ƒ%c▇▖▝%cβ–š%cβ–‚%cβ–ƒ%cβ––%cβ––%cβ––%c▏%cβ–‡%cβ–ƒ%cβ–š%c▍%cβ–š%cβ–…%c⎽%cβ–„%cβ–‡%cβ––%cβ––β––%cβ–Š%cβ–˜%cβ––%cβ–š%cβ––%cβ–„β––%cβ–‰%cβ––%cβ–š%cβ––%c●%cβ–ƒβ–„%cβ–‡%c▝%cβ–š%cβ–†%cβ–ƒ%cβ–ƒ%cβ–‡%cβ–—%cβ–š%c●%cβ–ƒβ–„%cβ–‡%cβ–Ž%cβ––%cβ–š%cβ–ƒ%cβ•²%cβ–ƒ%c▝%cβ–—%cβ–†
@opheliagame
opheliagame / generative-grid.ts
Last active December 30, 2023 06:37
Typescript classes to make generative css grid using Quadtree
class Point {
x: number
y: number
constructor(x, y) {
this.x = x
this.y = y
}
}
@opheliagame
opheliagame / ccsante-2-0-loading-animation.markdown
Created September 16, 2024 05:16
CCSantΓ© 2.0 loading animation
@opheliagame
opheliagame / easings.js
Created February 1, 2025 09:43
Easing functions from easings.net written in javascript
// functions from easings.net written in javascript
function easeInSine(x) {
return 1 - Math.cos((x * Math.PI) / 2);
}
function easeOutSine(x) {
return Math.sin((x * Math.PI) / 2);
}
@opheliagame
opheliagame / text-layout.js
Last active April 15, 2025 10:27
Creates a text box that renders text inside a box with proper sizing and alignment with #p5js
class TextBox {
/**
* Creates a text box that renders text inside a box with proper sizing and alignment
* @param {Object} options - Configuration options
* @param {Number} options.x - X position of the box
* @param {Number} options.y - Y position of the box
* @param {Number} options.width - Width of the box
* @param {Number} options.height - Height of the box
* @param {Number} options.padding - Padding inside the box (default: 20)
* @param {String} options.fontName - Font to use (default: "Arial")
@opheliagame
opheliagame / AndroidEmulator.md
Created August 1, 2025 09:28 — forked from Try-Parser/AndroidEmulator.md
Running emulator without Android Studio in Windows With Flutter

Android Emulator Setup without Android Studio in Windows with Flutter

First Download the Android SDK Commandline Tool only.

https://developer.android.com/studio/

Goto Download Options

Find Commandline tools only Section