Skip to content

Instantly share code, notes, and snippets.

View cristicretu's full-sized avatar
🚀
lock in

Cristian Crețu cristicretu

🚀
lock in
View GitHub Profile
@linuz90
linuz90 / scroll-masking.css
Created November 4, 2025 14:23
Tailwind Scroll Masking Utils
/* ----------------------------- Scroll Masking ----------------------------- */
/* Custom properties for scroll-driven mask animations */
@property --mask-up-fade {
syntax: "<length>";
inherits: false;
initial-value: 0;
}
@property --mask-down-fade {
import Combine
import SwiftUI
struct CountdownView: View {
@State private var countdown: Int = 15 * 60
@State private var displayedTime = "15:00"
@State private var countdownTimer: AnyCancellable?
@State private var isShowingLaurels = false
@State private var isShowingExpiry = false
@realvjy
realvjy / ChoasLinesShader.metal
Last active March 7, 2026 10:41
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
import SwiftUI
struct ChatGPTTextField: View {
// MARK: - State
/// State to hold our `TextField` query.
@State private var queryMessage: String = ""
/// Focus state for our `TextField`.
@UdaraJay
UdaraJay / Apps.jsx
Created October 15, 2023 14:43
Animated card stack
import styles from './Apps.module.scss';
import { useEffect, useState } from 'react';
import Link from 'next/link';
const APPS = [
{
title: 'APP',
hero: 'Lorem ipsum dolor sit amet',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do.',
struct Overlay: View {
@State private var showLive = true
@State private var isAnimationSlowed = false
var body: some View {
VStack {
Spacer()
HStack {
Spacer()
import SwiftUI
import PlaygroundSupport
// NOTE: this example currently only works with US-based coordinates
// constants
// New York
let latitude = 40.709335
let longitude = -73.956558
@smhanov
smhanov / OpenType.ts
Last active February 18, 2026 23:17
Here is my implementation of a TrueType font reader in Typescript. You can read a font directly from an ArrayBuffer, and then call drawText() to draw it. See my article http://stevehanov.ca/blog/index.php?id=143. The second file, OpenType.ts is the same thing but it handles more TrueType files. It is also more coplex
// To see this run, you first stub out these imports. Then put the file in a Uint8Array.
// let slice = new Slice(array);
// let font = new OTFFont(slice);
// Then you can call methods like font.drawText(canvasContext, )
//
//
import { ICanvasContext } from "./ICanvasContext"
import { log as Log } from "./log"
const log = Log.create("OPENTYPE");
@davidpiesse
davidpiesse / tailwind_md_all_colours.js
Last active February 25, 2025 16:31
A colour set for Tailwind CSS that include all Material Design Colours, shades, accents and contrast colours
// https://davidpiesse.github.io/tailwind-md-colours/
//
//Notes
//
//All colours are generated from Material Design Docs
//Colours have a base, a set of shades (50-900) accent colours
//In addition a companion set of contrast colours are included for colouring text / icons
// Example usage
// class="w-full bg-red-600 text-red-600-constrast"