Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/migration to scss #1215

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c9e99d3
feat: migrated to scss
bumyy32 Nov 7, 2024
4b59a00
feat: migration to scss
bumyy32 Nov 8, 2024
a292164
feat: adding demo theme composer
thegrannychaseroperation Nov 8, 2024
cedb61c
feat: removing insert custom styles
thegrannychaseroperation Dec 16, 2024
ee4c564
Merge branch 'main' into feature/migration-to-scss
Hachi-R Jan 16, 2025
f6707a5
lint
Hachi-R Jan 16, 2025
395f77e
refactor: change notifications header to paragraph
Hachi-R Jan 16, 2025
c17839a
feat: add aparence tab to settings page
Hachi-R Jan 17, 2025
e07297f
lint
Hachi-R Jan 17, 2025
fb63ec8
feat: add editor window
Hachi-R Jan 17, 2025
686ec61
Merge branch 'main' into feature/migration-to-scss
Hachi-R Jan 17, 2025
c4f5d17
refactor: remove redundant condition
Hachi-R Jan 17, 2025
71f3409
Merge branch 'main' into feature/migration-to-scss
Hachi-R Jan 17, 2025
3f29a78
fix: show editor devtools in dev
Hachi-R Jan 17, 2025
f539530
Merge branch 'feature/migration-to-scss' of https://github.com/hydral…
Hachi-R Jan 17, 2025
50df388
migration to scss
insxnsive Jan 17, 2025
b9c072e
feat: integrate monaco editor
Hachi-R Jan 17, 2025
fe8f1b4
lint
Hachi-R Jan 17, 2025
ad330bd
Merge branch 'feature/migration-to-scss' of https://github.com/hydral…
insxnsive Jan 17, 2025
691dba2
migration to scss
insxnsive Jan 17, 2025
b0eb7c1
migration to scss
insxnsive Jan 17, 2025
d038398
full migration to scss
insxnsive Jan 17, 2025
138244d
full migration to scss
insxnsive Jan 17, 2025
d1750ff
full migration to scss
insxnsive Jan 17, 2025
62c6071
full migration to scss
insxnsive Jan 17, 2025
2bd4b69
full migration to scss
insxnsive Jan 17, 2025
8192e5d
full migration to scss
insxnsive Jan 17, 2025
855a646
syntax fix
insxnsive Jan 18, 2025
ead094d
Merge branch 'main' into feature/migration-to-scss
Hachi-R Jan 18, 2025
e97a6fe
font syntax fix
insxnsive Jan 18, 2025
3c9d036
@import to @use
insxnsive Jan 18, 2025
1bbf3b2
added "as vars;" + vars.$
insxnsive Jan 18, 2025
d50bb13
fixed everything
insxnsive Jan 18, 2025
ee0e314
css fix
insxnsive Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@electron-toolkit/utils": "^3.0.0",
"@fontsource/noto-sans": "^5.1.0",
"@hookform/resolvers": "^3.9.1",
"@monaco-editor/react": "^4.6.0",
"@primer/octicons-react": "^19.9.0",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@reduxjs/toolkit": "^2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/pt-BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"featured": "Destaques",
"hot": "Populares",
"weekly": "📅 Mais baixados da semana",
"achievements": "🏆 Pra platinar",
"achievements": "🏆 Para platinar",
"surprise_me": "Surpreenda-me",
"no_results": "Nenhum resultado encontrado",
"start_typing": "Comece a digitar para pesquisar…"
Expand Down
7 changes: 7 additions & 0 deletions src/main/events/aparence/open-editor-window.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { registerEvent } from "../register-event";
import { WindowManager } from "@main/services";

const openEditorWindow = async (_event: Electron.IpcMainInvokeEvent) =>
WindowManager.openEditorWindow();

registerEvent("openEditorWindow", openEditorWindow);
1 change: 1 addition & 0 deletions src/main/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import "./user-preferences/authenticate-real-debrid";
import "./download-sources/put-download-source";
import "./auth/sign-out";
import "./auth/open-auth-window";
import "./aparence/open-editor-window";
import "./auth/get-session-hash";
import "./user/get-user";
import "./user/get-blocked-users";
Expand Down
46 changes: 46 additions & 0 deletions src/main/services/window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,52 @@ export class WindowManager {
}
}

public static openEditorWindow() {
if (this.mainWindow) {
const editorWindow = new BrowserWindow({
width: 600,
height: 720,
minWidth: 600,
minHeight: 720,
backgroundColor: "#1c1c1c",
titleBarStyle: process.platform === "linux" ? "default" : "hidden",
...(process.platform === "linux" ? { icon } : {}),
trafficLightPosition: { x: 16, y: 16 },
titleBarOverlay: {
symbolColor: "#DADBE1",
color: "#151515",
height: 34,
},
parent: this.mainWindow,
modal: true,
show: false,
maximizable: true,
resizable: true,
minimizable: true,
webPreferences: {
sandbox: false,
preload: path.join(__dirname, "../preload/index.mjs"),
},
});

editorWindow.removeMenu();

if (is.dev && process.env["ELECTRON_RENDERER_URL"]) {
editorWindow.loadURL(`${process.env["ELECTRON_RENDERER_URL"]}#/editor`);
} else {
editorWindow.loadFile(path.join(__dirname, "../renderer/index.html"), {
hash: "editor",
});
}

editorWindow.once("ready-to-show", () => {
editorWindow.show();
});

if (!app.isPackaged) editorWindow.webContents.openDevTools();
}
}

public static redirect(hash: string) {
if (!this.mainWindow) this.createMainWindow();
this.loadMainWindowURL(hash);
Expand Down
3 changes: 3 additions & 0 deletions src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,7 @@ contextBridge.exposeInMainWorld("electron", {
/* Notifications */
publishNewRepacksNotification: (newRepacksCount: number) =>
ipcRenderer.invoke("publishNewRepacksNotification", newRepacksCount),

/* Editor */
openEditorWindow: () => ipcRenderer.invoke("openEditorWindow"),
});
21 changes: 21 additions & 0 deletions src/renderer/src/_theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$spacing-unit: 8px;

$color-background: #1c1c1c;
$color-dark-background: #151515;
$color-muted: #c0c1c7;
$color-body: #8e919b;
$color-border: rgba(255, 255, 255, 0.15);
$color-success: #1c9749;
$color-danger: #e11d48;
$color-warning: #ffc107;

$opacity-disabled: 0.5;
$opacity-active: 0.7;

$size-body: 14px;
$size-small: 12px;

$z-index-toast: 5;
$z-index-bottom-panel: 3;
$z-index-title-bar: 4;
$z-index-backdrop: 4;
134 changes: 0 additions & 134 deletions src/renderer/src/app.css.ts

This file was deleted.

136 changes: 136 additions & 0 deletions src/renderer/src/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
@use "./scss/variables" as vars;

* {
box-sizing: border-box;
}

::-webkit-scrollbar {
width: 9px;
background-color: vars.$dark-background-color;
}

::-webkit-scrollbar-track {
background-color: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.08);
border-radius: 24px;
}

::-webkit-scrollbar-thumb:hover {
background-color: rgba(255, 255, 255, 0.16);
}

html,
body,
#root,
main {
height: 100%;
}

body {
overflow: hidden;
user-select: none;
font-family: "Noto Sans", sans-serif;
font-size: vars.$body-font-size;
color: vars.$body-color;
margin: 0;
}

button {
padding: 0;
background-color: transparent;
border: none;
font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
margin: 0;
}

p {
line-height: 20px;
}

#root,
main {
display: flex;
}

#root {
flex-direction: column;
}

main {
overflow: hidden;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

label {
font-size: vars.$body-font-size;
}

input[type="number"] {
-moz-appearance: textfield;
}

img {
-webkit-user-drag: none;
}

progress[value] {
-webkit-appearance: none;
}

.app-container {
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}

.app-container__content {
overflow-y: auto;
align-items: center;
display: flex;
flex-direction: column;
position: relative;
height: 100%;
background: linear-gradient(
0deg,
vars.$dark-background-color 50%,
vars.$background-color 100%
);
}

.app-container__title-bar {
display: flex;
width: 100%;
height: 35px;
min-height: 35px;
background-color: vars.$dark-background-color;
align-items: center;
padding: 0 vars.$spacing-unit * 2;
-webkit-app-region: drag;
z-index: vars.$title-bar-z-index;
border-bottom: 1px solid vars.$border-color;
}

.app-container__cloud-text {
background: linear-gradient(270deg, #16b195 50%, #3e62c0 100%);
background-clip: text;
color: transparent;
}
Loading
Loading