Skip to content

Instantly share code, notes, and snippets.

@exreplay
exreplay / PointerLockControls.ts
Last active February 18, 2024 01:27
ThreeJS PointerLockControls with touch support
/* eslint-disable camelcase */
import { Camera, Euler, EventDispatcher, Vector3 } from 'three';
const _changeEvent = { type: 'change' };
const _lockEvent = { type: 'lock' };
const _unlockEvent = { type: 'unlock' };
const _PI_2 = Math.PI / 2;
class PointerLockControls extends EventDispatcher {
@jackdomleo7
jackdomleo7 / Useful_global_CSS.css
Last active October 24, 2023 08:49
A set of useful global CSS defaults to add to your site alongside a reset stylesheet (with explanations)
/*! NOTE: These are just recommended default global styles, edit as required */
@import ('Import reset stylesheet here, (I recommend modern-normalize) or even better, import the reset stylesheet in the HTML as the first imported stylesheet');
::selection { /* Optional */
/* It can be really hard to read highlighted text with a text-shadow, it should be removed when selected */
text-shadow: none;
/* NOTE: Using this means the color and background-color are set to transparent for selected text... */
/* So you can customise your styles below */