Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
K.C.Ashish Kumar committed Nov 22, 2023
0 parents commit 167bc0e
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Digital Clock-darwin-x64
Digital Clock-win32-x64
node_modules
package-lock.json
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Digital Clock ( https://t-i-m-e.kcak11.com / https://mit-license.kcak11.com )

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# digital-clock

## Usage:

`$ git clone https://github.com/t-i-m-e/digital-clock.git`

`$ cd digital-clock`

`$ npm install`

### For running in local dev mode:

`$ npm start`

### For packaging & building platform specific binary:

`$ npm run build`

#### © 2023 https://kcak11.com
Binary file added icons/ico/128x128.ico
Binary file not shown.
Binary file added icons/png/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path');

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;

function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
title: "[ - Digital Clock - ]",
width: 530,
height: 340,
x: 121,
y: 121,
webPreferences: {
nodeIntegration: true
},
/*minimizable: false,
maximizable: false,*/
resizable: false,
devTools: false,
alwaysOnTop: true,
darkTheme: true,
icon: path.join(__dirname, 'icons/png/128x128.png')
})

// and load the index.html of the app.
//mainWindow.loadFile('index.html')
mainWindow.loadURL("https://t-i-m-e.github.io/?zoom=0.5&footer=false&title=%5B%20-%20Digital%20Clock%20-%20%5D");

// Open the DevTools.
// mainWindow.webContents.openDevTools()

// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
app.quit();
});

mainWindow.webContents.on("devtools-opened", function() {
mainWindow.webContents.closeDevTools();
});
}

// 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.on('ready', createWindow)

// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', function () {
// On macOS 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 (mainWindow === null) {
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.
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "digital-clock",
"version": "1.0.0",
"description": "A Digital Clock",
"main": "main.js",
"scripts": {
"start": "electron .",
"build": "electron-packager . \"Digital Clock\" --overwrite"
},
"repository": "https://github.com/t-i-m-e/digital-clock",
"keywords": [
"Digital",
"Clock"
],
"author": "kcak11",
"license": "MIT",
"devDependencies": {
"electron": "^26.3.0",
"electron-packager": "^17.1.2"
}
}
3 changes: 3 additions & 0 deletions renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// 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.

0 comments on commit 167bc0e

Please sign in to comment.