pointvec/desktop/sources/index.html

131 lines
9.2 KiB
HTML
Raw Normal View History

2018-08-17 17:34:24 -04:00
<!DOCTYPE html>
<html lang="en">
2016-12-31 10:00:57 -05:00
<html>
<head>
2018-08-17 17:34:24 -04:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2019-01-09 16:00:52 -05:00
<!-- Generics -->
2018-01-29 15:48:58 -05:00
<script type="text/javascript" src="scripts/lib/theme.js"></script>
2018-01-31 15:21:59 -05:00
<script type="text/javascript" src="scripts/lib/history.js"></script>
2019-01-09 16:00:52 -05:00
<script type="text/javascript" src="scripts/lib/controller.js"></script>
<!-- Dotgrid -->
2018-10-06 11:59:21 -04:00
<script type="text/javascript" src="scripts/dotgrid.js"></script>
2019-01-09 16:00:52 -05:00
<script type="text/javascript" src="scripts/manager.js"></script>
2019-04-21 19:49:47 -04:00
<script type="text/javascript" src="scripts/source.js"></script>
2018-05-10 18:06:03 -04:00
<script type="text/javascript" src="scripts/renderer.js"></script>
2019-01-09 16:00:52 -05:00
<script type="text/javascript" src="scripts/cursor.js"></script>
2017-11-14 16:11:09 -05:00
<script type="text/javascript" src="scripts/interface.js"></script>
<script type="text/javascript" src="scripts/tool.js"></script>
2018-05-09 17:56:55 -04:00
<script type="text/javascript" src="scripts/generator.js"></script>
2018-03-06 19:50:41 -05:00
<script type="text/javascript" src="scripts/picker.js"></script>
2019-01-11 22:02:29 -05:00
<script type="text/javascript" src="scripts/listener.js"></script>
2019-01-09 16:00:52 -05:00
<!-- Styles -->
2016-12-31 10:00:57 -05:00
<link rel="stylesheet" type="text/css" href="links/reset.css"/>
<link rel="stylesheet" type="text/css" href="links/fonts.css"/>
<link rel="stylesheet" type="text/css" href="links/main.css"/>
2018-09-11 21:20:31 -04:00
<link rel="stylesheet" type="text/css" href="links/theme.css"/>
2017-01-04 12:51:45 -05:00
<title>Dotgrid(Icon)</title>
2016-12-31 10:00:57 -05:00
</head>
<body>
2018-09-11 23:27:01 -04:00
<script>
2018-10-04 00:24:28 -04:00
'use strict'
2019-02-21 01:13:29 -05:00
2018-05-12 17:50:19 -04:00
const webFrame = require('electron').webFrame
const {dialog,app} = require('electron').remote;
const fs = require('fs');
2018-05-08 05:05:19 -04:00
2019-04-21 19:49:47 -04:00
const dotgrid = new Dotgrid()
dotgrid.controller = new Controller();
dotgrid.controller.add("default","*","About",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Dotgrid'); },"CmdOrCtrl+,");
dotgrid.controller.add("default","*","Fullscreen",() => { app.toggleFullscreen(); },"CmdOrCtrl+Enter");
dotgrid.controller.add("default","*","Hide",() => { app.toggleVisible(); },"CmdOrCtrl+H");
dotgrid.controller.add("default","*","Inspect",() => { app.inspect(); },"CmdOrCtrl+.");
dotgrid.controller.add("default","*","Reset",() => { dotgrid.reset(); dotgrid.theme.reset(); },"CmdOrCtrl+Backspace");
dotgrid.controller.add("default","*","Quit",() => { app.exit(); },"CmdOrCtrl+Q");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","File","New",() => { dotgrid.source.new(); },"CmdOrCtrl+N");
dotgrid.controller.add("default","File","Open",() => { dotgrid.source.open(); },"CmdOrCtrl+O");
dotgrid.controller.add("default","File","Save(.grid)",() => { dotgrid.source.save(); },"CmdOrCtrl+S");
dotgrid.controller.add("default","File","Render(.png)",() => { dotgrid.source.render(); },"CmdOrCtrl+R");
dotgrid.controller.add("default","File","Export(.svg)",() => { dotgrid.source.export(); },"CmdOrCtrl+E");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.addRole("default","Edit","copy");
dotgrid.controller.addRole("default","Edit","cut");
dotgrid.controller.addRole("default","Edit","paste");
dotgrid.controller.add("default","Edit","Undo",() => { dotgrid.tool.undo() },"CmdOrCtrl+Z");
dotgrid.controller.add("default","Edit","Redo",() => { dotgrid.tool.redo() },"CmdOrCtrl+Shift+Z");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","Stroke","Line",() => { dotgrid.tool.cast("line"); },"A");
dotgrid.controller.add("default","Stroke","Arc",() => { dotgrid.tool.cast("arc_c"); },"S"); // 0,1
dotgrid.controller.add("default","Stroke","Arc Rev",() => { dotgrid.tool.cast("arc_r")},"D"); // 0,0
dotgrid.controller.add("default","Stroke","Bezier",() => { dotgrid.tool.cast("bezier") },"F");
dotgrid.controller.add("default","Stroke","Close",() => { dotgrid.tool.cast("close") },"Z");
dotgrid.controller.add("default","Stroke","Arc(full)",() => { dotgrid.tool.cast("arc_c_full"); },"T"); // 1,1
dotgrid.controller.add("default","Stroke","Arc Rev(full)",() => { dotgrid.tool.cast("arc_r_full")},"Y"); // 1,0
dotgrid.controller.add("default","Stroke","Clear Selection",() => { dotgrid.tool.clear(); },"Escape");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","Effect","Linecap",() => { dotgrid.tool.toggle("linecap"); },"Q");
dotgrid.controller.add("default","Effect","Linejoin",() => { dotgrid.tool.toggle("linejoin"); },"W");
dotgrid.controller.add("default","Effect","Mirror",() => { dotgrid.tool.toggle("mirror"); },"E");
dotgrid.controller.add("default","Effect","Fill",() => { dotgrid.tool.toggle("fill"); },"R");
dotgrid.controller.add("default","Effect","Thicker",() => { dotgrid.tool.toggle("thickness",1) },"}");
dotgrid.controller.add("default","Effect","Thinner",() => { dotgrid.tool.toggle("thickness",-1) },"{");
dotgrid.controller.add("default","Effect","Thicker +5",() => { dotgrid.tool.toggle("thickness",5) },"]");
dotgrid.controller.add("default","Effect","Thinner -5",() => { dotgrid.tool.toggle("thickness",-5) },"[");
dotgrid.controller.add("default","Effect","Toggle Crest",() => { dotgrid.tool.toggleCrest(); }, "CmdOrCtrl+K");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","Manual","Add Point",() => { dotgrid.tool.addVertex(dotgrid.cursor.pos); dotgrid.renderer.update() },"Enter");
dotgrid.controller.add("default","Manual","Move Up",() => { dotgrid.cursor.pos.y -= 15; dotgrid.renderer.update() },"Up");
dotgrid.controller.add("default","Manual","Move Right",() => { dotgrid.cursor.pos.x += 15; dotgrid.renderer.update() },"Right");
dotgrid.controller.add("default","Manual","Move Down",() => { dotgrid.cursor.pos.y += 15; dotgrid.renderer.update() },"Down");
dotgrid.controller.add("default","Manual","Move Left",() => { dotgrid.cursor.pos.x -= 15; dotgrid.renderer.update() },"Left");
dotgrid.controller.add("default","Manual","Remove Point",() => { dotgrid.tool.removeSegmentsAt(dotgrid.cursor.pos); },"Shift+Backspace");
dotgrid.controller.add("default","Manual","Remove Segment",() => { dotgrid.tool.removeSegment(); },"Backspace");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","Layers","Foreground",() => { dotgrid.tool.selectLayer(0) },"CmdOrCtrl+1");
dotgrid.controller.add("default","Layers","Middleground",() => { dotgrid.tool.selectLayer(1) },"CmdOrCtrl+2");
dotgrid.controller.add("default","Layers","Background",() => { dotgrid.tool.selectLayer(2) },"CmdOrCtrl+3");
dotgrid.controller.add("default","Layers","Next Layer",() => { dotgrid.tool.selectNextLayer() });
dotgrid.controller.add("default","Layers","Prev Layer",() => { dotgrid.tool.selectPrevLayer() });
dotgrid.controller.add("default","Layers","Merge Layers",() => { dotgrid.tool.merge() },"M");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","View","Zoom In",() => { dotgrid.modZoom(0.25) },"CmdOrCtrl+=")
dotgrid.controller.add("default","View","Zoom Out",() => { dotgrid.modZoom(-0.25) },"CmdOrCtrl+-")
dotgrid.controller.add("default","View","Zoom Reset",() => { dotgrid.modZoom(1,true) },"CmdOrCtrl+0")
dotgrid.controller.add("default","View","Color Picker",() => { dotgrid.picker.start(); },"G");
dotgrid.controller.add("default","View","Toggle Grid",() => { dotgrid.renderer.toggle(); },"H");
dotgrid.controller.add("default","View","Toggle Interface",() => { dotgrid.interface.toggle(); },"Tab");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("default","Theme","Open Theme",() => { dotgrid.theme.open(); },"CmdOrCtrl+Shift+o")
dotgrid.controller.add("default","Theme","Reset Theme",() => { dotgrid.theme.reset(); },"CmdOrCtrl+Shift+Backspace")
dotgrid.controller.add("default","Theme","Download Themes..",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Themes'); })
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("picker","*","About",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Dotgrid'); },"CmdOrCtrl+,");
dotgrid.controller.add("picker","*","Fullscreen",() => { app.toggleFullscreen(); },"CmdOrCtrl+Enter");
dotgrid.controller.add("picker","*","Hide",() => { app.toggleVisible(); },"CmdOrCtrl+H");
dotgrid.controller.add("picker","*","Inspect",() => { app.inspect(); },"CmdOrCtrl+.");
dotgrid.controller.add("picker","*","Documentation",() => { dotgrid.controller.docs(); },"CmdOrCtrl+Esc");
dotgrid.controller.add("picker","*","Reset",() => { dotgrid.reset(); dotgrid.theme.reset(); },"CmdOrCtrl+Backspace");
dotgrid.controller.add("picker","*","Quit",() => { app.exit(); },"CmdOrCtrl+Q");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.addRole("picker","Edit","undo");
dotgrid.controller.addRole("picker","Edit","redo");
dotgrid.controller.addRole("picker","Edit","cut");
dotgrid.controller.addRole("picker","Edit","copy");
dotgrid.controller.addRole("picker","Edit","paste");
dotgrid.controller.addRole("picker","Edit","delete");
dotgrid.controller.addRole("picker","Edit","selectall");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.add("picker","Mode","Stop Picker Mode",() => { dotgrid.picker.stop(); },"Escape");
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.controller.commit();
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
dotgrid.install(document.body);
2018-10-04 19:52:17 -04:00
2019-04-21 19:49:47 -04:00
window.addEventListener('load', () => { dotgrid.start(); })
</script>
2016-12-31 10:00:57 -05:00
</body>
</html>