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 Level 1
Browse files Browse the repository at this point in the history
  • Loading branch information
fwldom committed Sep 25, 2024
1 parent d7feefb commit 24df283
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 51 deletions.
2 changes: 1 addition & 1 deletion connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function KillProcess(core = "warp") {
}
};
function changeISP(newisp) {
console.log("NEW ISP IS:" + newisp)
console.log("NEW ISP IS: " + newisp)
settingWarp["isp"] = newisp;
saveSetting();
Onloading();
Expand Down
15 changes: 9 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<!-- #region Freedom Warp => setting & main -->
<h2 id="Status" title="false"></h2>
<button id="ChangeStatus" class="bx-spin-hover"><i class="bx bx-power-off"></i></button>
<button class="menu-show" id="menu-show"><i class="bx bx-menu-alt-left"></i></button>
<button class="menu-show" id="menu-show"><i class="bx bx-menu-alt-left bx-flashing-hover"></i></button>
<button class="setting-show bx bx-tada-hover" id="setting-show"><i class=" bx bxs-cog"></i></button>
<div class="options">
<p>Gool</p>
Expand All @@ -58,7 +58,7 @@ <h2 id="Status" title="false"></h2>
</label>
</div>
<p id="ip-ping-warp">IP : x.x.x.x | Ping : ms</p>
<div class="box-select-country" id="box-select-country">
<div class="box-select-country" id="box-select-country" style="transition: all 1.3s ease 0s;top: 100vh;">
</div>
<div class="options-select-cfon">
<!-- <p>Psiphon Country</p>
Expand All @@ -77,12 +77,13 @@ <h2 id="Status" title="false"></h2>
<div id="select-isp-other">Other غیره،وای فای</div>
<p>بعدا میتوانید از تنظیمات تغییر دهید</p>
</div>
<div id="setting" style="width: 0;display: none;">
<div id="setting" style="position: absolute; display: flex; transition: all 0.9s ease 0s; right: -150vw;">
<nav id="nav-top" style="position: sticky; top: 0%;
left: 0%;background-color: rgba(82, 80, 116, 0.568);width: 100%;min-height: 7.5vh;z-index: 10;">
left: 0%;display: flex;align-items: center;background: linear-gradient(90deg,rgba(32, 117, 29, 0.7) 5%,rgb(12, 20, 128,0.7) 100%,rgba(128, 97, 12, 0.7) 100%);backdrop-filter: blur(25px);width: 100%;min-height: 7.5vh;z-index: 10;">
<button id="close-setting">
<i class='bx bx-arrow-back'></i>
</button>
<b style="color: #db8522;margin-left: 2vw;font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;font-weight: bold;">Settings Freedom Guard</b>
<button id="about"><i class='bx bxs-info-circle'></i></button>
</nav>
<b>Config Freedom Guard for auto mode</b>
Expand Down Expand Up @@ -188,17 +189,19 @@ <h2 id="Status" title="false"></h2>
</label>
</div>
<div id="reset-setting-warp">
<button id="change-background-warp-btn" class="btn">Change background</button>
<button id="reset-setting-warp-btn" class="btn">Reset setting Warp</button>
</div>
</div>
<div id="menu">
<div id="menu" style="position: absolute; display: flex; transition: all 1.3s ease 0s; left: -110vw;">
<div id="menu-dns">Set DNS</div>
<div id="menu-freedom-browser">Freedom Browser</div>
<div id="menu-freedom-vibe">Freedom Vibe</div>
<div id="menu-freedom-plus">Freedom Plus</div>
<div id="menu-website">Website App</div>
<div id="menu-about">About App</div>
<div id="menu-exit">Exit Menu</div>
<div id="menu-exit-app">Exit Freedom Guard</div>
</div>
<!-- #endregion Warp -->
<!-- #region Freedom Vibe => main & setting-->
Expand Down Expand Up @@ -242,7 +245,7 @@ <h2 id="Status" title="false"></h2>
<i class='bx bx-arrow-back'></i>
</button>
</nav>
<b>Config URL vless,vmess,url file,...</b>
<b>Config URL vless,vmess,url file,trojan ...</b>
<div id="config-vibe" class="form-control-c">
<input placeholder="config URL: https://|vless://" class="input input-alt" type="text"
id="config-vibe-text">
Expand Down
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ ipc.on('load-browser', (event) => {
ipc.on('load-url-browser', (event, url) => {
ViewBrowser.webContents.loadURL(url);
});
ipc.on('exit-app', (event) => {
mainWindow.close();
app.exit();
});
ipc.on('load-file', (event, Pathfile) => {
mainWindow.loadFile(path.join(__dirname, Pathfile));
});
Expand Down
18 changes: 8 additions & 10 deletions plus/listapps.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"Calculator": {
{ "Calculator": {
"name": "Calculator",
"icon": "https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/icon.png",
"directory":"./apps/Calculator",
"directory": "./apps/Calculator",
"type": "app",
"description": "A simple calculator app",
"version": "1.0.0",
"author": "Fwldom",
"website": "https://github.com/Fwldom/Calculator",
"license": "MIT",
"download":{
"index.js":"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/index.js",
"index.html":"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/index.html",
"style.css":"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/style.css",
"icon.png":"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/icon.png"
}
"files": [
"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/index.js",
"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/index.html",
"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/style.css",
"https://raw.githubusercontent.com/fwldom/Calculator_Web.github.io/main/icon.png"]
}
}
}
26 changes: 15 additions & 11 deletions plus/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ fetch('listapps.json')
if (!fs.existsSync(path.join(__dirname, './apps'))) {
fs.mkdirSync(path.join(__dirname, "./apps"));
};
downloadFiles([
{ "url": app["download"]["index.html"], "savePath": path.join(__dirname, app.directory, "index.html") },
{ "url": app["download"]["style.css"], "savePath": path.join(__dirname, app.directory, "style.css") },
{ "url": app["download"]["icon.png"], "savePath": path.join(__dirname, app.directory, "icon.png") },
{ "url": app["download"]["index.js"], "savePath": path.join(__dirname, app.directory, "index.js") },
], app = app)

}
var Files = [];
for (let key in app["files"]) {
Files[key] = app.files[key];
}
console.log(Files);
downloadFiles(Files, app = app)
}
})
.catch(error => console.error('Error loading apps:', error));

Expand Down Expand Up @@ -101,19 +100,24 @@ read_file = function (path) {
write_file = function (path, output) {
fs.writeFileSync(path, output);
};
function getFileNameFromUrl(url) {
const parts = url.split('/');
return parts[parts.length - 1];
}
async function downloadFiles(filesToDownload, app) {
showDownloadDialog();

let completed = 0;
const totalFiles = filesToDownload.length;

for (const file of filesToDownload) {
await checkAndDownloadFile(file.url, file.savePath);
for (var file of filesToDownload) {
console.log(file);
await checkAndDownloadFile(file, path.join(__dirname,"./apps/",app.name,getFileNameFromUrl(file)));
completed++;
const progress = (completed / totalFiles) * 100;
downloadProgress.value = progress;
downloadStatus.innerText = `در حال دانلود: ${completed}/${totalFiles} فایل`;
if (!fs.existsSync(file.savePath)) {
if (!fs.existsSync(path.join(__dirname,"./apps/",app.name,getFileNameFromUrl(file)))) {
alert("Error Download Files Try Again");
hideDownloadDialog();
return;
Expand Down
63 changes: 44 additions & 19 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var { Onloading, connectVibe, connectWarp, setProxy, offProxy, settingWarp, Conn
__dirname = __dirname.replace("app.asar", "")
var Psicountry = ["IR", "AT", "BE", "BG", "BR", "CA", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "HU", "HR", "IE", "IN", "IT", "JP", "LV", "NL", "NO", "PL", "PT", "RO", "RS", "SE", "SG", "SK", "UA", "US"];
var PsicountryFullname = ["Auto Server", "Austria", "Belgium", "Bulgaria", "Brazil", "Canada", "Switzerland", "Czech Republic", "Germany", "Denmark", "Estonia", "Spain", "Finland", "France", "United Kingdom", "Hungary", "Croatia", "Ireland", "India", "Italy", "Japan", "Latvia", "Netherlands", "Norway", "Poland", "Portugal", "Romania", "Serbia", "Sweden", "Singapore", "Slovakia", "Ukraine", "United States"];
var backgroundList = ["1.jpg", "2.png", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpg", "12.jpg"];
// #endregion
// #region all Listener
document.addEventListener("DOMContentLoaded", () => {
Expand All @@ -51,16 +52,23 @@ document.addEventListener("DOMContentLoaded", () => {
saveSetting();
};
document.getElementById("box-select-country-mini").addEventListener("click", () => {
if (document.getElementById("box-select-country").style.display == "grid") {
document.getElementById("box-select-country").style.display = "none";
if (document.getElementById("box-select-country").style.top != "100vh") {
document.getElementById("box-select-country").style.height = "0%";
document.getElementById("box-select-country").style.top = "100vh";
} else {
document.getElementById("box-select-country").style.height = "75%";
document.getElementById("box-select-country").style.display = "grid";
document.getElementById("box-select-country").style.top = "10vh";
}
saveSetting();
});
document.getElementById("close-setting").onclick = () => {
document.getElementById("setting").style.display = "none";
document.getElementById("setting-vibe").style.display = "none";
document.getElementById("setting").style.position = "absolute"
document.getElementById("setting").style.right = "-150vw";
document.getElementById("setting").style.visibility = "0.3";
setTimeout(() => {
document.getElementById("setting").style.display = "";
}, 1300);
};
document.getElementById("selector-ip-version").onchange = () => {
SetServiceWarp("ipver", document.getElementById("selector-ip-version").value.match(/\d+/g)).toString();
Expand Down Expand Up @@ -124,6 +132,9 @@ document.addEventListener("DOMContentLoaded", () => {
saveSetting();
SetSettingWarp();
};
document.getElementById("change-background-warp-btn").onclick = () => {
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 For Connections Warp
Expand Down Expand Up @@ -231,13 +242,12 @@ function Onload() {
}
};
// Load Background
backgroundList = ["1.jpg", "2.png","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.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%)`;
};
function getRandomImage() {
const randomIndex = Math.floor(Math.random() * backgroundList.length);
return "assets/background/" + backgroundList[randomIndex];
};
// #endregion
// #region Functions other
function SetAnim(id, anim) {
Expand Down Expand Up @@ -396,16 +406,22 @@ document.getElementById("isp-text-guard").addEventListener("change", () => {
document.getElementById("select-isp-mci").addEventListener("click", () => {
document.getElementById("isp-text-guard").value = "MCI"
changeISP(document.getElementById("isp-text-guard").value);
settingWarp["isp"] = document.getElementById("isp-text-guard").value;
saveSetting();
document.getElementById("select-isp").style.display = "none";
});
document.getElementById("select-isp-irancell").addEventListener("click", () => {
document.getElementById("isp-text-guard").value = "IRANCELL"
changeISP(document.getElementById("isp-text-guard").value);
settingWarp["isp"] = document.getElementById("isp-text-guard").value;
saveSetting();
document.getElementById("select-isp").style.display = "none";
});
document.getElementById("select-isp-other").addEventListener("click", () => {
document.getElementById("isp-text-guard").value = "other"
changeISP(document.getElementById("isp-text-guard").value);
settingWarp["isp"] = document.getElementById("isp-text-guard").value;
saveSetting();
document.getElementById("select-isp").style.display = "none";
});
document.getElementById("vpn-type-selected").addEventListener("change", () => {
Expand All @@ -425,15 +441,10 @@ document.getElementById("reserved-status").addEventListener("change", () => {
else SetServiceWarp("reserved", false);
});
document.getElementById("setting-show").addEventListener("click", () => {
document.getElementById("setting").style.transition = "1s";
if (document.getElementById("setting").style.display == "none") {
CloseAllSections();
document.getElementById("setting").style.display = "flex";
document.getElementById("setting").style.width = "";
} else {
document.getElementById("setting").style.width = "0%";
document.getElementById("setting").style.display = "";
}
document.getElementById("setting").style.display = "flex";
document.getElementById("setting").style.position = "absolute";
document.getElementById("setting").style.right = "";
document.getElementById("setting").style.visibility = "1";
});
document.getElementById("setting-show-vibe").addEventListener("click", () => {
if (document.getElementById("setting-vibe").style.display == "") {
Expand Down Expand Up @@ -461,6 +472,10 @@ document.getElementById("close-about").addEventListener("click", () => { documen
// #region Section Menu
document.getElementById("menu-show").onclick = () => {
document.getElementById("menu").style.display = "flex";
document.getElementById("menu").style.transition = "1.3s";
document.getElementById("menu").style.position = "absolute";
document.getElementById("menu").style.left = "";
document.getElementById("menu").style.visibility = "1";
};
document.getElementById("menu-freedom-vibe").onclick = () => {
Loading("");
Expand All @@ -474,7 +489,16 @@ document.getElementById("menu-freedom-plus").onclick = () => {
};
document.getElementById("menu-dns").onclick = () => { document.getElementById("dns-set").style.display = "flex" };
document.getElementById("menu-exit").onclick = () => {
document.getElementById("menu").style.display = "";
document.getElementById("menu").style.transition = "1.3s";
document.getElementById("menu").style.position = "absolute"
document.getElementById("menu").style.left = "-110vw";
document.getElementById("menu").style.visibility = "0.3";
setTimeout(() => {
document.getElementById("menu").style.display = "";
}, 1300);
};
document.getElementById("menu-exit-app").onclick = () => {
ipc.send("exit-app", "")
};
//#endregion
// #region Section Freedom-Vibe
Expand Down Expand Up @@ -653,6 +677,7 @@ function SetDNS(dns1, dns2) {
const { ipcRenderer } = require('electron');
const { randomBytes } = require("crypto");
const { setTimeout } = require("timers/promises");
const { Console } = require("console");
ipcRenderer.on('start-vibe', (event, ev) => {
ResetArgsVibe();
LoadVibe();
Expand Down
30 changes: 26 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*///////////////////////////////////////////*/
/* Start Code*/
/* #region warp */
body {
Expand All @@ -8,8 +9,8 @@ body {
flex-wrap: wrap;
overflow: hidden;
height: 98vh;
transition: 0.7s;
background-repeat: no-repeat;
animation: rotateBackground 10s ease infinite;
background: #4e0544;
background-size: cover;
}
Expand Down Expand Up @@ -255,8 +256,8 @@ h2 {
}

.box-select-country>div:hover {
background-color: #5900ff;
transition: 0.5s;
background-color: #5900ffab;
transition: 0.8s;
}

.box-select-country>div>* {
Expand Down Expand Up @@ -1007,6 +1008,8 @@ select option {
}
#menu>div {
width: 75%;
height: 8.3vh;
padding: 0.3vh;
}
}

Expand Down Expand Up @@ -1057,6 +1060,25 @@ select option {
border: none;
border-radius: 7px;
}
::-webkit-scrollbar {
width: 1.5vw;
}

::-webkit-scrollbar-track {
background: linear-gradient(180deg, rgba(95, 80, 15, 0.678) 15%, rgb(20, 7, 77) 50%, rgba(7, 97, 119, 0.7) 75%);
border-radius: 0px;
}

::-webkit-scrollbar-thumb {
background: #386b41a6;
backdrop-filter: blur(55px);
border-radius: 0px;
}

::-webkit-scrollbar-thumb:hover {
background: #0b68807a;
}

/* #endregion */
/* End Code*/
/* End Code*/
/*/////////////////////////////////////////*/

0 comments on commit 24df283

Please sign in to comment.