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> | |
| <head> | |
| <title>My experiment</title> | |
| <script src="https://unpkg.com/[email protected]"></script> | |
| <script src="https://unpkg.com/@jspsych/[email protected]"></script> | |
| <script src="https://unpkg.com/@jspsych/[email protected]"></script> | |
| <script src="https://unpkg.com/@jspsych/[email protected]"></script> | |
| <link | |
| href="https://unpkg.com/[email protected]/css/jspsych.css" |
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
| export type ResizeObserverEntryCallback = (entry: ResizeObserverEntry) => void; | |
| export class ResizeObserverManager { | |
| #elementMap = new WeakMap<Element, Set<ResizeObserverEntryCallback>>(); | |
| #elementEntry = new WeakMap<Element, ResizeObserverEntry>(); | |
| #vo = new ResizeObserver((entries) => { | |
| for (const entry of entries) { | |
| this.#elementEntry.set(entry.target, entry); | |
| this.#elementMap.get(entry.target)?.forEach((callback) => callback(entry)); |
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
| import {MyEvent} from './my-event.ts'; | |
| document.addEventListener(MyEvent.name, (e) => {...}); |
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
| // We can use custom HTML elements as domain objects to abstract away and compose DOM operations as if they are regular JS objects. | |
| class TodoItem extends HTMLElement { | |
| #completed = document.createElement('input'); | |
| #text = document.createElement('input'); | |
| #button = document.createElement('button'); | |
| constructor() { | |
| super(); |
OlderNewer