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
if(prop == 'marginRight' && out != '0px' && !supports.RightMargin){ | |
/* | |
selection = window.getSelection(); | |
ranges = []; | |
for (i = 0, len = selection.rangeCount; i < len; i++) { | |
ranges.push(selection.getRangeAt(i).cloneRange()); | |
} | |
*/ | |
/* | |
var selection = window.getSelection(), |
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
{ | |
data: [{ | |
manufacturer: 'Porsche', | |
model: '911', | |
price: 135000, | |
wiki: 'http://en.wikipedia.org/wiki/Porsche_997', | |
img: '2004_Porsche_911_Carrera_type_997.jpg' | |
},{ | |
manufacturer: 'Nissan', | |
model: 'GT-R', |
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
<html class="no-js" lang="en" xmlns:ng="http://angularjs.org" ng:app> | |
<HEAD> | |
</HEAD> | |
<BODY> | |
<div id="pieFace" style=" | |
-pie-background: linear-gradient(top, rgba(0, 0, 0, 0.3) 0%, rgba(125, 134, 136, 0.3) 10%, rgba(125, 134, 136, 0.3) 60%, rgba(125, 134, 136, 0.6) 80%, rgba(125, 134, 136, 0.8) 100%); | |
height: 50px; | |
width: 50px; | |
" pie=""></div> |
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
/** | |
* Utility for conditionally setting the src of images based on CSS media queries. | |
* Example usage: | |
* | |
* HTML: | |
* | |
* <img class="dynamic" data-src-1="one.png" data-src-2="two.png"> | |
* | |
* JS: | |
* |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style type="text/css"> | |
#one, #two, #three { | |
position: absolute; | |
width: 200px; | |
height: 200px; | |
background: #EEE; |
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 is an idea I had for allowing multiple modules within a single file, each of | |
which is addressable via URL fragment. Something like this could simplify bundling, | |
especially if used in conjunction with Import Maps. It could also be a nice way | |
to run blocks of code in web workers, where those blocks don't require a separate | |
file and can themselves import other modules in the same file or other files. | |
*/ | |
// File_A.js |
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
// Each InstanceTemplate becomes an InstancedMesh behind the scenes. | |
// In this example we'll end up with 2 draw calls. | |
// This proposal uses a string `id` to refer to the templates, but it | |
// could also possibly be done by reference? | |
const Example = () => { | |
return <Instances> | |
<InstanceTemplate id="instancedBox"> | |
<boxGeometry /> | |
<meshStandardMaterial /> |
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
alert('HACKED!') |
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 { useThree } from '@react-three/fiber'; | |
import React, { useEffect } from 'react'; | |
import { Html as DreiHtml } from '@react-three/drei'; | |
import type { HtmlProps } from '@react-three/drei/web/Html'; | |
export function Html(props: HtmlProps) { | |
const { gl } = useThree(); | |
const canvas = gl.domElement as HTMLCanvasElement; | |
// Drei's Html component sets pointerEvents:'none' on the canvas, which breaks MP |