Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakerh400 committed Feb 16, 2018
1 parent 4d52cfd commit 341a83b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var urlModule = require('url');
var O = require('../framework');
var Canvas = require('../media/node_modules/canvas');

var server = 'http://localhost';
var server = 'http://localhost/';

class EventTarget extends EventEmitter{
constructor(){
Expand Down
12 changes: 4 additions & 8 deletions grid/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var w = 1920;
var h = 1080;
var fps = 60;
var hd = true;
var duration = 60 * 10;
var duration = 3;
var framesNum = fps * duration;

var url = '/?project=grid';
Expand All @@ -28,18 +28,14 @@ function main(){
function render(window){
var canvas = window._canvases[0];

window.emit('keydown', {code: 'KeyG'});

media.renderVideo('-vid/1.mp4', w, h, fps, hd, (w, h, g, f) => {
logStatus(f, framesNum);

g.drawImage(canvas, 0, 0);

window.emit('mousedown', {
button: [0, 2][O.rand(2)],
clientX: Math.random() * w,
clientY: Math.random() * h,
});

window.emit('keydown', {code: 'Enter'});
window.emit('keydown', {code: `Arrow${'Up,Left,Down,Right'.split`,`[O.rand(4)]}`});

return f != framesNum;
});
Expand Down
20 changes: 20 additions & 0 deletions random-pixels/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

var O = require('../framework');
var media = require('../media');
var ImageData = require('../image-data');

var w = 400;
var h = 400;

setTimeout(main);

function main(){
media.renderImage('-img/1.png', w, h, (w, h, g) => {
var d = new ImageData(g);

d.iterate(() => O.ca(3, () => O.rand(256)));

d.put();
});
}

0 comments on commit 341a83b

Please sign in to comment.