UNPKG

newlogic

Version:

Circuit Builder Desktop Application (like mmlogic) made with Electron + React Typescript. Compatible with Windows, Mac and Linux.

55 lines (54 loc) 1.78 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Newlogic</title> <script> (function() { if (!process.env.HOT) { const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = './dist/style.css'; document.getElementsByTagName('head')[0].appendChild(link); } }()); </script> </head> <body> <div onclick="menu_off()" id="root"></div> <script> { const script = document.createElement('script'); const port = process.env.PORT || 3000; script.src = (process.env.HOT) ? 'http://localhost:' + port + '/dist/bundle.js' : './dist/bundle.js'; document.body.appendChild(script); } // navbar functions let electron = require('electron'); const win = electron.remote.getCurrentWindow(); const menu_toggle = (el) => { if (typeof document.getElementsByClassName("cl")[0] !== "undefined" && document.getElementsByClassName("cl")[0] !== el) { document.getElementsByClassName("cl")[0].classList.remove("cl"); document.getElementsByClassName("clb")[0].classList.remove("clb"); } el.classList.toggle("cl"); el.children[0].classList.toggle("clb"); } const menu_off = () => { if (typeof document.getElementsByClassName("cl")[0] !== "undefined") { document.getElementsByClassName("cl")[0].classList.remove("cl"); document.getElementsByClassName("clb")[0].classList.remove("clb"); } } const nav_settings = () => { electron.ipcRenderer.send("settings"); } const nav_exit = () => { win.close(); } </script> </body> </html>