-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps/earth): adds root page and implements daisyui
- Loading branch information
1 parent
49ba582
commit 9e92668
Showing
17 changed files
with
349 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
import { ClassSlot, component$, HTMLAttributes, Slot } from "@builder.io/qwik"; | ||
import { | ||
ClassSlot, | ||
component$, | ||
HTMLAttributes, | ||
Slot, | ||
useSignal, | ||
} from "@builder.io/qwik"; | ||
|
||
export interface BaseButtonProps extends HTMLAttributes<HTMLButtonElement> { | ||
class?: ClassSlot; | ||
color?: "primary" | "secondary" | "accent"; | ||
size?: "xs" | "sm" | "md" | "lg"; | ||
} | ||
|
||
export const BaseButton = component$<BaseButtonProps>((props) => { | ||
return ( | ||
<button {...props} class={["py-2 px-3", props.class]}> | ||
<span> | ||
export const BaseButton = component$<BaseButtonProps>( | ||
({ color = "primary", size = "md", ...props }) => { | ||
const classes = useSignal({ | ||
primary: "btn-primary", | ||
secondary: "btn-secondary", | ||
accent: "btn-accent", | ||
|
||
xs: "btn-xs", | ||
sm: "btn-sm", | ||
md: "btn-md", | ||
lg: "btn-lg", | ||
}); | ||
|
||
return ( | ||
<button | ||
{...props} | ||
class={["btn", classes.value[color], classes.value[size], props.class]} | ||
> | ||
<Slot /> | ||
</span> | ||
</button> | ||
); | ||
}); | ||
</button> | ||
); | ||
}, | ||
); | ||
|
||
export default BaseButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { component$, Slot, useSignal } from "@builder.io/qwik"; | ||
import { BaseButton, BaseButtonProps } from "./BaseButton"; | ||
|
||
export interface ButtonProps extends BaseButtonProps { | ||
variant?: "contained" | "outlined" | "ghost"; | ||
} | ||
|
||
export const Button = component$<ButtonProps>( | ||
({ variant = "contained", ...props }) => { | ||
const classes = useSignal({ | ||
contained: undefined, | ||
outlined: "btn-outlined", | ||
ghost: "btn-ghost", | ||
}); | ||
|
||
return ( | ||
<BaseButton | ||
{...props} | ||
class={["btn", classes.value[variant], props.class]} | ||
> | ||
<Slot /> | ||
</BaseButton> | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { component$, Slot, useSignal } from "@builder.io/qwik/core"; | ||
import { BaseButton, BaseButtonProps } from "./BaseButton"; | ||
|
||
export interface IconButtonProps extends BaseButtonProps { | ||
variant?: "circle" | "square"; | ||
} | ||
|
||
export const IconButton = component$<IconButtonProps>( | ||
({ variant = "circle", ...props }) => { | ||
const classes = useSignal({ | ||
circle: "btn-circle", | ||
square: "btn-square", | ||
}); | ||
|
||
return ( | ||
<BaseButton | ||
{...props} | ||
class={["btn", classes.value[variant], props.class]} | ||
> | ||
<Slot /> | ||
</BaseButton> | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./BaseButton"; | ||
export * from "./Button"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,5 +37,3 @@ export const Head = component$(() => { | |
</head> | ||
); | ||
}); | ||
|
||
export default Head; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import { component$ } from "@builder.io/qwik"; | ||
import { useNavigate } from "@builder.io/qwik-city"; | ||
import { BaseButton } from "components/button"; | ||
import { Button } from "components/button"; | ||
import { Link } from "components/link"; | ||
import { LinkButton } from "components/link/LinkButton"; | ||
|
||
export const Header = component$(() => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<header class="p-2 flex"> | ||
<div class="flex-1"> | ||
<a onClick$={() => navigate("/")} href="/"> | ||
<header class="navbar flex py-4 px-8 font-mono"> | ||
<div class="navbar-start"> | ||
<Link class="font-mono uppercase" href="/"> | ||
deopea | ||
</a> | ||
</Link> | ||
</div> | ||
<nav class="flex justify-between space-x-2"> | ||
<a>What we do</a> | ||
<a>About Us</a> | ||
<a>The Team</a> | ||
<nav class="navbar-center hidden md:block"> | ||
<LinkButton class="btn-sm">What we do</LinkButton> | ||
<LinkButton class="btn-sm">About Us</LinkButton> | ||
<LinkButton class="btn-sm">The Team</LinkButton> | ||
</nav> | ||
<div class="flex-1 flex justify-end"> | ||
<BaseButton>Contact Us</BaseButton> | ||
<div class="navbar-end"> | ||
<Button variant="outlined" size="sm"> | ||
Contact Us | ||
</Button> | ||
</div> | ||
</header> | ||
); | ||
}); | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ClassSlot, component$, Slot } from "@builder.io/qwik"; | ||
import { | ||
Link as QCLink, | ||
LinkProps as QCLinkProps, | ||
} from "@builder.io/qwik-city"; | ||
|
||
export interface LinkProps extends QCLinkProps { | ||
class?: ClassSlot; | ||
} | ||
|
||
export const Link = component$<LinkProps>((props) => { | ||
return ( | ||
<QCLink {...props} class={["link link-hover", props.class]}> | ||
<Slot /> | ||
</QCLink> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ClassSlot, component$, Slot } from "@builder.io/qwik"; | ||
import { Link, LinkProps } from "@builder.io/qwik-city"; | ||
|
||
export interface LinkButtonProps extends LinkProps { | ||
class?: ClassSlot; | ||
} | ||
|
||
export const LinkButton = component$<LinkButtonProps>((props) => { | ||
return ( | ||
<Link {...props} class={["btn btn-ghost", props.class]}> | ||
<Slot /> | ||
</Link> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./Link"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,67 @@ | ||
const defaultTheme = require("tailwindcss/defaultTheme"); | ||
const typographyPlugin = require("@tailwindcss/typography"); | ||
|
||
/** | ||
* @type {import('tailwindcss').Config} | ||
*/ | ||
module.exports = { | ||
content: ["./src/**/*.{ts,tsx,mdx}"], | ||
plugins: [typographyPlugin], | ||
plugins: [require("@tailwindcss/typography"), require("daisyui")], | ||
daisyui: { | ||
themes: [ | ||
{ | ||
deopea: { | ||
"primary": "#0EA3F4", | ||
"secondary": "#FB2576", | ||
"accent": "#3F0071", | ||
"base-100": "#010101", | ||
"error": "#93000A", | ||
}, | ||
}, | ||
], | ||
}, | ||
theme: { | ||
extend: { | ||
fontFamily: { | ||
mono: ["Space Mono", ...defaultTheme.fontFamily.mono], | ||
sans: ["Quicksand", ...defaultTheme.fontFamily.sans], | ||
}, | ||
colors: { | ||
primary: { | ||
"default": "#ffb3af", | ||
"fg": "#660710", | ||
"container": "#852123", | ||
"container-fg": "#ffdad7", | ||
}, | ||
secondary: { | ||
"default": "#e7bdba", | ||
"fg": "#442928", | ||
"container": "#5d3f3d", | ||
"container-fg": "#ffdad7", | ||
}, | ||
tertiary: { | ||
"default": "#e2c28c", | ||
"fg": "#402d05", | ||
"container": "#594319", | ||
"container-fg": "#ffdea8", | ||
}, | ||
error: { | ||
"default": "#ffb4ab", | ||
"fg": "#93000a", | ||
"container": "#690005", | ||
"container-fg": "#ffdad6", | ||
}, | ||
bg: { | ||
default: "#201a1a", | ||
fg: "#ede0de", | ||
}, | ||
surface: { | ||
"default": "#201a1a", | ||
"fg": "#ede0de", | ||
"variant": "#534342", | ||
"variant-fg": "#d8c2c0", | ||
}, | ||
outline: "#a08c8b", | ||
}, | ||
// colors: { | ||
// primary: { | ||
// "default": "#ffb3af", | ||
// "fg": "#660710", | ||
// "container": "#852123", | ||
// "container-fg": "#ffdad7", | ||
// }, | ||
// secondary: { | ||
// "default": "#e7bdba", | ||
// "fg": "#442928", | ||
// "container": "#5d3f3d", | ||
// "container-fg": "#ffdad7", | ||
// }, | ||
// tertiary: { | ||
// "default": "#e2c28c", | ||
// "fg": "#402d05", | ||
// "container": "#594319", | ||
// "container-fg": "#ffdea8", | ||
// }, | ||
// error: { | ||
// "default": "#ffb4ab", | ||
// "fg": "#93000a", | ||
// "container": "#690005", | ||
// "container-fg": "#ffdad6", | ||
// }, | ||
// bg: { | ||
// default: "#201a1a", | ||
// fg: "#ede0de", | ||
// }, | ||
// surface: { | ||
// "default": "#201a1a", | ||
// "fg": "#ede0de", | ||
// "variant": "#534342", | ||
// "variant-fg": "#d8c2c0", | ||
// }, | ||
// outline: "#a08c8b", | ||
// }, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.