mirror of
https://github.com/TxtDot/vigi.git
synced 2024-11-23 11:56:21 +03:00
feat: add top bar layout, move all styles into css and classes
This commit is contained in:
parent
1169d77e4e
commit
eb2c014016
6 changed files with 66 additions and 15 deletions
45
src/app.css
45
src/app.css
|
@ -2,8 +2,49 @@
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
.window {
|
:root {
|
||||||
@apply bg-gray-900 text-slate-200;
|
--c0: #274f21;
|
||||||
|
--c1: #448939;
|
||||||
|
--c2: #73bf67;
|
||||||
|
|
||||||
|
--c3: #193815;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
@apply bg-main text-main;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-window {
|
||||||
@apply p-3 gap-3 w-screen h-screen;
|
@apply p-3 gap-3 w-screen h-screen;
|
||||||
@apply grid grid-cols-8;
|
@apply grid grid-cols-8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.main-window {
|
||||||
|
@apply col-span-6 flex flex-col gap-3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browser-window {
|
||||||
|
@apply grow shadow-inner;
|
||||||
|
}
|
||||||
|
|
||||||
|
.window-controls {
|
||||||
|
@apply flex justify-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
@apply p-1 rounded-lg;
|
||||||
|
@apply ease-out duration-150;
|
||||||
|
|
||||||
|
@apply hover:bg-main;
|
||||||
|
@apply hover:px-2 hover:mx-1 hover:scale-125 hover:cursor-pointer;
|
||||||
|
|
||||||
|
@apply active:bg-dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block {
|
||||||
|
@apply p-3 rounded-xl bg-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
@apply col-span-2;
|
||||||
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
export let className = "";
|
export let className = "";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="p-3 rounded-xl bg-gray-700{className ? ` ${className}` : ''}">
|
<div class="block{className ? ` ${className}` : ''}">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
export let onClick = () => {};
|
export let onClick = () => {};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button
|
<button class="button" on:click={onClick}>
|
||||||
class="hover:cursor-pointer hover:bg-gray-800 active:bg-gray-900 p-1 rounded-lg"
|
|
||||||
on:click={onClick}
|
|
||||||
>
|
|
||||||
<slot />
|
<slot />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { appWindow } from "@tauri-apps/api/window";
|
import { appWindow } from "@tauri-apps/api/window";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex justify-start" data-tauri-drag-region>
|
<div class="window-controls" data-tauri-drag-region>
|
||||||
<Button onClick={() => appWindow.close()}>
|
<Button onClick={() => appWindow.close()}>
|
||||||
<Close />
|
<Close />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -4,9 +4,13 @@
|
||||||
import "../app.css";
|
import "../app.css";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="window" data-tauri-drag-region>
|
<div class="common-window" data-tauri-drag-region>
|
||||||
<Block className="col-span-2">
|
<Block className="sidebar">
|
||||||
<WindowControls />
|
<WindowControls />
|
||||||
</Block>
|
</Block>
|
||||||
<Block className="col-span-6">Browser window</Block>
|
<div class="main-window">
|
||||||
|
<Block className="top-bar">Top bar</Block>
|
||||||
|
|
||||||
|
<Block className="browser-window">Browser window</Block>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
content: ['./src/**/*.{html,js,svelte,ts}'],
|
content: ["./src/**/*.{html,js,svelte,ts}"],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {
|
||||||
|
colors: {
|
||||||
|
main: "var(--c0)",
|
||||||
|
block: "var(--c1)",
|
||||||
|
light: "var(--c2)",
|
||||||
|
dark: "var(--c3)",
|
||||||
|
},
|
||||||
|
textColor: {
|
||||||
|
main: "var(--c2)",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue