Add Prettier and Prettier-ESLint

This commit is contained in:
Agampreet Singh
2024-07-21 17:04:59 +05:30
parent 55d3e94cf9
commit 1068ed3a55
11 changed files with 670 additions and 364 deletions

10
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,10 @@
{
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnType": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"files.autoSave": "onFocusChange",
"prettier.printWidth": 100,
"vs-code-prettier-eslint.prettierLast": false
}

View File

@@ -1,10 +1,10 @@
import { app, Menu, BrowserWindow, dialog, nativeImage } from "electron";
import { clearActivity, setActivity, loginToRPC } from './rpc.js';
import { clearActivity, setActivity, loginToRPC } from "./rpc.js";
import { initialize, trackEvent } from "@aptabase/electron/main";
import { ElectronBlocker } from "@cliqz/adblocker-electron";
import { getValue } from './store.js';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import { getValue } from "./store.js";
import { fileURLToPath } from "url";
import { dirname } from "path";
import { join } from "path";
import Windows from "./useragents.json" with { type: "json" };
@@ -12,8 +12,8 @@ import checkInternetConnected from "check-internet-connected";
import contextMenu from "electron-context-menu";
import updaterpkg from "electron-updater";
import ElectronDl from "electron-dl";
import menulayout from './menu.js'
import logpkg from 'electron-log';
import menulayout from "./menu.js";
import logpkg from "electron-log";
const { transports, log: _log, functions } = logpkg;
const __filename = fileURLToPath(import.meta.url);
@@ -30,7 +30,7 @@ function createWindow() {
const enterpriseOrNormal = getValue("enterprise-or-normal");
const custompage = getValue("custompage");
const partition = enterpriseOrNormal === "?auth=1" ? "persist:personal" : "persist:work";
const win = new BrowserWindow({
width: 1181,
height: 670,
@@ -41,8 +41,8 @@ function createWindow() {
devTools: true,
partition: partition,
},
});
});
win.setAutoHideMenuBar(getValue("autohide-menubar") === "true");
const splash = new BrowserWindow({
@@ -125,17 +125,13 @@ app.on("web-contents-created", (event, contents) => {
// do not show error
});
if (getValue("discordrpcstatus") === "true") {
setActivity(
`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`
);
setActivity(`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`);
}
return { action: "deny" };
}
} else {
if (getValue("discordrpcstatus") === "true") {
setActivity(
`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`
);
setActivity(`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`);
}
return { action: "allow", overrideBrowserWindowOptions: { width: 1081, height: 610 } };
}
@@ -144,17 +140,11 @@ app.on("web-contents-created", (event, contents) => {
if (getValue("dynamicicons") === "true") {
if (BrowserWindow.getFocusedWindow()) {
if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=file%2cpptx") ||
BrowserWindow.getFocusedWindow()
.webContents.getTitle()
.includes(".pptx")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=file%2cpptx") ||
BrowserWindow.getFocusedWindow().webContents.getTitle().includes(".pptx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/powerpoint-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/powerpoint-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/powerpoint.png")
@@ -164,17 +154,11 @@ app.on("web-contents-created", (event, contents) => {
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=file%2cdocx") ||
BrowserWindow.getFocusedWindow()
.webContents.getTitle()
.includes(".docx")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=file%2cdocx") ||
BrowserWindow.getFocusedWindow().webContents.getTitle().includes(".docx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/word-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/word-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/word.png")
@@ -184,17 +168,11 @@ app.on("web-contents-created", (event, contents) => {
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=file%2cxlsx") ||
BrowserWindow.getFocusedWindow()
.webContents.getTitle()
.includes(".xlsx")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=file%2cxlsx") ||
BrowserWindow.getFocusedWindow().webContents.getTitle().includes(".xlsx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/excel-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/excel-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/excel.png")
@@ -204,17 +182,11 @@ app.on("web-contents-created", (event, contents) => {
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("outlook.live.com") ||
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("outlook.office.com")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("outlook.live.com") ||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("outlook.office.com")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/outlook-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/outlook-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/outlook.png")
@@ -224,17 +196,11 @@ app.on("web-contents-created", (event, contents) => {
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("onedrive.live.com") ||
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("onedrive.aspx")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("onedrive.live.com") ||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("onedrive.aspx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/onedrive-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/onedrive-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/onedrive.png")
@@ -244,14 +210,10 @@ app.on("web-contents-created", (event, contents) => {
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("teams.live.com")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("teams.live.com")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/teams-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/teams-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/teams.png")
@@ -261,14 +223,10 @@ app.on("web-contents-created", (event, contents) => {
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=onenote")
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=onenote")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
join(__dirname, "../assets/icons/apps/onenote-mac.png")
);
app.dock.setIcon(join(__dirname, "../assets/icons/apps/onenote-mac.png"));
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
join(__dirname, "../assets/icons/apps/onenote.png")

View File

@@ -1,12 +1,12 @@
import { app, dialog, BrowserWindow, ShareMenu, clipboard } from "electron";
import { getValue, setValue } from './store.js';
import { getValue, setValue } from "./store.js";
import { ElectronBlocker } from "@cliqz/adblocker-electron";
import { clearActivity, setActivity } from './rpc.js';
import { fileURLToPath } from 'url';
import { clearActivity, setActivity } from "./rpc.js";
import { fileURLToPath } from "url";
import { shell } from "electron";
import { dirname } from 'path';
import { dirname } from "path";
import useragents from "./useragents.json" with { type: "json" }
import useragents from "./useragents.json" with { type: "json" };
import updaterpkg from "electron-updater";
import fetch from "cross-fetch";
import axios from "axios";
@@ -45,9 +45,7 @@ async function checkForUpdates() {
buttons: ["Download", "Close"],
});
if (updatedialog === 0) {
shell.openExternal(
"https://github.com/agam778/MS-365-Electron/releases/latest"
);
shell.openExternal("https://github.com/agam778/MS-365-Electron/releases/latest");
}
}
} else {
@@ -70,18 +68,12 @@ async function openExternalLink(url) {
async function openLogsFolder() {
if (process.platform === "win32") {
await shell.openPath(
"C:\\Users\\" +
process.env.USERNAME +
"\\AppData\\Roaming\\ms-365-electron\\logs\\"
"C:\\Users\\" + process.env.USERNAME + "\\AppData\\Roaming\\ms-365-electron\\logs\\"
);
} else if (process.platform === "darwin") {
await shell.openPath(
"/Users/" + process.env.USER + "/Library/Logs/ms-365-electron/"
);
await shell.openPath("/Users/" + process.env.USER + "/Library/Logs/ms-365-electron/");
} else if (process.platform === "linux") {
await shell.openPath(
"/home/" + process.env.USER + "/.config/ms-365-electron/logs/"
);
await shell.openPath("/home/" + process.env.USER + "/.config/ms-365-electron/logs/");
}
}
@@ -139,8 +131,7 @@ const commonPreferencesSubmenu = [
dialog.showMessageBoxSync({
type: "info",
title: "Websites in New Windows",
message:
"Websites which are targeted to open in new tabs will now open in new windows.",
message: "Websites which are targeted to open in new tabs will now open in new windows.",
buttons: ["OK"],
});
},
@@ -189,7 +180,7 @@ const commonPreferencesSubmenu = [
type: "info",
title: "Custom Home Page",
message:
"You have set the home page to the \"Create\" page. Please restart the app to apply the changes.",
'You have set the home page to the "Create" page. Please restart the app to apply the changes.',
buttons: ["OK"],
});
},
@@ -204,7 +195,7 @@ const commonPreferencesSubmenu = [
type: "info",
title: "Custom Home Page",
message:
"You have set the home page to the \"My Content\" page. Please restart the app to apply the changes.",
'You have set the home page to the "My Content" page. Please restart the app to apply the changes.',
buttons: ["OK"],
});
},
@@ -219,7 +210,7 @@ const commonPreferencesSubmenu = [
type: "info",
title: "Custom Home Page",
message:
"You have set the home page to the \"Apps\" page. Please restart the app to apply the changes.",
'You have set the home page to the "Apps" page. Please restart the app to apply the changes.',
buttons: ["OK"],
});
},
@@ -253,9 +244,7 @@ const commonPreferencesSubmenu = [
message: "Discord RPC has been enabled.",
buttons: ["OK"],
});
setActivity(
`On ${BrowserWindow.getFocusedWindow().webContents.getTitle()}`
);
setActivity(`On ${BrowserWindow.getFocusedWindow().webContents.getTitle()}`);
return;
}
},
@@ -274,10 +263,7 @@ const commonPreferencesSubmenu = [
buttons: ["OK"],
});
return;
} else if (
getValue("autoupdater") === "false" ||
getValue("autoupdater") === undefined
) {
} else if (getValue("autoupdater") === "false" || getValue("autoupdater") === undefined) {
setValue("autoupdater", "true");
dialog.showMessageBoxSync({
type: "info",
@@ -303,10 +289,7 @@ const commonPreferencesSubmenu = [
buttons: ["OK"],
});
return;
} else if (
getValue("dynamicicons") === "false" ||
getValue("dynamicicons") === undefined
) {
} else if (getValue("dynamicicons") === "false" || getValue("dynamicicons") === undefined) {
setValue("dynamicicons", "true");
dialog.showMessageBoxSync({
type: "info",
@@ -332,15 +315,17 @@ const commonPreferencesSubmenu = [
message: "Ads and trackers will no longer be blocked.",
buttons: ["OK"],
});
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => {
BrowserWindow.getAllWindows().forEach(window => {
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch)
.then((blocker) => {
BrowserWindow.getAllWindows().forEach((window) => {
blocker.disableBlockingInSession(window.webContents.session);
});
})
.catch((error) => {
if (error.message !== "Trying to disable blocking which was not enabled") {
console.error(error);
}
});
}).catch((error) => {
if (error.message !== "Trying to disable blocking which was not enabled") {
console.error(error);
}
});
return;
}
if (
@@ -349,17 +334,16 @@ const commonPreferencesSubmenu = [
) {
setValue("blockadsandtrackers", "true");
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => {
BrowserWindow.getAllWindows().forEach(window => {
blocker.enableBlockingInSession(window.webContents.session);
})
dialog.showMessageBoxSync({
type: "info",
title: "Block Ads and Trackers",
message: "Ads and trackers will now be blocked.",
buttons: ["OK"],
});
}
);
BrowserWindow.getAllWindows().forEach((window) => {
blocker.enableBlockingInSession(window.webContents.session);
});
dialog.showMessageBoxSync({
type: "info",
title: "Block Ads and Trackers",
message: "Ads and trackers will now be blocked.",
buttons: ["OK"],
});
});
return;
}
},
@@ -417,9 +401,7 @@ const menulayout = [
{
label: "About MS-365-Electron",
click: async () => {
await openExternalLink(
"https://github.com/agam778/MS-365-Electron"
);
await openExternalLink("https://github.com/agam778/MS-365-Electron");
},
},
{
@@ -452,9 +434,7 @@ const menulayout = [
{
label: "About MS-365-Electron",
click: async () => {
await openExternalLink(
"https://github.com/agam778/MS-365-Electron"
);
await openExternalLink("https://github.com/agam778/MS-365-Electron");
},
},
{
@@ -606,9 +586,7 @@ const menulayout = [
{
label: "Home",
click: () => {
BrowserWindow.getFocusedWindow().loadURL(
`${getValue("enterprise-or-normal")}`
);
BrowserWindow.getFocusedWindow().loadURL(`${getValue("enterprise-or-normal")}`);
},
},
],
@@ -686,9 +664,7 @@ const menulayout = [
partition: "persist:work",
},
});
excelwindow.loadURL(
"https://microsoft365.com/launch/excel?auth=2"
);
excelwindow.loadURL("https://microsoft365.com/launch/excel?auth=2");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://microsoft365.com/launch/excel?auth=2"
@@ -705,9 +681,7 @@ const menulayout = [
partition: "persist:personal",
},
});
excelwindow.loadURL(
"https://microsoft365.com/launch/excel?auth=1"
);
excelwindow.loadURL("https://microsoft365.com/launch/excel?auth=1");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://microsoft365.com/launch/excel?auth=1"
@@ -730,9 +704,7 @@ const menulayout = [
partition: "persist:work",
},
});
powerpointwindow.loadURL(
"https://microsoft365.com/launch/powerpoint?auth=2"
);
powerpointwindow.loadURL("https://microsoft365.com/launch/powerpoint?auth=2");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://microsoft365.com/launch/powerpoint?auth=2"
@@ -749,9 +721,7 @@ const menulayout = [
partition: "persist:personal",
},
});
powerpointwindow.loadURL(
"https://microsoft365.com/launch/powerpoint?auth=1"
);
powerpointwindow.loadURL("https://microsoft365.com/launch/powerpoint?auth=1");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://microsoft365.com/launch/powerpoint?auth=1"
@@ -776,9 +746,7 @@ const menulayout = [
});
outlookwindow.loadURL("https://outlook.office.com/mail/");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://outlook.office.com/mail/"
);
BrowserWindow.getFocusedWindow().loadURL("https://outlook.office.com/mail/");
}
} else if (getValue("enterprise-or-normal") === "?auth=1") {
if (getValue("websites-in-new-window") === "true") {
@@ -791,9 +759,7 @@ const menulayout = [
partition: "persist:personal",
},
});
outlookwindow.loadURL(
"https://office.live.com/start/Outlook.aspx"
);
outlookwindow.loadURL("https://office.live.com/start/Outlook.aspx");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://office.live.com/start/Outlook.aspx"
@@ -816,9 +782,7 @@ const menulayout = [
partition: "persist:work",
},
});
onedrivewindow.loadURL(
"https://microsoft365.com/launch/onedrive?auth=2"
);
onedrivewindow.loadURL("https://microsoft365.com/launch/onedrive?auth=2");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://microsoft365.com/launch/onedrive?auth=2"
@@ -835,9 +799,7 @@ const menulayout = [
partition: "persist:personal",
},
});
onedrivewindow.loadURL(
"https://microsoft365.com/launch/onedrive?auth=1"
);
onedrivewindow.loadURL("https://microsoft365.com/launch/onedrive?auth=1");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://microsoft365.com/launch/onedrive?auth=1"
@@ -860,9 +822,7 @@ const menulayout = [
partition: "persist:work",
},
});
onenotewindow.loadURL(
"https://www.microsoft365.com/launch/onenote?auth=2"
);
onenotewindow.loadURL("https://www.microsoft365.com/launch/onenote?auth=2");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://www.microsoft365.com/launch/onenote?auth=2"
@@ -881,9 +841,7 @@ const menulayout = [
});
onenotewindow.loadURL("https://www.onenote.com/notebooks?auth=1");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://www.onenote.com/notebooks?auth=1"
);
BrowserWindow.getFocusedWindow().loadURL("https://www.onenote.com/notebooks?auth=1");
}
}
},
@@ -904,9 +862,7 @@ const menulayout = [
});
allappswindow.loadURL("https://www.microsoft365.com/apps?auth=2");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://www.microsoft365.com/apps?auth=2"
);
BrowserWindow.getFocusedWindow().loadURL("https://www.microsoft365.com/apps?auth=2");
}
} else if (getValue("enterprise-or-normal") === "?auth=1") {
if (getValue("websites-in-new-window") === "true") {
@@ -921,9 +877,7 @@ const menulayout = [
});
allappswindow.loadURL("https://www.microsoft365.com/apps?auth=1");
} else {
BrowserWindow.getFocusedWindow().loadURL(
"https://www.microsoft365.com/apps?auth=1"
);
BrowserWindow.getFocusedWindow().loadURL("https://www.microsoft365.com/apps?auth=1");
}
}
},

View File

@@ -1,4 +1,4 @@
import useragents from "./useragents.json" with { type: "json" }
import useragents from "./useragents.json" with { type: "json" };
import Store from "electron-store";
const store = new Store();
@@ -32,8 +32,6 @@ getValueOrDefault("custompage", "home");
if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=1") {
setValue("enterprise-or-normal", "?auth=1");
} else if (
getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=2"
) {
} else if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=2") {
setValue("enterprise-or-normal", "?auth=2");
}

View File

@@ -1,33 +1,15 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<title>MS-365-Electron</title>
<link rel="stylesheet" href="./index.css" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="./favicons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./favicons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="./favicons/favicon-16x16.png"
/>
<link rel="apple-touch-icon" sizes="180x180" href="./favicons/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="./favicons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="./favicons/favicon-16x16.png" />
<link rel="manifest" href="./favicons/site.webmanifest" />
<link
rel="mask-icon"
href="./favicons/safari-pinned-tab.svg"
color="#5bbad5"
/>
<link rel="mask-icon" href="./favicons/safari-pinned-tab.svg" color="#5bbad5" />
<link rel="shortcut icon" href="./favicons/favicon.ico" />
<meta name="apple-mobile-web-app-title" content="MS-365-Electron" />
<meta name="application-name" content="MS-365-Electron" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -15,8 +15,7 @@
var c = arguments[b];
if (c)
for (var d in c)
c.hasOwnProperty(d) &&
("object" == typeof c[d] ? deepExtend(a[d], c[d]) : (a[d] = c[d]));
c.hasOwnProperty(d) && ("object" == typeof c[d] ? deepExtend(a[d], c[d]) : (a[d] = c[d]));
}
return a;
}
@@ -29,11 +28,7 @@
d.insertBefore(r, d.firstChild),
(s = r.getContext("2d")),
i();
for (
var c = Math.round((r.width * r.height) / g.density), e = 0;
c > e;
e++
) {
for (var c = Math.round((r.width * r.height) / g.density), e = 0; c > e; e++) {
var f = new n();
f.setStackPos(e), z.push(f);
}
@@ -74,9 +69,7 @@
}
function j() {
if (y) {
(u = a.innerWidth),
(v = a.innerHeight),
s.clearRect(0, 0, r.width, r.height);
(u = a.innerWidth), (v = a.innerHeight), s.clearRect(0, 0, r.width, r.height);
for (var b = 0; b < z.length; b++) z[b].updatePosition();
for (var b = 0; b < z.length; b++) z[b].draw();
G || (t = requestAnimationFrame(j));
@@ -84,11 +77,7 @@
}
function k() {
i();
for (
var a = d.offsetWidth, b = d.offsetHeight, c = z.length - 1;
c >= 0;
c--
)
for (var a = d.offsetWidth, b = d.offsetHeight, c = z.length - 1; c >= 0; c--)
(z[c].position.x > a || z[c].position.y > b) && z.splice(c, 1);
var e = Math.round((r.width * r.height) / g.density);
if (e > z.length)
@@ -120,42 +109,24 @@
g.directionX)
) {
case "left":
this.speed.x = +(
-g.maxSpeedX +
Math.random() * g.maxSpeedX -
g.minSpeedX
).toFixed(2);
this.speed.x = +(-g.maxSpeedX + Math.random() * g.maxSpeedX - g.minSpeedX).toFixed(2);
break;
case "right":
this.speed.x = +(Math.random() * g.maxSpeedX + g.minSpeedX).toFixed(
2
);
this.speed.x = +(Math.random() * g.maxSpeedX + g.minSpeedX).toFixed(2);
break;
default:
(this.speed.x = +(
-g.maxSpeedX / 2 +
Math.random() * g.maxSpeedX
).toFixed(2)),
(this.speed.x = +(-g.maxSpeedX / 2 + Math.random() * g.maxSpeedX).toFixed(2)),
(this.speed.x += this.speed.x > 0 ? g.minSpeedX : -g.minSpeedX);
}
switch (g.directionY) {
case "up":
this.speed.y = +(
-g.maxSpeedY +
Math.random() * g.maxSpeedY -
g.minSpeedY
).toFixed(2);
this.speed.y = +(-g.maxSpeedY + Math.random() * g.maxSpeedY - g.minSpeedY).toFixed(2);
break;
case "down":
this.speed.y = +(Math.random() * g.maxSpeedY + g.minSpeedY).toFixed(
2
);
this.speed.y = +(Math.random() * g.maxSpeedY + g.minSpeedY).toFixed(2);
break;
default:
(this.speed.y = +(
-g.maxSpeedY / 2 +
Math.random() * g.maxSpeedY
).toFixed(2)),
(this.speed.y = +(-g.maxSpeedY / 2 + Math.random() * g.maxSpeedY).toFixed(2)),
(this.speed.x += this.speed.y > 0 ? g.minSpeedY : -g.minSpeedY);
}
}
@@ -221,10 +192,7 @@
b.position.x + b.parallaxOffsetX,
b.position.y + b.parallaxOffsetY
)
: s.lineTo(
b.position.x + b.parallaxOffsetX,
b.position.y + b.parallaxOffsetY
));
: s.lineTo(b.position.x + b.parallaxOffsetX, b.position.y + b.parallaxOffsetY));
}
s.stroke(), s.closePath();
}),
@@ -236,14 +204,10 @@
var b = (v - 0) / 60;
x = (F - -30) * b + 0;
} else (w = A), (x = B);
(this.parallaxTargX =
(w - u / 2) / (g.parallaxMultiplier * this.layer)),
(this.parallaxOffsetX +=
(this.parallaxTargX - this.parallaxOffsetX) / 10),
(this.parallaxTargY =
(x - v / 2) / (g.parallaxMultiplier * this.layer)),
(this.parallaxOffsetY +=
(this.parallaxTargY - this.parallaxOffsetY) / 10);
(this.parallaxTargX = (w - u / 2) / (g.parallaxMultiplier * this.layer)),
(this.parallaxOffsetX += (this.parallaxTargX - this.parallaxOffsetX) / 10),
(this.parallaxTargY = (x - v / 2) / (g.parallaxMultiplier * this.layer)),
(this.parallaxOffsetY += (this.parallaxTargY - this.parallaxOffsetY) / 10);
}
var c = d.offsetWidth,
e = d.offsetHeight;
@@ -326,8 +290,7 @@
return "object" != typeof a && a
? void 0
: this.each(function () {
f.data(this, "plugin_" + e) ||
f.data(this, "plugin_" + e, new d(this, a));
f.data(this, "plugin_" + e) || f.data(this, "plugin_" + e, new d(this, a));
});
});
})(window, document),
@@ -344,8 +307,7 @@
)
(window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"]),
(window.cancelAnimationFrame =
window[b[c] + "CancelAnimationFrame"] ||
window[b[c] + "CancelRequestAnimationFrame"]);
window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"]);
window.requestAnimationFrame ||
(window.requestAnimationFrame = function (b) {
var c = new Date().getTime(),

View File

@@ -3,8 +3,7 @@ body {
text-rendering: optimizeLegibility;
font-family: "proxima-nova-soft", sans-serif;
-webkit-user-select: none;
overflow: hidden;
}
body .vertical-centered-box {
position: absolute;
width: 100%;

View File

@@ -69,7 +69,9 @@
"devDependencies": {
"electron": "^31.0.0",
"electron-builder": "^24.6.3",
"eslint": "^9.0.0"
"eslint": "^8.52.0",
"prettier": "^3.1.0",
"prettier-eslint": "^16.1.2"
},
"dependencies": {
"@aptabase/electron": "^0.3.1",

View File

@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
"extends": ["config:base"]
}

657
yarn.lock

File diff suppressed because it is too large Load Diff