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 18, 2018
1 parent e53fcfc commit 8ae9e39
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 59 deletions.
2 changes: 1 addition & 1 deletion browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var EventEmitter = require('events');
var http = require('http');
var urlModule = require('url');
var O = require('../framework');
var Canvas = require('../media/node_modules/canvas');
var {Canvas} = require('../media/node_modules/canvas');

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

Expand Down
2 changes: 1 addition & 1 deletion col2rgb/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Canvas = require('../media/node_modules/canvas');
var {Canvas} = require('../media/node_modules/canvas');

module.exports = colToRgb;

Expand Down
19 changes: 14 additions & 5 deletions grid/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

var O = require('../framework');
var media = require('../media');
var Canvas = require('../media/node_modules/canvas');
var {Canvas} = require('../media/node_modules/canvas');
var browser = require('../browser');
var logStatus = require('../log-status');

var w = 1920;
var h = 1080;
var fps = 60;
var hd = true;
var duration = 3;
var duration = 10;
var framesNum = fps * duration;

var url = '/?project=grid';
Expand All @@ -28,14 +28,23 @@ 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('keydown', {code: `Arrow${'Up,Left,Down,Right'.split`,`[O.rand(4)]}`});
var t = (f - 1) % (fps * 3) + 1;

if(t <= 179){
if(Math.random() > .1){
window.emit('mousedown', {button: [0, 2][O.rand(2)], clientX: Math.random() * w, clientY: Math.random() * h});
}else{
window.emit('mousemove', {clientX: Math.random() * w, clientY: Math.random() * h});
window.emit('keydown', {code: `Key${'WBX'[O.rand(3)]}`});
}
}else{
window.emit('keydown', {code: 'Enter'});
}

return f != framesNum;
});
Expand Down
2 changes: 1 addition & 1 deletion icon/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Canvas = require('../media/node_modules/canvas');
var {Canvas} = require('../media/node_modules/canvas');
var media = require('../media');

var w = 128;
Expand Down
49 changes: 0 additions & 49 deletions image-data/main.js

This file was deleted.

6 changes: 6 additions & 0 deletions media/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
cls

cd ./node_modules/canvas
start node-gyp rebuild --GTK_Root="C:\Program Files\GTK"
cd ../..
2 changes: 1 addition & 1 deletion media/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var cp = require('child_process');
var Canvas = require('canvas');
var {Canvas} = require('../media/node_modules/canvas');
var O = require('../framework');
var formatFileName = require('../format-file-name');

Expand Down
2 changes: 1 addition & 1 deletion minifier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var fs = require('fs');
var path = require('path');
var Canvas = require('../media/node_modules/canvas');
var {Canvas} = require('../media/node_modules/canvas');
var O = require('../framework');
var fsRec = require('../fs-recursive');
var identGenerator = require('../ident-generator');
Expand Down

0 comments on commit 8ae9e39

Please sign in to comment.