-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.old
250 lines (234 loc) · 6.54 KB
/
index.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title id="navtitle"> Sparkle {Version}</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://site-assets.fontawesome.com/releases/v6.4.2/css/all.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<style>
/* Center align the content vertically and horizontally */
.center-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
</head>
<body>
<div class="nav-buttons nav" style="-webkit-app-region: drag">
<p id="title">✨ Sparkle {Version}</p>
<div class="nav-buttons">
<button id="minimize"><i class="fa-light fa-window-minimize"></i></button>
<button id="maximize"><i class="fa-light fa-square"></i></button>
<button id="close"><i class="fa-light fa-xmark"></i></button>
</div>
</div>
<div class="navitems">
<a>Home</a>
<a>Debloat</a>
<a id="runClean">Cleaner</a>
<a>Wifi Booster</a>
<a>Settings</a>
</div>
<div class="center-content">
<div class="text-center mt-5">
<h1>
<span class="white-text">Welcome To Sparkle </span>
<span class="yellow-text">✨</span>
</h1>
<h6 class="text-center">Windows Optimizer</h6>
<div class="buttons text-center mt-4">
<button type="button" class="btn btn-primary mx-2" id="runClean">Cleaner</button>
<button type="button" class="btn btn-primary mx-2" id="runDebloat">Debloat</button>
<div id="ramUsage" class="mt-4">
<h4 class="text-center mb-3">Ram Usage</h4>
<div class="progress">
<div id="progressBar" class="progress-bar bg-success" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<p class="mt-2">Total RAM: <span id="totalRam"></span></p>
<p>Free RAM: <span id="freeRam"></span></p>
<p>Used RAM: <span id="usedRam"></span></p>
</div>
</div>
<p class="mt-5" style="color:#4c4c4c">© 2023 Parcoil Network </p>
</div>
<script src="script.js"></script>
</body>
</html>
<style>
/* Your existing CSS */
/* Update or add styles as needed */
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: calc(100vh - 35px);
padding-top: 20px;
}
.buttons {
margin-top: 20px;
}
/* Additional refinements */
.btn-primary {
font-weight: 500;
font-size: 16px;
padding: 10px 20px;
}
.btn-primary:hover {
opacity: 0.8;
}
.progress {
width: 50%;
margin: auto;
}
</style>
<style>
* {
box-sizing: border-box;
font-family: "Inter";
overflow: hidden;
}
body {
background: #121212;
color: #ededed;
padding: 0;
margin: 0;
}
nav {
position: sticky;
border: 1px solid #2c2c2c;
height: 35px;
display: flex;
align-items: center;
background: #1c1c1c;
}
#title {
user-select: none;
font-size: 15px;
margin-left: 10px;
-webkit-app-region: drag;
margin-bottom:0px;
}
:not(nav) {
-webkit-app-region: no-drag;
}
.nav-buttons {
margin-left: auto;
height: 100%;
display: flex;
}
.nav-buttons > button {
transition: background .2s ease;
background: #1c1c1c;
border: none;
height: 100%;
margin: 0;
aspect-ratio: 1;
color: #ededed;
font-size: 17px;
}
.nav-buttons > button:hover {
transition: .2s ease;
background: #2c2c2c;
cursor: pointer;
}
.nav-buttons > button:active {
background: #4c4c4c;
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: calc(100vh - 35px); /* Consider the navbar height */
padding-top: 20px;
}
.buttons {
margin-top: 20px;
}
/* Additional refinements */
.btn-primary {
font-weight: 500;
font-size: 16px;
padding: 10px 20px;
}
.btn-primary:hover {
opacity: 0.8;
}
</style>
<script>
// Fetching the version from package.json using Electron's built-in 'fs' module
const fs = require('fs');
const path = require('path');
// Get the path to package.json
const packagePath = path.join(__dirname, 'package.json');
// Read the package.json file
fs.readFile(packagePath, 'utf8', (err, data) => {
if (err) {
console.error(err);
return;
}
// Parse the JSON content to retrieve version
const packageData = JSON.parse(data);
const version = packageData.version;
// Set the version in the HTML element
const titleElement = document.getElementById('title');
titleElement.textContent = `✨ Sparkle v${version}`;
const navtitleElement = document.getElementById('navtitle');
navtitleElement.textContent = `✨ Sparkle v${version}`;
});
</script>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Event listener for the Clean and Debloat buttons
document.getElementById('runClean').addEventListener('click', () => {
runScript('Clean');
});
document.getElementById('runDebloat').addEventListener('click', () => {
runScript('Debloat');
});
// Function to run the script and show modal
function runScript(scriptType) {
const modal = new bootstrap.Modal(document.getElementById('runningScriptModal'), {
keyboard: false
});
document.getElementById('runningScriptText').textContent = `Running ${scriptType} script`;
modal.show();
// Simulate script execution (replace this with your actual script execution logic)
setTimeout(() => {
modal.hide();
// Replace with your logic to run the bat file or perform other actions
}, 3000); // Simulated execution time: 3 seconds (3000ms)
}
});
</script>
<style>
.yellow-text {
color: yellow; /* Set emoji color */
font-size: 1.5em; /* Adjust emoji size */
animation: glow 5s ease-in-out infinite;
}
/* Glowing effect animation for the emoji */
@keyframes glow {
0% {
text-shadow: 0 0 1px yellow, 0 0 2px yellow;
}
50% {
text-shadow: 0 0 2px yellow, 0 0 3px yellow;
}
100% {
text-shadow: 0 0 3px yellow, 0 0 4px yellow;
}
}
</style>