Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
Update 1.3.1 (Add Random Background) Level 1
Browse files Browse the repository at this point in the history
  • Loading branch information
fwldom committed Sep 16, 2024
1 parent 67169e4 commit 182e984
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 13 deletions.
Binary file added assets/background/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/background/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/background/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/background/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/background/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/background/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/iran.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/world.webp
Binary file not shown.
38 changes: 32 additions & 6 deletions connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ function KillProcess(core = "warp") {
childProcess.kill();
childProcess = null;
}
}
};
function changeISP(newisp) {
console.log("NEW ISP IS:" + newisp)
settingWarp["isp"] = newisp;
saveSetting();
Onloading();
}
};
async function Run(nameFile, args, runa, core) {
console.log("Runing New Process...");
KillProcess(core = core);
Expand All @@ -51,10 +51,16 @@ async function Run(nameFile, args, runa, core) {
if (data.toString().includes("serving proxy")) {
if (process.platform == "linux" && !settingWarp["tun"]) {
exec("bash " + path.join(__dirname, "assets", "bash", "set_proxy.sh") + ` ${settingWarp["proxy"].replace(":", " ")}`);
if (await testProxy()) {
ConnectedWarp();
}
}
else if (process.platform == "win32" && !settingWarp["tun"]) {
console.log("set proxy");
setProxy(settingWarp["proxy"]);
if (await testProxy()) {
ConnectedWarp();
}
}
}
else if (data.toString().includes("CORE STARTED:")) {
Expand All @@ -63,18 +69,24 @@ async function Run(nameFile, args, runa, core) {
}
}
});
childProcess.stderr.on('data', (data) => {
childProcess.stderr.on('data', async (data) => {
if (data instanceof Buffer) {
data = data.toString(); // Convert Buffer to string
}
console.error(`stderr: ${data}`);
if (data.toString().includes("serving proxy")) {
if (process.platform == "linux" && !settingWarp["tun"]) {
exec("bash " + path.join(__dirname, "assets", "bash", "set_proxy.sh") + ` ${settingWarp["proxy"].replace(":", " ")}`);
if (await testProxy()) {
ConnectedWarp();
}
}
else if (process.platform == "win32" && !settingWarp["tun"]) {
console.log("set proxy");
setProxy(settingWarp["proxy"]);
if (await testProxy()) {
ConnectedWarp();
}
}
}
else if (data.toString().includes("CORE STARTED:")) {
Expand Down Expand Up @@ -121,10 +133,10 @@ function FindBestEndpointWarp(type = 'find') {
sect == "main" ? Showmess(3000, "Finded Best Endpoint. Reconnecting") : ("");
}
});
}
};
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
};
async function testProxy() {
console.log("Testing Proxy...");
var startTime = Date.now();
Expand Down Expand Up @@ -168,7 +180,7 @@ async function testProxy() {
testproxystat = false;
return false;
}
}
};
const setProxy = async (proxy) => {
console.log("Set proxy...")
const proxyKey = new Winreg({
Expand Down Expand Up @@ -230,6 +242,20 @@ function ConnectedVibe(stat = "normal") {
StatusGuard = true;
RefreshLinks();
}
function ConnectedWarp(stat = "normal") {
console.log("Connected Warp");
// function runed when the proxy is connected
sect == "main" ? SetAttr("changeStatus-vibe", "style", "box-shadow:0px 0px 50px 10px rgba(98, 255, 0, 0.7);") : ("")
sect == "main" ? SetAttr("changeStatus-vibe", "style", "animation:;") : ("")
sect == "main" ? SetHTML("status-vibe-conn", "🚀 Connected") : ('');
sect == "main" ? SetAnim("ChangeStatus", "Load") : ("");
sect == "main" ? SetBorderColor("ChangeStatus", "#15ff00") : ("");
if (stat == "normal") {
sect == "main" ? Showmess(5000, "🚀!Connected To Warp!🚀") : ("");
trackEvent("connected-warp");
}
StatusGuard = true;
}
function disconnectVPN() {
// function runed when the proxy is disconnected
//Kill the HiddifyCli.exe process
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Freedom Guard (Mahsa Version) 1.3.0 </title>
<title>Freedom Guard (Hananeh Version) 1.3.1 </title>
<link href="boxicons.min.css" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
<link rel="icon" href="ico.png" type="image/png">
Expand All @@ -23,7 +23,7 @@
<div class="text" style="margin-bottom: 10vh;" id="text-loading-1">LOADING...</div>
<div class="text" style="margin-bottom: 10vh;" id="text-loading-2">LOADING...</div>
<img src="./assets/iran.jpg" style="justify-self: flex-start;margin-top: auto;" height="25%" id="" alt="">
<p>به یاد مهسا امینی </p>
<p>به یاد حنانه کیا </p>
<div id="text-hashtag" dir="rtl" style="justify-content: flex-end;margin-right: 2vw;color:red;">
#زن_زندگی_آزادی</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ "name": "freedom-guard",
"productName": "Freedom Guard",
"description": "Warp + Psiphon + Freedom Vibe + Freedom Browser",
"description": "Warp + Psiphon + Freedom Vibe + Freedom Browser + Freedom Plus",
"keywords": [],
"main": "./main.js",
"version": "1.3.0",
"version": "1.3.1",
"author": "fwldom <[email protected]>",
"scripts": {
"start": "npx electron .",
Expand Down
9 changes: 8 additions & 1 deletion renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,14 @@ function Onload() {
ipc.send("load-browser", "");
}, 1500);
}
}
};
// Load Background
backgroundList = ["1.jpg", "2.png","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg"];
function getRandomImage() {
const randomIndex = Math.floor(Math.random() * backgroundList.length);
return "assets/background/" + backgroundList[randomIndex];
};
document.body.style.backgroundImage = `url(${getRandomImage()}), linear-gradient(180deg, #252C37 0%, rgba(35, 31, 88, 0.5) 35%, rgba(0, 212, 255, 0.4) 100%)`;
};
// #endregion
// #region Functions other
Expand Down
2 changes: 0 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ body {
animation: rotateBackground 10s ease infinite;
background: #4e0544;
background-size: cover;
background-image: url(assets/world.png), linear-gradient(180deg, #252C37 0%, rgba(35, 31, 88, 0.5) 35%, rgba(0, 212, 255, 0.4) 100%);

}


Expand Down

0 comments on commit 182e984

Please sign in to comment.