All of the changes that have been sitting on tildepi for ages. For posterity.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3530 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2020-09-23 01:58:13 +00:00
parent d6018736d5
commit d293637741
29 changed files with 3380 additions and 8 deletions

View File

@ -0,0 +1,34 @@
//! {"require": ["libiframe"]}
// Server-side blink! Woo!
require("libiframe").iframe({
source: `
document.body.style.color = '#fff';
document.body.style.backgroundColor = '#000';
var canvas = document.createElement("canvas");
document.body.append(canvas);
canvas.width = 640;
canvas.height = 480;
var context = canvas.getContext("2d");
rpc.export({
setFillStyle: function(style) { context.fillStyle = style; },
fillRect: context.fillRect.bind(context),
fillText: context.fillText.bind(context),
});`,
style: `
border: 0;
`}).then(draw).catch(terminal.print);
var blink = true;
function draw(iframe) {
iframe.setFillStyle('#222');
iframe.fillRect(0, 0, 640, 480);
if (blink) {
iframe.setFillStyle('#fff');
iframe.fillText("Hello, world!", 50, 50);
}
blink = !blink;
setTimeout(function() { draw(iframe); }, 500);
}