Skip to content

Commit de9a3b2

Browse files
committed
add omnibox mockup and change some of the colors
1 parent 4b088a7 commit de9a3b2

File tree

3 files changed

+104
-14
lines changed

3 files changed

+104
-14
lines changed

frontend/src/Omnibox.tsx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import type { Component } from "dreamland/core";
2+
import { Icon } from "./ui/Icon";
3+
import type { IconifyIcon } from "@iconify/types";
4+
import iconBack from "@ktibow/iconset-material-symbols/arrow-back";
5+
import iconForwards from "@ktibow/iconset-material-symbols/arrow-forward";
6+
import iconRefresh from "@ktibow/iconset-material-symbols/refresh";
7+
import iconExtension from "@ktibow/iconset-material-symbols/extension";
8+
9+
export const Spacer: Component = function (cx) {
10+
cx.css = `
11+
:scope {
12+
width: 2em;
13+
}
14+
`;
15+
return <div></div>;
16+
};
17+
18+
export const UrlInput: Component = function (cx) {
19+
cx.css = `
20+
:scope {
21+
flex: 1;
22+
display: flex;
23+
padding: 0.25em;
24+
}
25+
input {
26+
width: 100%;
27+
height: 100%;
28+
border: none;
29+
outline: none;
30+
border-radius: 4px;
31+
}
32+
`;
33+
return (
34+
<div>
35+
<input></input>
36+
</div>
37+
);
38+
};
39+
40+
export const IconButton: Component<{ icon: IconifyIcon }> = function (cx) {
41+
cx.css = `
42+
:scope {
43+
padding: 0.4em;
44+
display: flex;
45+
outline: none;
46+
border: none;
47+
font-size: 1.25em;
48+
background: inerhit
49+
# background: var(--aboutbrowser-toolbar-bg);
50+
cursor: pointer;
51+
}
52+
`;
53+
return (
54+
<button>
55+
<Icon icon={this.icon} />
56+
</button>
57+
);
58+
};
59+
60+
export const Omnibox: Component<{}> = function (cx) {
61+
cx.css = `
62+
:scope {
63+
background: var(--aboutbrowser-omnibox-bg);
64+
display: flex;
65+
padding: 0px 7px 0px 7px;
66+
}
67+
`;
68+
69+
return (
70+
<div>
71+
<IconButton icon={iconBack}></IconButton>
72+
<IconButton icon={iconForwards}></IconButton>
73+
<IconButton icon={iconRefresh}></IconButton>
74+
<Spacer></Spacer>
75+
<UrlInput></UrlInput>
76+
<Spacer></Spacer>
77+
<IconButton icon={iconExtension}></IconButton>
78+
</div>
79+
);
80+
};

frontend/src/browser.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createState, type Stateful } from "dreamland/core";
22
import { ThemeVars, type Theme } from "./ui/theme";
33
import { Tab, Tabs } from "./tabs";
4+
import { Omnibox } from "./Omnibox";
45

56
class StatefulClass {
67
constructor(state: Stateful<any>) {
@@ -16,22 +17,22 @@ export class Browser extends StatefulClass {
1617
super(state);
1718

1819
this.theme = {
19-
frame_bg: [40, 40, 40],
20-
toolbar_bg: [60, 60, 60],
21-
toolbar_button_fg: [199, 199, 199],
22-
toolbar_fg: [199, 199, 199],
20+
frame_bg: [231, 238, 245],
21+
toolbar_bg: [211, 218, 255],
22+
toolbar_button_fg: [65, 72, 76],
23+
toolbar_fg: [65, 72, 76],
2324

2425
inactive_tab_bg: [40, 40, 40],
25-
inactive_tab_fg: [199, 199, 199],
26-
active_tab_fg: [227, 227, 227],
26+
inactive_tab_fg: [95, 92, 96],
27+
active_tab_fg: [65, 72, 76],
2728

28-
button_bg: [60, 60, 60],
29+
button_bg: [231, 238, 0],
2930

30-
ntp_bg: [60, 60, 60],
31+
ntp_bg: [231, 238, 0],
3132
ntp_fg: [232, 234, 237],
3233
ntp_link_fg: [138, 180, 248],
3334

34-
omnibox_bg: [40, 40, 40],
35+
omnibox_bg: [221, 228, 235],
3536
omnibox_fg: [227, 227, 227],
3637

3738
bookmark_fg: [199, 199, 199],
@@ -46,6 +47,7 @@ export class Browser extends StatefulClass {
4647
<div>
4748
<ThemeVars colors={use(this.theme)} />
4849
<Tabs />
50+
<Omnibox />
4951
</div>
5052
);
5153
}

frontend/src/tabs.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Tab: Component<
5252
5353
color: var(--aboutbrowser-inactive-tab-fg);
5454
55-
border-radius: 10px;
55+
border-radius: 4px;
5656
padding: 7px 8px 5px 8px;
5757
5858
display: flex;
@@ -66,7 +66,7 @@ export const Tab: Component<
6666
.main span {
6767
flex: 1;
6868
font-size: 13px;
69-
69+
7070
overflow: hidden;
7171
white-space: nowrap;
7272
text-overflow: ellipsis;
@@ -87,7 +87,7 @@ export const Tab: Component<
8787
background: var(--aboutbrowser-active-tab-bg);
8888
color: var(--aboutbrowser-active-tab-fg);
8989
90-
border-radius: 12px 12px 0 0;
90+
# border-radius: 12px 12px 0 0;
9191
}
9292
9393
.belowcontainer {
@@ -185,9 +185,9 @@ export const Tab: Component<
185185
<span>{use(this.title)}</span>
186186
<Icon class="close" icon={iconClose} />
187187
</div>
188-
<div class="belowcontainer">
188+
{/* <div class="belowcontainer">
189189
{use(this.active).andThen(<div class="below"></div>)}
190-
</div>
190+
</div> */}
191191
</div>
192192
</div>
193193
);
@@ -349,6 +349,14 @@ export const Tabs: Component<
349349
funcs={tabfuncs}
350350
/>
351351
) as ComponentInstance<typeof Tab>,
352+
(
353+
<Tab
354+
active={false}
355+
icon="/vite.svg"
356+
title="ViteViteViteViteViteVite Vite Vite Vite"
357+
funcs={tabfuncs}
358+
/>
359+
) as ComponentInstance<typeof Tab>,
352360
];
353361

354362
cx.mount = () => {

0 commit comments

Comments
 (0)