I hereby claim:
- I am mwmwmw on github.
- I am mwmwmw (https://keybase.io/mwmwmw) on keybase.
- I have a public key whose fingerprint is 45FB 1BC7 C090 C925 DF2B 5A12 BE11 ACCE 6CBD 72CB
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
A Pen by Matthew Willox on CodePen.
| const HEX = /#([0-9ABCDEF]{2})([0-9ABCDEF]{2})([0-9ABCDEF]{2})/; | |
| const VEC3 = /vec3\s?\(([0-9.]*),\s?([0-9.]*),\s?([0-9.]*)\)/; | |
| const DEFAULT_VALUE = 0; | |
| class Color { | |
| static hex2vec3(hex) { | |
| let matches = Color.parseHex(hex); | |
| return Color.vec3(matches, 256); | |
| } |
| const MOUSE_WHEEL_EVENT = "wheel"; | |
| const TOUCH_MOVE = "touchmove"; | |
| const TOUCH_END = "touchend"; | |
| const MOUSE_DOWN = "mousedown"; | |
| const MOUSE_UP = "mouseup"; | |
| const MOUSE_MOVE = "mousemove"; | |
| class ScrollPos { | |
| constructor() { | |
| this.acceleration = 0; | |
| this.maxAcceleration = 5; |
| import { Vector3, Object3D, BufferGeometry, Math as M, Group, LineBasicMaterial, Line, Line3, CylinderBufferGeometry, BufferAttribute, SphereBufferGeometry } from "three"; | |
| export function Pill(start, end, radius) { | |
| Object3D.call(this); | |
| this.radius = radius; | |
| this.type = "Pill"; | |
| this._start = start; | |
| this._end = end; |
| import { useEffect, useState } from 'react'; | |
| const options = { method: 'GET' }; | |
| export default function useOpenSeaAssets({ | |
| owner, | |
| sortDirection = 'asc', | |
| offset = 0, | |
| limit = 50, | |
| collection, |
| import { useEffect, useState } from 'react'; | |
| const options = { method: 'GET' }; | |
| export default function useOpenSeaCollections({ | |
| owner, | |
| offset = 0, | |
| limit = 50, | |
| }) { | |
| const [collections, setCollections] = useState([]); |
| import { useEffect, useMemo } from "react"; | |
| import { createPortal } from "react-dom"; | |
| export default function Portal({ children, root = 'overlay', pointerEvents = true }) { | |
| const el = useMemo(() => document.createElement("div"), []); | |
| const rootElement = useMemo(() => document.getElementById(root), [root]); | |
| useEffect(() => { | |
| rootElement.style = `pointer-events: ${pointerEvents ? 'all' : 'none'}`; |
| /** | |
| This hook is for interacting with Pipedreams Server Signal Events. | |
| Padd in the endpointId, channel to listen to, and a callback function for when an event arrives. | |
| Passed out of the hook is a function for sending messages back to the server as well as a list of messages. | |
| */ | |
| import { useCallback, useEffect, useState } from 'react'; | |
| export default function usePipeDreamSSE( |
| import { Raycaster, Vector3 } from 'three'; | |
| import { useXR, Interactive } from '@react-three/xr'; | |
| import { useFrame } from '@react-three/fiber'; | |
| import { useCallback, useRef, useState } from 'react'; | |
| export function TeleportIndicator(props) { | |
| return ( | |
| <> | |
| <pointLight position={[0, 0.5, 0]} args={[0xff00ff, 2, 0.6]} /> |