Skip to content

Build your personal knowledge base with Trilium Notes

feat(desktop/setup): add background effects

Elian Dorancd97e2c861b2
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index cf17b810b2..5c533939c6 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -245,6 +245,11 @@ body.setup {
}
}
+body.setup.background-effects,
+body.setup.background-effects .setup-container {
+ background: transparent;
+}
+
@keyframes lds-ring {
0% {
transform: rotate(0deg);
diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx
index 02e6a3d299..7b5393450a 100644
--- a/apps/client/src/setup.tsx
+++ b/apps/client/src/setup.tsx
@@ -26,7 +26,7 @@ async function main() {
bodyWrapper.classList.add("setup-outer-wrapper");
document.body.classList.add("setup");
if (isElectron()) {
- document.body.classList.add("electron");
+ document.body.classList.add("electron", `platform-${window.process.platform}`, "background-effects");
}
render(<App />, bodyWrapper);
document.body.replaceChildren(bodyWrapper);
@@ -51,7 +51,7 @@ function renderState(state: State, setState: (state: State) => void) {
}
function App() {
- const [state, setState] = useState<State>("syncFromDesktop");
+ const [state, setState] = useState<State>("selectLanguage");
const [prevState, setPrevState] = useState<State | null>(null);
const [transitioning, setTransitioning] = useState(false);
const prevStateRef = useRef<State>(state);
@@ -365,21 +365,21 @@ function SyncFromDesktop({ setState }: { setState: (state: State) => void }) {
onBack={() => setState("firstOptions")}
>
<div class="card-columns">
- <Card heading="On the other device">
- <CardSection>1. {t("setup.sync-from-desktop-step1")}</CardSection>
- <CardSection>2. {t("setup.sync-from-desktop-step2")}</CardSection>
- <CardSection>3. {t("setup.sync-from-desktop-step3")}</CardSection>
+ <Card heading="On the other device">
+ <CardSection>1. {t("setup.sync-from-desktop-step1")}</CardSection>
+ <CardSection>2. {t("setup.sync-from-desktop-step2")}</CardSection>
+ <CardSection>3. {t("setup.sync-from-desktop-step3")}</CardSection>
<CardSection>4. {t("setup.sync-from-desktop-step4")}</CardSection>
- <CardSection>5. {t("setup.sync-from-desktop-step5")}</CardSection>
- </Card>
+ <CardSection>5. {t("setup.sync-from-desktop-step5")}</CardSection>
+ </Card>
- {networkAddresses.length > 0 && (
- <Card heading={t("setup.your-ip-addresses")} className="ip-addresses">
- {networkAddresses.map((addr) => (
+ {networkAddresses.length > 0 && (
+ <Card heading={t("setup.your-ip-addresses")} className="ip-addresses">
+ {networkAddresses.map((addr) => (
<CardSection key={addr}>{addr}</CardSection>
- ))}
- </Card>
- )}
+ ))}
+ </Card>
+ )}
</div>
<div class="sync-from-desktop-waiting">
diff --git a/apps/server/src/services/window.ts b/apps/server/src/services/window.ts
index bf9f7fd033..af41a9e66d 100644
--- a/apps/server/src/services/window.ts
+++ b/apps/server/src/services/window.ts
@@ -395,6 +395,9 @@ async function createSetupWindow() {
autoHideMenuBar: true,
title: "Trilium Notes Setup",
icon: getIcon(),
+ // Background effects (Mica on Windows, vibrancy on macOS)
+ ...(isWindows && { backgroundMaterial: "mica" as const }),
+ ...(isMac && { transparent: true, visualEffectState: "active" as const, vibrancy: "under-window" as const }),
webPreferences: {
// necessary for e.g. utils.isElectron()
nodeIntegration: true,