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 lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<meta name='viewport' content='width=device-width,maximum-scale=1.0,minimum-scale=1.0'> | |
<meta http-equiv='X-UA-Compatible' content='ie=edge'> | |
<title>X'mas Hat</title> | |
<style> | |
body { | |
font-size: 20px; |
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
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> | |
<!-- Or if you want a more recent canary version --> | |
<!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@canary"></script> --> | |
<video id="video"></video> | |
<script> | |
const src = 'https://video.twimg.com/amplify_video/1158708708068745216/pl/480x480/XwDJBf-F7tIeXR9O.m3u8'; | |
var video = document.getElementById('video'); | |
if(Hls.isSupported()) { | |
var hls = new Hls(); | |
hls.loadSource(src); |
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
const React = { | |
createElement(tag, props, ...children) { | |
if (typeof tag === 'function') { | |
try { | |
return tag(props); | |
} catch ({ promise, key }) { | |
promise.then((data) => { | |
console.log('catch', data, key); | |
fetchCache.set(key, data); | |
rerender(); |
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
class State { | |
constructor(display, actors) { | |
this.display = display; | |
this.actors = actors; | |
} | |
update(time) { | |
/** | |
* provide an update ID to let actors update other actors only once |
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> | |
<style> | |
.editor { font-family: 'Roboto Mono', monospace; font-size: 12px; outline: none; overflow-y: auto; padding-left: 48px; counter-reset: line; } | |
.editor div { display: block; position: relative; white-space: pre-wrap; } | |
.editor div::before { content: counter(line); counter-increment: line; position: absolute; right: calc(100% + 16px); opacity: 0.5; } | |
</style> | |
</head> |
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> | |
<style> | |
body { | |
margin: 0; | |
} | |
iframe { | |
display: block; | |
overflow: hidden; | |
margin: 0 auto; |