Animated canvas size.
This commit is contained in:
parent
345d623574
commit
a90508dac9
77
BUILD.md
77
BUILD.md
@ -1,77 +0,0 @@
|
|||||||
## Build
|
|
||||||
|
|
||||||
Don't forget to ```npm cache clean```!
|
|
||||||
|
|
||||||
### Build Linux64 / Darwin64 / Windows64(Offsite)
|
|
||||||
|
|
||||||
```
|
|
||||||
cd /xxiivv/Nataniev/public/public.projects/sources/Dotgrid/
|
|
||||||
|
|
||||||
git pull
|
|
||||||
|
|
||||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-linux-x64/
|
|
||||||
rm /xxiivv/Nataniev/public/public.projects/builds/dotgrid_lin64.zip
|
|
||||||
electron-packager . Dotgrid --platform=linux --arch=x64 --out /xxiivv/Nataniev/public/public.projects/builds --overwrite --electron-version=1.7.5 --icon=icon.ico
|
|
||||||
|
|
||||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-win32-x64/
|
|
||||||
rm /xxiivv/Nataniev/public/public.projects/builds/dotgrid_win64.zip
|
|
||||||
electron-packager . Dotgrid --platform=win32 --arch=x64 --out /xxiivv/Nataniev/public/public.projects/builds --overwrite --electron-version=1.7.5 --icon=icon.ico
|
|
||||||
|
|
||||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-darwin-x64/
|
|
||||||
rm /xxiivv/Nataniev/public/public.projects/builds/dotgrid_osx64.zip
|
|
||||||
electron-packager . Dotgrid --platform=darwin --arch=x64 --out /xxiivv/Nataniev/public/public.projects/builds --overwrite --electron-version=1.7.5 --icon=icon.icns
|
|
||||||
|
|
||||||
cd /xxiivv/Nataniev/public/public.projects/builds/
|
|
||||||
|
|
||||||
~/butler push /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-linux-x64/ hundredrabbits/dotgrid:linux-64
|
|
||||||
~/butler push /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-win32-x64/ hundredrabbits/dotgrid:windows-64
|
|
||||||
~/butler push /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-darwin-x64/ hundredrabbits/dotgrid:osx-64
|
|
||||||
|
|
||||||
~/butler status hundredrabbits/dotgrid
|
|
||||||
|
|
||||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-darwin-x64/
|
|
||||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-linux-x64/
|
|
||||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-win32-x64/
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Build Linux64 / Darwin64 / Windows64(Local)
|
|
||||||
```
|
|
||||||
cd /Users/VillaMoirai/Desktop/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Dotgrid-darwin-x64/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Dotgrid-linux-x64/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Dotgrid-win32-x64/
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Dotgrid/
|
|
||||||
electron-packager . Dotgrid --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Dotgrid/
|
|
||||||
electron-packager . Dotgrid --platform=linux --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.ico
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Dotgrid/
|
|
||||||
electron-packager . Dotgrid --platform=win32 --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.ico
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build
|
|
||||||
```
|
|
||||||
cd /Users/VillaMoirai/Desktop/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Dotgrid-darwin-x64/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Ronin-darwin-x64/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Left-darwin-x64/
|
|
||||||
rm -r /Users/VillaMoirai/Desktop/Marabu-darwin-x64/
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Dotgrid/
|
|
||||||
electron-packager . Dotgrid --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Ronin/
|
|
||||||
electron-packager . Ronin --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Left/
|
|
||||||
electron-packager . Left --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
|
||||||
|
|
||||||
cd /Users/VillaMoirai/Github/HundredRabbits/Marabu/
|
|
||||||
electron-packager . Marabu --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ Clicking on the canvas will insert control points, up to 3CPs. CPs can be moved
|
|||||||
- `/` Toggle linecap.
|
- `/` Toggle linecap.
|
||||||
- `space` Mirror.
|
- `space` Mirror.
|
||||||
- `escape` Remove control points.
|
- `escape` Remove control points.
|
||||||
- `~` Double canvas size.
|
- `~` Toggle canvas size.
|
||||||
|
|
||||||
### System
|
### System
|
||||||
|
|
||||||
|
15
package.json
15
package.json
@ -3,11 +3,20 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron ."
|
"start": "electron .",
|
||||||
|
"clean" : "rm -r ~/Desktop/Dotgrid-darwin-x64/ ; rm -r ~/Desktop/Dotgrid-linux-x64/ ; rm -r ~/Desktop/Dotgrid-win32-x64/ ; echo 'cleaned build location'",
|
||||||
|
"build_osx" : "electron-packager . Dotgrid --platform=darwin --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.icns ; echo 'Built for OSX'",
|
||||||
|
"build_linux" : "electron-packager . Dotgrid --platform=linux --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.ico ; echo 'Built for LINUX'",
|
||||||
|
"build_win" : "electron-packager . Dotgrid --platform=win32 --arch=x64 --out ~/Desktop/ --overwrite --icon=icon.ico ; echo 'Built for WIN'",
|
||||||
|
"build" : "npm run clean ; npm run build_osx ; npm run build_linux ; npm run build_win",
|
||||||
|
"push_osx" : "~/butler push ~/Desktop/Dotgrid-darwin-x64/ hundredrabbits/dotgrid:osx-64",
|
||||||
|
"push_linux" : "~/butler push ~/Desktop/Dotgrid-linux-x64/ hundredrabbits/dotgrid:linux-64",
|
||||||
|
"push_win" : "~/butler push ~/Desktop/Dotgrid-win32-x64/ hundredrabbits/dotgrid:windows-64",
|
||||||
|
"push_status" : "~/butler status hundredrabbits/dotgrid",
|
||||||
|
"push" : "npm run build ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run push_status"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^1.7.5",
|
"electron": "^1.8.1"
|
||||||
"electron-prebuilt": "^1.4.13"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-packager": "^8.4.0"
|
"electron-packager": "^8.4.0"
|
||||||
|
@ -24,12 +24,12 @@ svg.vector { z-index: 1000;position: relative; left:10px; top:10px; width:300px;
|
|||||||
#dotgrid:hover #guide { opacity: 1 }
|
#dotgrid:hover #guide { opacity: 1 }
|
||||||
#dotgrid:hover #widgets { opacity: 1 }
|
#dotgrid:hover #widgets { opacity: 1 }
|
||||||
|
|
||||||
#interface { font-size: 11px;line-height: 30px;text-transform: uppercase;-webkit-app-region: no-drag; transition: all 50ms; display: flex; width: 315px; margin-left: 50px; margin-right: 40px; }
|
#interface { font-size: 11px;line-height: 30px;text-transform: uppercase;-webkit-app-region: no-drag; transition: all 50ms; width: 315px; position:fixed; bottom:20px; left:calc(50vw - 150px);}
|
||||||
#interface svg.inactive { opacity: 0.2 }
|
#interface svg.inactive { opacity: 0.2 }
|
||||||
#interface svg:hover { opacity: 0.5 }
|
#interface svg:hover { opacity: 0.5 }
|
||||||
#interface svg.icon:last-child { margin-right: 0; margin-left: auto; }
|
#interface svg.icon:last-child { margin-right: 0; margin-left: 15px; }
|
||||||
|
|
||||||
#interface.hidden { display: none;opacity: 0 }
|
#interface.hidden { bottom:30px;opacity: 0 }
|
||||||
#interface.visible { display: block; opacity: 1 }
|
#interface.visible { bottom:20px; opacity: 1 }
|
||||||
|
|
||||||
#preview { position: absolute; top:20px; left:20px; stroke-dasharray: 4,4; }
|
#preview { position: absolute; top:20px; left:20px; stroke-dasharray: 4,4; }
|
||||||
|
@ -370,18 +370,10 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
|||||||
this.draw();
|
this.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.zoom = false;
|
this.set_size = function(size = {width:300,height:300},interface = true)
|
||||||
|
|
||||||
this.toggle_zoom = function()
|
|
||||||
{
|
|
||||||
dotgrid.set_size(!dotgrid.zoom ? {width:600,height:600} : {width:300,height:300})
|
|
||||||
dotgrid.zoom = dotgrid.zoom ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.set_size = function(size = {width:300,height:300})
|
|
||||||
{
|
{
|
||||||
var win = require('electron').remote.getCurrentWindow();
|
var win = require('electron').remote.getCurrentWindow();
|
||||||
win.setSize(size.width+100,size.height+120);
|
win.setSize(size.width+100,size.height+100+(interface ? 10 : 0),true);
|
||||||
|
|
||||||
this.width = size.width
|
this.width = size.width
|
||||||
this.height = size.height
|
this.height = size.height
|
||||||
|
@ -2,7 +2,6 @@ function Interface()
|
|||||||
{
|
{
|
||||||
this.el = document.createElement("div");
|
this.el = document.createElement("div");
|
||||||
this.el.id = "interface";
|
this.el.id = "interface";
|
||||||
this.is_visible = true;
|
|
||||||
|
|
||||||
this.start = function()
|
this.start = function()
|
||||||
{
|
{
|
||||||
@ -47,13 +46,28 @@ function Interface()
|
|||||||
document.getElementById("export").className.baseVal = dotgrid.segments.length < 1 ? "icon inactive" : "icon";
|
document.getElementById("export").className.baseVal = dotgrid.segments.length < 1 ? "icon inactive" : "icon";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.update_size = function()
|
||||||
|
{
|
||||||
|
var size = this.zoom ? {width:600,height:600} : {width:300,height:300};
|
||||||
|
|
||||||
|
dotgrid.set_size(size,this.is_visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.is_visible = true;
|
||||||
|
this.zoom = false;
|
||||||
|
|
||||||
this.toggle = function()
|
this.toggle = function()
|
||||||
{
|
{
|
||||||
this.is_visible = this.is_visible ? false : true;
|
this.is_visible = this.is_visible ? false : true;
|
||||||
this.el.className = this.is_visible ? "visible" : "hidden";
|
this.el.className = this.is_visible ? "visible" : "hidden";
|
||||||
|
|
||||||
const {dialog,app} = require('electron').remote;
|
this.update_size();
|
||||||
var win = require('electron').remote.getCurrentWindow();
|
}
|
||||||
win.setSize(400,this.is_visible ? 420 : 400);
|
|
||||||
|
this.toggle_zoom = function()
|
||||||
|
{
|
||||||
|
this.zoom = this.zoom ? false : true;
|
||||||
|
|
||||||
|
this.update_size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,8 @@ function Keyboard()
|
|||||||
{
|
{
|
||||||
// zoom
|
// zoom
|
||||||
if(e.key == "~" || e.keyCode == 192){
|
if(e.key == "~" || e.keyCode == 192){
|
||||||
dotgrid.toggle_zoom();
|
dotgrid.interface.toggle_zoom();
|
||||||
|
e.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user