This file contains 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
import axios from 'axios' | |
let mockingEnabled = false | |
const mocks = {} | |
export function addMock(url, data) { | |
mocks[url] = data | |
} |
This file contains 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
This file contains 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
const ytdl = require("ytdl-core"); | |
const express = require("express"); | |
const app = express(); | |
app.get("/", (_req, res) => { | |
res.sendFile(__dirname + "/index.html"); | |
}); | |
// Handler for '/info/:id' endpoint | |
app.get("/info/:id", async (req, res) => { |
This file contains 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
//source: https://tweenpages.vercel.app/docs#componentlevel-animation | |
import React, { useRef, useContext } from "react" | |
import { gsap } from "gsap" | |
import { Box } from "theme-ui" | |
import useIsomorphicLayoutEffect from "./useIsomorphicLayoutEffect" | |
import { TransitionContext } from "../context/TransitionContext" | |
const AnimateInOut = ({ | |
children, |
This file contains 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
/* eslint-disable jsx-a11y/anchor-has-content */ | |
import Link from 'next/link' | |
import { useRouter } from 'next/router' | |
const CustomLink = ({ href, ...rest }) => { | |
const router = useRouter() | |
const isInternalLink = href && href.startsWith('/') | |
const isAnchorLink = href && href.startsWith('#') | |
if (isInternalLink) { |
This file contains 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
/* | |
Will run after timeout (function call will be delayed), | |
if the function is called again BEFORE the timeout, | |
then the timeout reset, eg: | |
CLICK...100ms....CLICK.......500ms....... | |
^set 1st timeout ^will reset the timeout | |
.........................................^function called | |
*/ | |
function debounce(fn, timeout = 500) { | |
let timer = null |
This file contains 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
gsap.utils.toArray('.stb_line_single').forEach((line, i) => { | |
const speed = 200 // (in pixels per second) | |
const links = line.querySelectorAll("a"), | |
tl = verticalLoop(links, i ? -speed : speed) | |
links.forEach(link => { | |
link.addEventListener("mouseenter", () => gsap.to(tl, {timeScale: 0, overwrite: true})); | |
link.addEventListener("mouseleave", () => gsap.to(tl, {timeScale: 1, overwrite: true})); |
This file contains 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
// source: https://codepen.io/GreenSock/pen/jOBBVjr | |
gsap.utils.toArray('.stb_line_single').forEach((line, i) => { | |
const links = line.querySelectorAll("a"), | |
tl = horizontalLoop(links, { | |
repeat: -1, | |
speed: 1 + i * 0.5, | |
reversed: i ? true : false, | |
paddingRight: parseFloat(gsap.getProperty(links[0], "marginRight", "px")) // otherwise first element would be right up against the last when it loops. In this layout, the spacing is done with marginRight. | |
}); | |
links.forEach(link => { |
This file contains 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
/* | |
https://stackoverflow.com/a/23367686/7200504 | |
scrollbars will be included in the vw so the horizontal scroll will be added to allow you to see under the vertical scroll. | |
*/ | |
.box { | |
width: 100vw; | |
height: 100vh; | |
max-width:100%; /* added */ | |
} |
This file contains 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
# source: https://superuser.com/a/1035782 | |
# this repo is fairly fast in indo | |
sudo dnf config-manager --add-repo https://codingflyboy.mm.fcix.net/fedora/linux/releases/36/Everything/x86_64/os/ |