Skip to content

Commit 233f79a

Browse files
committed
Working buttons
- plus small UI tweaks
1 parent 4346f90 commit 233f79a

21 files changed

Lines changed: 460 additions & 43 deletions

client/src/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ body {
1313
padding: 0;
1414
}
1515

16+
body.modal-open {
17+
position: fixed;
18+
width: 100%;
19+
overflow: hidden;
20+
}
21+
1622
p {
1723
margin: 0;
1824
}

client/src/components/page-layout/PageLayout.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
background-image: url("../../assets/brand-background-top-corner.svg");
2020
background-size: contain;
2121
background-repeat: no-repeat;
22-
filter: blur(2px);
22+
filter: blur(4px);
2323
pointer-events: none;
2424
z-index: 0;
2525
}

client/src/components/section/Section.module.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
display: grid;
33
grid-template-columns: 1fr max-content;
44
gap: 7rem;
5+
margin-block-start: 4.5rem;
56
}
67

78
.section {
@@ -18,7 +19,11 @@
1819
width: fit-content;
1920
}
2021

21-
.sectionContent button {
22+
.sectionContent > img:first-child {
23+
margin-bottom: var(--bolt-space-2);
24+
}
25+
26+
.sectionContent > :is(button, a) {
2227
margin-top: var(--bolt-space-6);
2328
}
2429

client/src/components/section/Section.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
import type { JSX } from "preact/jsx-runtime";
2-
import { Button } from "../../design/button/Button";
32
import { Heading1 } from "../../design/heading/Heading";
43
import { TextBlock } from "../../design/text-block/TextBlock";
54

65
import styles from "./Section.module.css";
76

87
export interface SectionProps {
98
iconUrl: string;
9+
iconSize?: number;
1010
title: string;
1111
description: string;
12-
experience: {
13-
url: string;
14-
label: string;
15-
};
12+
action: JSX.Element;
1613
preview: JSX.Element | JSX.Element[];
1714
}
1815

1916
export function Section(props: SectionProps) {
20-
const { iconUrl, title, description, experience, preview } = props;
17+
const { iconUrl, iconSize, title, description, action, preview } = props;
2118
return (
2219
<section className={styles.section}>
2320
<div className={styles.sectionContent}>
24-
<img src={iconUrl} height={80} alt="Swipe-able Ads" />
21+
<img src={iconUrl} height={iconSize ?? 80} alt={title} />
2522
<Heading1 large>{title}</Heading1>
2623
<TextBlock size="large">{description}</TextBlock>
2724

28-
<Button>{experience.label}</Button>
25+
{action}
2926
</div>
3027

3128
{preview}

client/src/components/top-nav/TopNav.module.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
padding: var(--bolt-space-4) var(--bolt-space-8);
33
background-color: var(--bolt-surface-primary);
44
box-shadow: var(--global-shadow2);
5+
position: sticky;
6+
top: 0;
7+
z-index: 100;
58
}
69

710
.navLeft {

client/src/design/button/Button.module.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
padding: var(--bolt-space-3) var(--bolt-space-5);
44
background-color: var(--bolt-surface-inverse-primary);
55
color: var(--bolt-content-inverse-primary);
6+
font-size: var(--bolt-font-body-small-size);
7+
text-decoration: none;
8+
cursor: pointer;
9+
display: inline-flex;
10+
align-items: center;
11+
gap: var(--bolt-space-2);
612
}
713

814
.button:hover {
@@ -12,3 +18,7 @@
1218
.button:active {
1319
background-color: var(--bolt-surface-inverse-primary-pressed);
1420
}
21+
22+
.button:disabled {
23+
cursor: not-allowed;
24+
}

client/src/design/button/Button.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ import type { JSX } from "preact/jsx-runtime";
22

33
import styles from "./Button.module.css";
44

5-
export type ButtonProps = JSX.HTMLAttributes<HTMLButtonElement>;
5+
export type ButtonProps = JSX.HTMLAttributes<HTMLButtonElement> & {
6+
disabled?: boolean;
7+
};
68

79
export function Button(props: ButtonProps) {
810
return <button {...props} className={styles.button}></button>;
911
}
12+
13+
export type LinkButtonProps = JSX.AnchorHTMLAttributes<HTMLAnchorElement>;
14+
15+
export function LinkButton(props: LinkButtonProps) {
16+
return <a {...props} className={styles.button}></a>;
17+
}

client/src/design/icons/close.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export function Close({ size = 24 }: { size?: number }) {
2+
return (
3+
<svg
4+
width={size}
5+
height={size}
6+
viewBox="0 0 24 24"
7+
fill="none"
8+
xmlns="http://www.w3.org/2000/svg">
9+
<path
10+
d="M16.5962 5.28247L18.7175 7.40379L7.40381 18.7175L5.28249 16.5962L16.5962 5.28247Z"
11+
fill="currentColor"
12+
/>
13+
<path
14+
d="M18.7175 16.5962L16.5962 18.7175L5.28249 7.40379L7.40381 5.28247L18.7175 16.5962Z"
15+
fill="currentColor"
16+
/>
17+
</svg>
18+
);
19+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export function SpinnerIcon({
2+
size = 66,
3+
className,
4+
}: {
5+
size?: number;
6+
className?: string;
7+
}) {
8+
return (
9+
<svg
10+
width={size}
11+
height={size}
12+
viewBox="0 0 66 66"
13+
fill="none"
14+
xmlns="http://www.w3.org/2000/svg"
15+
className={className}>
16+
<path
17+
d="M62 33C62 36.8083 61.2499 40.5794 59.7925 44.0978C58.3351 47.6163 56.199 50.8132 53.5061 53.5061C50.8132 56.199 47.6163 58.3351 44.0978 59.7925C40.5794 61.2499 36.8083 62 33 62C29.1917 62 25.4206 61.2499 21.9022 59.7925C18.3837 58.3351 15.1868 56.199 12.4939 53.5061C9.801 50.8132 7.66488 47.6163 6.20749 44.0978C4.7501 40.5794 4 36.8083 4 33C4 29.1917 4.75011 25.4206 6.2075 21.9022C7.66489 18.3837 9.80101 15.1868 12.4939 12.4939C15.1868 9.801 18.3837 7.66487 21.9022 6.20749C25.4206 4.7501 29.1917 4 33 4C36.8083 4 40.5794 4.75011 44.0978 6.2075C47.6163 7.66489 50.8132 9.80101 53.5061 12.4939C56.199 15.1868 58.3351 18.3838 59.7925 21.9022C61.2499 25.4206 62 29.1917 62 33L62 33Z"
18+
stroke="currentColor"
19+
strokeOpacity="0.15"
20+
strokeWidth="8"
21+
strokeLinecap="round"
22+
strokeLinejoin="round"
23+
/>
24+
<path
25+
d="M33 4C36.8083 4 40.5794 4.75011 44.0978 6.20749C47.6163 7.66488 50.8132 9.80101 53.5061 12.4939C56.199 15.1868 58.3351 18.3837 59.7925 21.9022C61.2499 25.4206 62 29.1917 62 33"
26+
stroke="currentColor"
27+
strokeWidth="8"
28+
strokeLinecap="round"
29+
strokeLinejoin="round"
30+
/>
31+
</svg>
32+
);
33+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@keyframes spin {
2+
from {
3+
transform: rotate(0deg);
4+
}
5+
to {
6+
transform: rotate(360deg);
7+
}
8+
}
9+
10+
.spinner {
11+
animation: spin 1s linear infinite;
12+
}

0 commit comments

Comments
 (0)