Skip to content

Instantly share code, notes, and snippets.

View MathisBullinger's full-sized avatar

Mathis Bullinger MathisBullinger

View GitHub Profile
@MathisBullinger
MathisBullinger / VirtualList.tsx
Created April 15, 2021 03:08
Virtual list component that renders react components as items
import React, {
useState,
useEffect,
useCallback,
useRef,
useMemo,
createElement,
cloneElement,
memo,
} from 'react'
import React, { useState, useEffect } from 'react'
import styled from 'styled-components'
import { useCanvas } from 'utils/hooks'
import debounce from 'lodash/debounce'
export default function Glow() {
const [ref, setRef] = useState<HTMLCanvasElement | null>(null)
const [boxes, setBoxes] = useState<Box[]>([])
const [ctx, width, height] = useCanvas(ref)
const moving = useMouseMoving()
(p = v => new Proxy(v || {}, { get: ({ s = '' }, k) => k === 'print' ? s :
p({ s: s + String.fromCharCode(k.length - 33 * k.match(/^\$*/)[0].length + 96)}) }))().
$________._____.____________.____________._______________.$$.$_______________________._______________.__________________.____________.____.$$_.print