Skip to content

Commit

Permalink
Fix render pane + Add some CSS variables for theming
Browse files Browse the repository at this point in the history
  • Loading branch information
nahkd123 committed Oct 9, 2024
1 parent 10f5ca8 commit a5d05e1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion nahara-motion-ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
extra={{ editor }}
on:layoutupdate={e => $currentLayout.layout = e.detail}
/>
<MediaBar />
<MediaBar {editor} />
</div>
<PopupHost />
<MenuHost />
Expand Down
29 changes: 25 additions & 4 deletions nahara-motion-ui/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,28 @@ body, body > div#app {

/* Color scheme */
:root {
/* Colors here!!!! Use the --variable: #rrggbb; format. */
// Base colors
--base-background: #ffffff;
--base-foreground: #000000;
--base-header: #efefef;
--base-border-normal: #d1d1d1;
--base-border-focused: #1d1d1d;

// Pane colors
--pane-pane-header: var(--base-header);
--pane-background: var(--base-background);
--pane-border-normal: var(--base-border-normal);
--pane-border-focused: var(--base-border-focused);

// App bars - Top bar and media bar
--appbars-background: var(--base-header);
--appbars-border: var(--pane-border-normal);

// Controls
--control-background: var(--base-background);
--control-foreground: var(--base-foreground);
--control-border-normal: var(--base-border-normal);
--control-border-focused: var(--base-border-focused);
}

/* Design tokens */
Expand All @@ -34,11 +55,11 @@ body, body > div#app {
white-space: nowrap;
text-overflow: ellipsis;
padding: 4px 8px;
background-color: #ffffff;
border: 1px solid #d1d1d1;
background-color: var(--control-background);
border: 1px solid var(--control-border-normal);

&:hover {
border: 1px solid #2f2f2f;
border: 1px solid var(--control-border-focused);
background-color: #efefef;
box-shadow: inset 0 0 0 1px #efefef, inset 0 0 0 2px #fff;
}
Expand Down
8 changes: 5 additions & 3 deletions nahara-motion-ui/src/ui/bar/MediaBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
import { getSnappingModeType } from "../popup/SnappingPopup";
import SnappingPopup from "../popup/SnappingPopup.svelte";
import TimeDisplay from "./TimeDisplay.svelte";
import type { EditorImpl } from "../../App.svelte";
export let editor: EditorImpl;
const timelineSnapping = snapping.timelineStore;
const seekhead = app.currentSeekheadStore;
const scene = app.currentSceneStore;
const scene = editor.sceneStore;
const playbackState = app.playbackStateStore;
let quickSeekMs: number;
Expand Down Expand Up @@ -75,8 +77,8 @@
.media-bar {
height: 48px;
align-items: center;
background-color: #efefef;
border-top: 1px solid #d1d1d1;
background-color: var(--appbars-background);
border-top: 1px solid var(--appbars-border);
display: grid;
grid-auto-flow: column;
padding: 0 8px;
Expand Down
5 changes: 3 additions & 2 deletions nahara-motion-ui/src/ui/bar/TopBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
findMaxEndTime($currentScene!);
openPopupAt(e.clientX, e.clientY, "Render scene", RenderPane, {
scene: $currentScene,
saveAs: `${$currentScene!.metadata.name ?? 'scene'}.mp4`,
resWidth: $currentScene!.metadata.size.x,
resHeight: $currentScene!.metadata.size.y,
Expand Down Expand Up @@ -124,8 +125,8 @@
<style lang="scss">
.menu-bar {
height: 34px;
background-color: #efefef;
border-bottom: 1px solid #d1d1d1;
background-color: var(--appbars-background);
border-bottom: 1px solid var(--appbars-border);
box-sizing: border-box;
display: flex;
grid-auto-flow: column;
Expand Down
10 changes: 5 additions & 5 deletions nahara-motion-ui/src/ui/pane/TabbedPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,23 @@
<style lang="scss">
.pane {
position: absolute;
border: 1px solid #d1d1d1;
border: 1px solid var(--pane-border-normal);
box-sizing: border-box;
background-color: #fff;
background-color: var(--pane-background);
&.dragging {
z-index: 1;
}
&:hover {
border: 1px solid #1e1e1e;
border: 1px solid var(--pane-border-focused);
}
.titlebar {
display: flex;
flex-direction: row;
height: 34px;
background-color: #efefef;
background-color: var(--pane-pane-header);
overflow-x: scroll;
&::-webkit-scrollbar {
Expand Down Expand Up @@ -224,7 +224,7 @@
}
&.selected {
background-color: #fff;
background-color: var(--pane-background);
}
&.single-tab {
Expand Down
2 changes: 1 addition & 1 deletion nahara-motion-ui/src/ui/render/RenderPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
];
export let scene: IScene = app.getCurrentScene()!;
export let scene: IScene;
export let saveAs = "scene.mp4";
export let resWidth = 1920;
Expand Down

0 comments on commit a5d05e1

Please sign in to comment.