Check out this picture and toggle dark mode or light mode on your GitHub profile to see it change!
Click the button and you'll seeeeeee:
(I generated this button with this project here, try it out!)
If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:
html {
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
font-size: 1.3em;
max-width: 40rem;
padding: 2rem;
margin: auto;
line-height: 1.5rem;
Let's make it so you can record a demo once in dark mode, and then convert that into light mode, in a single command!
FFmpeg is the brains behind pretty much all video editing softwares. It's a really awesome tool beyond just this use case!
You can go to their downloads page to clone the repo or go into details about how it runs, but here's some shortcuts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import { useState, useEffect, useRef } from "react"; | |
function SimpleRecordButton() { | |
const [isRecording, setIsRecording] = useState(false); | |
const [audioStream, setAudioStream] = useState(null); | |
const [mediaRecorder, setMediaRecorder] = useState(null); | |
const [audioBlob, setAudioBlob] = useState(null); | |
const [recordingTime, setRecordingTime] = useState(0); | |
const timerRef = useRef(null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateLutFilter(hexColorsToExclude) { | |
function hexToRgb(hex) { | |
const bigint = parseInt(hex, 16); | |
const r = (bigint >> 16) & 255; | |
const g = (bigint >> 8) & 255; | |
const b = bigint & 255; | |
return { r, g, b }; | |
} | |
let lutFilter = "lutrgb="; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
# Pretty Feed | |
Styles an RSS/Atom feed, making it friendly for humans viewers, and adds a link | |
to aboutfeeds.com for new user onboarding. See it in action: | |
https://interconnected.org/home/feed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function mergeRefs(refs) { | |
return (value) => { | |
refs.forEach((ref) => { | |
if (typeof ref === "function") { | |
ref(value); | |
} else if (ref != null) { | |
ref.current = value; | |
} | |
}); | |
}; |
NewerOlder