Skip to content

Commit

Permalink
header design
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz Nowak committed Oct 15, 2023
1 parent 74fb524 commit dcbe25b
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 21 deletions.
23 changes: 23 additions & 0 deletions src/components/connect/connect.css.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { style } from "@vanilla-extract/css";
import { vars } from "~/theme.css";

export const connect = style({
fontSize: "16px",
fontWeight: "bold",
border: "1px solid",
borderColor: vars.color.blue,
borderRadius: "8px",
color: vars.color.blue,
paddingTop: "4px",
paddingBottom: "4px",
paddingLeft: "12px",
paddingRight: "12px",
transition: "background-color, color",
transitionDuration: vars.transitions.duration,
transitionTimingFunction: vars.transitions.timingFunction,
":hover": {
backgroundColor: vars.color.blue,
color: vars.color.background,
},
cursor: "pointer",
});
6 changes: 6 additions & 0 deletions src/components/connect/connect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { component$ } from "@builder.io/qwik";
import { connect } from "./connect.css";

export const Connect = component$(() => {
return <div class={connect}>Connect</div>;
});
43 changes: 42 additions & 1 deletion src/components/header/header.css.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
import { style } from "@vanilla-extract/css";
import { vars } from "~/theme.css";

export const header = style({});
export const headerGrid = style({
display: "grid",
gridAutoFlow: "column",
gap: "8px",
justifyItems: "center",
justifyContent: "center",
alignItems: "center",
});

export const header = style([
headerGrid,
{
paddingLeft: "8px",
paddingRight: "8px",
height: "100%",
gridTemplateColumns: "auto 1fr auto",
},
]);

export const leftSide = style([
headerGrid,
{
gridColumnStart: "1",
gridColumnEnd: "2",
},
]);

export const rightSide = style([
headerGrid,
{
gridColumnStart: "3",
gridColumnEnd: "4",
},
]);

export const title = style({
fontWeight: "bolder",
letterSpacing: "1px",
fontSize: "20px",
color: vars.color.subtext,
});
20 changes: 18 additions & 2 deletions src/components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { component$ } from "@builder.io/qwik";
import { header } from "./header.css";
import { header, leftSide, rightSide, title } from "./header.css";
import { Connect } from "../connect/connect";
import BellSvg from "~/media/icons/dark_theme/bell.svg?jsx";
import { IconButton } from "~/components/iconButton/iconButton";

export const Header = component$(() => {
return <div class={header}></div>;
return (
<div class={header}>
<div class={leftSide}>
<div class={title}>KSOX Finance</div>
</div>
<div class={rightSide}>
<IconButton>
<BellSvg q:slot="icon"></BellSvg>
{/* <div q:slot="text">Home</div> */}
</IconButton>
<Connect></Connect>
</div>
</div>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ export const button = style({
alignItems: "center",
padding: "8px",
borderRadius: "8px",
transition: "background-color 0.3s ease-in-out",
transition: "background-color",
transitionDuration: vars.transitions.duration,
transitionTimingFunction: vars.transitions.timingFunction,
":hover": {
backgroundColor: vars.color.backgroundHighlight,
},
cursor: "pointer",
});

export const iconSlot = style({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Slot, component$ } from "@builder.io/qwik";
import { button, iconSlot } from "./button.css";
import { button, iconSlot } from "./iconButton.css";

export const Button = component$(() => {
export const IconButton = component$(() => {
return (
<div class={button}>
<div class={iconSlot}>
Expand Down
26 changes: 13 additions & 13 deletions src/components/sidenav/sidenav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { component$ } from "@builder.io/qwik";
import { sidenav } from "./sidenav.css";
import { Button } from "./button";
import { IconButton } from "~/components/iconButton/iconButton";

import HomeSvg from "~/media/icons/dark_theme/logo.svg?jsx";
import TransferSvg from "~/media/icons/dark_theme/transfer.svg?jsx";
Expand All @@ -12,30 +12,30 @@ import SettingsSvg from "~/media/icons/dark_theme/settings.svg?jsx";
export const SideNav = component$(() => {
return (
<div class={sidenav}>
<Button>
<IconButton>
<HomeSvg style={{ height: "24px" }} q:slot="icon"></HomeSvg>
{/* <div q:slot="text">Home</div> */}
</Button>
<Button>
</IconButton>
<IconButton>
<TransferSvg q:slot="icon"></TransferSvg>
{/* <div q:slot="text">Home</div> */}
</Button>
<Button>
</IconButton>
<IconButton>
<ChartSvg q:slot="icon"></ChartSvg>
{/* <div q:slot="text">Home</div> */}
</Button>
<Button>
</IconButton>
<IconButton>
<WalletSvg q:slot="icon"></WalletSvg>
{/* <div q:slot="text">Home</div> */}
</Button>
<Button>
</IconButton>
<IconButton>
<PeopleSvg q:slot="icon"></PeopleSvg>
{/* <div q:slot="text">Home</div> */}
</Button>
<Button>
</IconButton>
<IconButton>
<SettingsSvg q:slot="icon"></SettingsSvg>
{/* <div q:slot="text">Home</div> */}
</Button>
</IconButton>
</div>
);
});
4 changes: 4 additions & 0 deletions src/media/icons/dark_theme/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default component$(() => {
});

export const head: DocumentHead = {
title: "Ksox Finance",
title: "KSOX Finance",
meta: [
{
name: "description",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/layout.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const layoutRow = style({
width: "100vw",
height: "100vh",
display: "grid",
gridTemplateRows: "36px 1fr",
gridTemplateRows: "auto 1fr",
backgroundColor: vars.color.backgroundHighlight,
gap: "1px",
});
Expand Down
8 changes: 8 additions & 0 deletions src/theme.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const [darkTheme, vars] = createTheme({
subtext: "#838383", // Subtext (For lesser important text)
divider: "#2b2b2b", // Border/Divider Color
},
transitions: {
duration: "0.1s",
timingFunction: "ease-in-out",
},
});

export const lightTheme = createTheme(vars, {
Expand All @@ -24,4 +28,8 @@ export const lightTheme = createTheme(vars, {
subtext: "#5c5c5c", // Subtext (For lesser important text)
divider: "#e5e5e5", // Border/Divider Color
},
transitions: {
duration: "0.1s",
timingFunction: "ease-in-out",
},
});

0 comments on commit dcbe25b

Please sign in to comment.