Skip to content

Commit fdfeb54

Browse files
authored
Add files via upload
1 parent 0454c9a commit fdfeb54

File tree

10 files changed

+315
-0
lines changed

10 files changed

+315
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/dist
2+
3+
/node_modules

LICENCE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
MIT License
3+
4+
Copyright (c) 2021 Packas
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#windows-mods-is-here)
2+
3+
# ➤ Windows-mods is here!
4+
5+
1. Install the latest version by pressing "tags"
6+
![step 1 img](https://github.com/Packas/assets/blob/main/readmeAsset1.png "Step 1")
7+
2. Click the releases tab
8+
3. Download the setup file from the latest version (.exe) by clicking it and run the installer!
9+
10+
We have auto-updates so you will only have to download the file once!
11+
12+
13+
[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#how-to-use)
14+
15+
# ➤ How To Use
16+
17+
1. When you run the app, you should come into a settings screen
18+
2. You can drag the boxes around the screen and put them anywhere you want
19+
3. Once done you press Right Shift to exit the settings screen
20+
4. To re-enter the settings screen, click on the windows-mods app icon at the task bar, then click right shift
21+
5. To close the window, click on the windows-mods app icon at the task bar, then click alt + F4
22+
23+
Build ❤️ with electron.js!

draggable.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
dragElement(document.getElementById("box1"));
2+
dragElement(document.getElementById("box2"));
3+
dragElement(document.getElementById("box4"));
4+
5+
function dragElement(elmnt) {
6+
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
7+
8+
elmnt.onmousedown = dragMouseDown;
9+
10+
function dragMouseDown(e) {;
11+
e = e || window.event;
12+
e.preventDefault();
13+
pos3 = e.clientX;
14+
pos4 = e.clientY;
15+
document.onmouseup = closeDragElement;
16+
document.onmousemove = elementDrag;
17+
}
18+
19+
function elementDrag(e) {
20+
e = e || window.event;
21+
e.preventDefault();
22+
pos1 = pos3 - e.clientX;
23+
pos2 = pos4 - e.clientY;
24+
pos3 = e.clientX;
25+
pos4 = e.clientY;
26+
elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
27+
elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
28+
}
29+
30+
function closeDragElement() {
31+
document.onmouseup = null;
32+
document.onmousemove = null;
33+
}
34+
}

icon.ico

12.6 KB
Binary file not shown.

index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="style.css">
7+
<title>Ram Viewer</title>
8+
</head>
9+
<body id="body">
10+
<div class="divv" id="divv">
11+
<p id="settings">Settings</p>
12+
</div>
13+
<div class="box" id="box1">
14+
<p class="text" id="cpu"></p>
15+
</div>
16+
<div class="box" id="box2">
17+
<p class="text" id="ram"></p>
18+
</div>
19+
<div class="box" id="box4">
20+
<p class="text" id="timepc"></p>
21+
</div>
22+
<canvas id="ctx"></canvas>
23+
<script src="render.js"></script>
24+
<script src="draggable.js"></script>
25+
</body>
26+
</html>

index.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const electron = require('electron')
2+
const {app, BrowserWindow, ipcMain} = electron
3+
const {autoUpdater} = require("electron-updater");
4+
var win;
5+
6+
function createWindow () {
7+
win = new BrowserWindow({
8+
width: 1000,
9+
height: 1000,
10+
frame: false,
11+
transparent: true,
12+
alwaysOnTop: true,
13+
resizable: false,
14+
webPreferences: {
15+
enableRemoteModule: true,
16+
nodeIntegration: true
17+
}
18+
})
19+
win.show()
20+
win.loadFile('index.html')
21+
win.maximize()
22+
}
23+
24+
app.whenReady().then(createWindow)
25+
26+
27+
app.on('ready', function() {
28+
autoUpdater.checkForUpdatesAndNotify();
29+
});
30+
31+
app.on('window-all-closed', () => {
32+
if (process.platform !== 'darwin') {
33+
app.quit()
34+
}
35+
})
36+
37+
ipcMain.on('set-ignore-mouse-events', (event, nothin) => {
38+
BrowserWindow.fromWebContents(event.sender).setIgnoreMouseEvents(nothin)
39+
})

package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "windows-mods",
3+
"version": "1.0.3",
4+
"description": "Onscreen GUI Overlay",
5+
"main": "index.js",
6+
"scripts": {
7+
"build": "electron-builder --win -p always",
8+
"start": "electron ."
9+
},
10+
"keywords": [
11+
"CPU",
12+
"RAM"
13+
],
14+
"author": "Packas Only",
15+
"license": "MIT",
16+
"devDependencies": {
17+
"electron": "^11.2.1",
18+
"electron-builder": "^22.9.1"
19+
},
20+
"dependencies": {
21+
"electron-updater": "^4.3.5",
22+
"os-utils": "0.0.14"
23+
},
24+
"build": {
25+
"publish": [
26+
{
27+
"provider": "github",
28+
"owner": "Packas",
29+
"repo": "windows-mods",
30+
"token": "TOCKEN HERE"
31+
}
32+
],
33+
"appId": "windows-mods",
34+
"mac": {
35+
"category": "windows.mods.html.js",
36+
"target": [
37+
"zip",
38+
"dmg"
39+
]
40+
}
41+
}
42+
}

render.js

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
const os = require('os-utils');
2+
const { ipcRenderer } = require('electron');
3+
4+
ctxrem = document.getElementById("ctx");
5+
var wallpaper = document.getElementById("divv");
6+
7+
const c = ctx.getContext("2d");
8+
9+
var background = true;
10+
11+
c.globalAlpha = 0.7;
12+
c.fillStyle = "rgb(0, 0, 0)";
13+
c.fillRect(0, 0, window.innerWidth, window.innerHeight);
14+
15+
setInterval(function(){
16+
var date = new Date().toLocaleTimeString();
17+
if(date == "8:45:00 AM"){
18+
const myNotification = new Notification('Period One Starts In 5 Minutes!', {
19+
body: 'Windows Mods'
20+
})
21+
}
22+
if(date == "9:35:00 AM"){
23+
const myNotification = new Notification('Period Two Starts In 5 Minutes!', {
24+
body: 'Windows Mods'
25+
})
26+
}
27+
if(date == "10:55:00 AM"){
28+
const myNotification = new Notification('Period Three Starts In 5 Minutes!', {
29+
body: 'Windows Mods'
30+
})
31+
}
32+
33+
if(date == "11:45:00 AM"){
34+
const myNotification = new Notification('Period Four Starts In 5 Minutes!', {
35+
body: 'Windows Mods'
36+
})
37+
}
38+
39+
if(date == "1:25:00 PM"){
40+
const myNotification = new Notification('Period Five Starts In 5 Minutes!', {
41+
body: 'Windows Mods'
42+
})
43+
}
44+
if(date == "2:15:00 PM"){
45+
const myNotification = new Notification('Period Six Starts In 5 Minutes!', {
46+
body: 'Windows Mods'
47+
})
48+
}
49+
50+
os.cpuUsage((v) => {
51+
document.getElementById("cpu").innerHTML = "CPU: " + (v * 100).toFixed(2) + "%";
52+
document.getElementById("ram").innerHTML = "RAM: " + (((os.freememPercentage() * 100) - 100) * -1).toFixed(2) + "%";
53+
});
54+
}, 500);
55+
56+
var timer = 0;
57+
document.getElementById("timepc").innerHTML = 0 + " mintutes on PC";
58+
59+
setInterval(() => {
60+
timer++;
61+
document.getElementById("timepc").innerHTML = timer + " mintutes on PC";
62+
}, 60000)
63+
64+
window.addEventListener("keyup", (e) => {
65+
if(e.code == "ShiftRight"){
66+
if (background == true){
67+
ipcRenderer.send('set-ignore-mouse-events', true, { forward: true })
68+
wallpaper.style.display = "none"
69+
ctxrem.style.display = "none";
70+
background = false;
71+
}
72+
else{
73+
ipcRenderer.send('set-ignore-mouse-events', false)
74+
wallpaper.style.display = "block"
75+
ctxrem.style.display = "block";
76+
background = true;
77+
};
78+
}
79+
});

style.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
body, html{
2+
margin: 0px;
3+
padding: 0px;
4+
-webkit-user-select: none; /* Safari */
5+
-moz-user-select: none; /* Firefox */
6+
-ms-user-select: none; /* IE10+/Edge */
7+
user-select: none; /* Standard */
8+
overflow: hidden;
9+
}
10+
.divv{
11+
top: 50%;
12+
left: 50%;
13+
color: white;
14+
position: absolute;
15+
font-size: 5rem;
16+
transform: translate(-50%, -50%);
17+
z-index: 9;
18+
border-radius: 25px;
19+
border: 2px solid white;
20+
background-color: rgba(0, 0, 0, 0.3);
21+
}
22+
#ctx{
23+
top: 50%;
24+
left: 50%;
25+
transform: translate(-50%, -50%);
26+
position: absolute;
27+
width: 100%;
28+
height: 100%;
29+
z-index: -10;
30+
}
31+
#settings{
32+
margin-top: 10px;
33+
margin-bottom: 10px;
34+
margin-left: 10px;
35+
margin-right: 10px;
36+
font-family: 'Courier New', monospace;
37+
}
38+
.box{
39+
background-color: rgba(0, 0, 0, 0.5);
40+
z-index: 9;
41+
border: 1px solid white;
42+
color: white;
43+
position: absolute;
44+
}
45+
.text{
46+
margin: 10px;
47+
}

0 commit comments

Comments
 (0)