This file contains hidden or 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
| // animation worklet | |
| registerAnimator('parallaxAnim', class { | |
| static inputs = { | |
| 'scroller': { | |
| 'scrollTop' | |
| }, | |
| 'parallax': { | |
| 'style': ['transform'] | |
| } | |
| } |
This file contains hidden or 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
| registerAnimator('foo', class { | |
| static elements = { | |
| scroller: { | |
| isRoot: true; | |
| scrollInput: true; | |
| }, | |
| parallax: { | |
| outputProperties: ['transform'] | |
| } |
This file contains hidden or 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 source = ???; | |
| const audioWorkletNode = new AudioWorkletNode('filter'); | |
| source.connect(audioWorkletNode); | |
| audioWorkletNode.connect(ctx.destination); | |
| |----------| | |
| |---| | |
This file contains hidden or 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
| <style> | |
| .painting { | |
| background-image: paint(typed, 10px), url(foo2.png); | |
| background-image: paint(typed, red), url(foo1.png); | |
| } | |
| </style> | |
| <script> | |
| // paint worklet | |
| registerPaint('typed', class { | |
| static inputArguments = ['<length>']; |
This file contains hidden or 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
| interface VRAnchor { | |
| readonly attribute VRCoordinateSystem coordinateSystem; | |
| }; | |
| [Constructor(VRDisplay)] | |
| interface VRStageAnchor : VRAnchor { | |
| readonly attribute float sizeX; | |
| readonly attribute float sizeY; | |
| }; |
This file contains hidden or 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 canvas = new OffscreenCanvas(1000, 1000); | |
| const ctx = canvas.getContext('2d' /* not sure if this is special */); | |
| const layer = new CanvasVRLayer(canvas); | |
| async function drawLoop() { | |
| do { | |
| } while (await ctx.commit()); | |
| } |
This file contains hidden or 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
| api = await remote { | |
| import B from 'b.js'; | |
| export class A { | |
| constructor() { this.b = new B(); } | |
| } | |
| export function thing() { | |
| } | |
| } |
This file contains hidden or 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 lang="en"> | |
| <head> | |
| <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | |
| <title>Worklets Level 1</title> | |
| <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> | |
| <meta content="ED" name="w3c-status"> | |
| <link href="../default.css" rel="stylesheet" type="text/css"> | |
| <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon"> | |
| <link href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED" rel="stylesheet" type="text/css"> | |
| <meta content="Bikeshed version 81c00a31d8c468599cf8337dd150a8be9a2b4e5d" name="generator"> |
This file contains hidden or 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
| console.log('hello world.'); |