Skip to content

Instantly share code, notes, and snippets.

View Darth-Knoppix's full-sized avatar
:octocat:
All praise the octocat

Seth Corker Darth-Knoppix

:octocat:
All praise the octocat
View GitHub Profile
@Darth-Knoppix
Darth-Knoppix / tailwind-4-colors.json
Created June 26, 2024 20:48
Tailwind 3.4 colors formatted for the sketch-json-color-palette-importer plugin
{
"core": { "black": "#000", "white": "#fff" },
"amber": {
"100": "#fef3c7",
"200": "#fde68a",
"300": "#fcd34d",
"400": "#fbbf24",
"50": "#fffbeb",
"500": "#f59e0b",
"600": "#d97706",
@Darth-Knoppix
Darth-Knoppix / coffee-machine-promises.js
Created January 19, 2022 10:05
Basic promises in JS example
const TIME_TO_BREW = 500 // ms
// Make an espresso, promise to give it back when it's done
function coffeeMachine(id) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (id % 2 === 0) {
resolve(id + ": espresso")
} else {
reject(id + ": terrible espresso")
@Darth-Knoppix
Darth-Knoppix / GradientText.tsx
Created January 4, 2021 09:36
Text gradient in Framer (Code Component)
import * as React from "react"
import { Frame, addPropertyControls, ControlType } from "framer"
/*
Attempt at getting gradients to work in Framer, using an override doesn't work as expected due to the output differing.
This is a workaround until this is added to Framer directly
*/
export function GradientText({ text, height }) {
return (
@Darth-Knoppix
Darth-Knoppix / index-title.js
Created November 16, 2020 09:58
Page Transitions in Next.js with Framer Motion: Index title
<motion.h1
initial={{ scale: 0.8, opacity: 0 }}
animate={{ scale: 1, opacity: 1 }}
className="title has-text-weight-bold is-1 is-size-2-mobile is-spaced"
layoutId="title"
>
@Darth-Knoppix
Darth-Knoppix / index-subtitle.js
Created November 16, 2020 09:57
Page Transitions in Next.js with Framer Motion: index p
<motion.p
className="subtitle"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.2 }}
>
@Darth-Knoppix
Darth-Knoppix / image-wrapper.js
Created November 16, 2020 09:56
Page Transitions in Next.js with Framer Motion: Image wrapper
<motion.figure className="image" layoutId="image">
<Image src="/assets/task.png" layout="responsive" width={780} height={501} />
</motion.figure>
@Darth-Knoppix
Darth-Knoppix / after-h1.js
Created November 16, 2020 09:55
Page Transitions in Next.js with Framer Motion: H1 After
<motion.h1
className="title has-text-weight-bold is-1 is-size-2-mobile is-spaced"
layoutId="title"
>
The only Todo App you'll ever need
</motion.h1>
@Darth-Knoppix
Darth-Knoppix / before-h1.js
Last active November 16, 2020 09:54
Page Transitions in Next.js with Framer Motion: H1 before
<h1 className="title has-text-weight-bold is-1 is-size-2-mobile is-spaced">
The only Todo App you'll ever need
</h1>
@Darth-Knoppix
Darth-Knoppix / _app.js
Created November 16, 2020 09:52
Page Transitions in Next.js with Framer Motion: Next.js _app
import "../styles/theme.sass"
import "@fortawesome/fontawesome-free/css/all.css"
import { AnimateSharedLayout } from "framer-motion"
function MyApp({ Component, pageProps }) {
return (
<AnimateSharedLayout>
<Component {...pageProps} />
</AnimateSharedLayout>
)
}
.expanded {
width: 10rem;
height: 10rem;
background-color: navy;
position: relative;
left: -100%;
top: 150%;
}
.compact {