Skip to content

Instantly share code, notes, and snippets.

@LeWolfYT
Last active February 1, 2021 16:58
Show Gist options
  • Save LeWolfYT/c5874d91514d1ae5bcac7ff21a0d8de5 to your computer and use it in GitHub Desktop.
Save LeWolfYT/c5874d91514d1ae5bcac7ff21a0d8de5 to your computer and use it in GitHub Desktop.
An electron version of my site without the JS because electron is picky
<!DOCTYPE html>
<html>
<head>
<title>my page</title>
<script src="./scripts.js"></script>
<link href="./styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<script>
welcome()
</script>
<p>
Sooooo uhh hi there
</p>
<p>
im working on this, trust me
</p>
<p>
this is the fiddle version of the site, running electron
<script>
document.write(process.versions.electron)
</script>
</p>
<button onclick="bee()">
click for a totally safe surprise!!1!!!
</button>
<button onclick="dark()" >
*DISCLAIMER* Does nothing.
</button>
</body>
</html>
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
console.log("Hi!!!1!!!! i love coding");
var drk = false;
function alert() {
alert("Welcome to the website! I hope you have a great time here!");
}
function bee() {
alert("According to all known laws of aviation,");
alert("there is no way a bee should be able to fly.");
alert("Its wings are too small to get its fat little body off the ground.");
alert("The bee, of course, flies anyway");
console.log("e");
}
function dark() {
if (drk === false) {
alert("In progress, does nothing");
drk = true;
} else if (drk === true) {
alert("still does nothing");
drk = false;
}
}
html {
background-repeat:no-repeat;
background: -moz-linear-gradient(to top, #ee9f00, #009fee) fixed;
background: -webkit-linear-gradient(to top, #ee9f00, #009fee) fixed;
background: linear-gradient(to top, #ee9f00, #009fee) fixed;
cursor: url(https://i.redd.it/lhogxfo3rf151.png);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment