Skip to content

Commit

Permalink
feat: Update form styles (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker authored May 28, 2024
1 parent cf2b2ef commit 5591a26
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const year = new Date().getFullYear();

<footer>
<span class="copyright"
>&copy; 2022&hairsp;&ndash;&hairsp;{year} Namesake</span
>
><strong>&copy; Namesake</strong> 2022&hairsp;&ndash;&hairsp;{year}
</span>
<div class="social">
<a
href="https://www.instagram.com/joinnamesake/"
Expand Down
79 changes: 27 additions & 52 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Footer from "../components/Footer.astro";
<Header />
<main>
<Image
class="desktop-illustration"
class="illustration"
src={image}
alt="Some snails and flowers on top of a court order document"
width={600}
Expand All @@ -27,13 +27,6 @@ import Footer from "../components/Footer.astro";
>
</h1>
<div class="subhead">
<Image
class="mobile-illustration"
src={image}
alt="Some snails and flowers on top of a court order document"
width={400}
densities={[1, 2]}
/>
<p>
<strong>Legally changing name and gender is a challenge.</strong> You have
to navigate the courts, fill out dense paperwork, and tackle steps in a
Expand All @@ -57,7 +50,7 @@ import Footer from "../components/Footer.astro";
</p>
</div>
<form>
<p>Get notified when we launch:</p>
<strong>Get notified when we launch:</strong>
<div class="input-group">
<input type="email" name="email" placeholder="Your email" required />
<button type="submit">Subscribe <RiArrowRightLine /></button>
Expand Down Expand Up @@ -93,14 +86,15 @@ import Footer from "../components/Footer.astro";
underline.show();
}

const form = document.querySelector("form");
const form: HTMLElement | null = document.querySelector("form");
if (form) {
const box = annotate(form, {
type: "box",
const highlight = annotate(form, {
type: "highlight",
iterations: 1,
padding: 20,
animate: false,
iterations: 3,
});
box.show();
highlight.show();
}
</script>

Expand All @@ -116,26 +110,12 @@ import Footer from "../components/Footer.astro";
max-width: 1200px;
margin-inline: auto;

.mobile-illustration {
display: none;
}

@media (width < 800px) {
display: block;
overflow: hidden;

.desktop-illustration {
.illustration {
display: none;
}

.mobile-illustration {
display: block;
float: right;
max-width: 60%;
margin-left: var(--space-m);
margin-bottom: var(--space-m);
margin-right: -20%;
}
}
}

Expand All @@ -157,16 +137,18 @@ import Footer from "../components/Footer.astro";
}

.who-you-are {
color: var(--pink-7);
color: var(--background);
}

.subhead p + p {
margin-top: var(--space-l);
}

form {
color: var(--background);

margin-block-start: var(--space-xl);
padding: var(--space-m);
padding: var(--space-l) var(--space-m);

@media (width < 540px) {
width: 100%;
Expand All @@ -179,40 +161,33 @@ import Footer from "../components/Footer.astro";
margin-block-start: var(--space-s);
}

input {
input,
button {
border: none;
border-bottom: 2px solid var(--gray-12);
background: transparent;
padding: 0;
background: var(--background);
border-radius: var(--radius-s);
color: var(--gray-12);
padding: var(--space-xs) var(--space-s);

&:focus-visible {
outline-color: var(--background);
}
}

input {
flex: 1;
border-radius: 0;

&::placeholder {
color: var(--gray-a9);
}
}

button {
background: transparent;
border: 2px solid var(--gray-12);
color: var(--gray-12);
font-weight: 600;
cursor: pointer;
padding: var(--space-2xs) var(--space-m);
display: inline-flex;
gap: var(--space-2xs);
align-items: center;

@media (hover: hover) {
&:hover {
background: var(--gray-12);
color: var(--pink-6);
}
}

&:focus-visible {
background: var(--gray-12);
color: var(--pink-6);
}
padding-inline: var(--space-m);
}
</style>
7 changes: 6 additions & 1 deletion src/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@
--letter-spacing-loose: 0.01em;

/* Radii */
--radius-sm: 2px;
--radius-s: var(--space-s);
--radius-m: var(--space-m);
--radius-l: var(--space-l);

/* Background */
--background: var(--pink-7);
}

0 comments on commit 5591a26

Please sign in to comment.