Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
itsgoofer committed Oct 19, 2022
0 parents commit f58b227
Show file tree
Hide file tree
Showing 21 changed files with 18,598 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## SubaTimer

**SubaTimer** is a little Windows utility that makes easy bla bla bla.


Binary file added app-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dest": "dist/installers/",
"icon": "resources/Icon.ico",
"tags": [
"Utility"
]
}
Binary file added fonts/InputMonoNarrowBold.woff
Binary file not shown.
Binary file added fonts/InputMonoNarrowBold.woff2
Binary file not shown.
Binary file added fonts/InputMonoNarrowRegular.woff
Binary file not shown.
Binary file added fonts/InputMonoNarrowRegular.woff2
Binary file not shown.
73 changes: 73 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SubaTimer v2.0</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<h3>Settings</h3>
<div>
<div class="settings-item">
<label>1 Sub Value in Minutes</label>
<input v-model="subsValue" type="text">
</div>

<div class="settings-item">
<label>1 Bit Value in Seconds </label>
<input v-model="bitsValue" type="text">
</div>

<div class="settings-item">
<label>1 Dollar Value in Minutes </label>
<input v-model="donationValue" type="text">
</div>

</div>

<div class="timer-section">
<h3>Timer</h3>
<label>Note: OBS_TIMER file is now saved on your desktop</label>
<input v-model="timer" class="countdown"></input> <span v-if="showingNotice">{{notice}}</span>
<button class="timer-button" v-if="!isRunning" @click="startTimer">Start Timer</button>
<button class="timer-button" v-if="isRunning" @click="stopTimer">Stop Timer</button>
</div>

<div class="time-update">
<h3>Update Time</h3>
<div class="update-item">
<label>Enter Subs</label>
<input type="text" v-model="subsToAdd">
<div class="update-item-buttons">
<button @click="subsReceived('add')">Add To Time</button> <button @click="subsReceived('remove')">Remove From Time</button>
</div>
</div>

<div class="update-item">
<label>Enter Bits</label>
<input type="text" v-model="bitsToAdd">
<div class="update-item-buttons">
<button @click="bitsReceived('add')">Add To Time</button> <button @click="bitsReceived('remove')">Remove From Time</button>
</div>
</div>

<div class="update-item">
<label>Enter Donation Amount</label>
<input type="text" v-model="donationsToAdd">
<div class="update-item-buttons">
<button @click="bucksReceived('add')">Add To Time</button> <button @click="bucksReceived('remove')">Remove From Time</button>
</div>
</div>

</div>
<footer>Made with ❤️ by Goofer</footer>
</div>

<script src="scripts/vue.global.js"></script>
<script src="scripts/moment.min.js"></script>
<script src="timer.js"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const { app, BrowserWindow } = require('electron')
const path = require('path')

if (require('electron-squirrel-startup')) app.quit()

function createWindow() {
const gotTheLock = app.requestSingleInstanceLock()

if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', (event, commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (win) {
if (win.isMinimized()) win.restore()
win.focus()
}
})
}
const win = new BrowserWindow({
width: 800,
height: 600,
icon: 'resources/Icon.ico',

webPreferences: {
// devTools: true,
preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true,
contextIsolation: false
}
})

win.loadFile('index.html')
win.setMenu(null)
}

app.whenReady().then(() => {
createWindow()

app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "SubaTimer",
"version": "2.0.0",
"main": "main.js",
"author": "Goofer",
"license": "MIT",
"description": "A timer app for Subathons",
"scripts": {
"start": "electron .",
"build": "npx electron-packager . SubaTimer --platform win32 --arch x64 --out dist/ --icon=./resources/Icon.ico",
"installer": "electron-installer-windows --src dist/SubaTimer-win32-x64/ --config config.json"
},
"devDependencies": {
"electron": "^19.0.8",
"electron-packager": "^15.5.1"
},
"dependencies": {
"electron-installer-windows": "^3.0.0",
"electron-squirrel-startup": "^1.0.0"
}
}
10 changes: 10 additions & 0 deletions preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
window.addEventListener('DOMContentLoaded', () => {
const replaceText = (selector, text) => {
const element = document.getElementById(selector)
if (element) element.innerText = text
}

for (const type of ['chrome', 'node', 'electron']) {
replaceText(`${type}-version`, process.versions[type])
}
})
Binary file added resources/Icon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions scripts/moment.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f58b227

Please sign in to comment.