Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "Start Dev Server",
"label": "Astro Dev Server",
"type": "shell",
"command": "npm run dev",
"runOptions": {
Expand All @@ -11,7 +11,6 @@
"presentation": {
"clear": true,
"close": true,
"focus": true,
"panel": "dedicated",
"showReuseMessage": false
}
Expand All @@ -32,7 +31,7 @@
"type": "shell",
"command": "npx prettier --write ${file}",
"presentation": {
"close": true
"showReuseMessage": false
}
}
]
Expand Down
118 changes: 59 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const yearString = currentYear === baseYear ? baseYear.toString() : `${baseYear}
@media screen and (width<=850px) {
footer > div {
flex-direction: column;
font-size: 1rem;
font-size: var(--font-size-small);
gap: 0;
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/components/FormField.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
import '../styles/form_field.css'

const { id, type, name, label } = Astro.props
---

<Fragment>
<div class="form-field">
<input type={type} id={id} name={name} required />
<label for={id}>{label}</label>
</div>
</Fragment>
5 changes: 1 addition & 4 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const { canSearch = false } = Astro.props || {}

<style>
h1 {
font-size: var(--font-size-title);
text-wrap: nowrap;
}

Expand Down Expand Up @@ -77,10 +78,6 @@ const { canSearch = false } = Astro.props || {}
margin: 0;
}

h1 {
font-size: 1.75rem;
}

svg {
width: calc(1.5 * var(--spacing-medium));
height: calc(1.5 * var(--spacing-medium));
Expand Down
36 changes: 36 additions & 0 deletions src/components/PasswordField.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
const { id, name, label } = Astro.props
import IconShowPassword from '../assets/icon/eye.svg'
import IconHidePassword from '../assets/icon/eye-off.svg'
---

<Fragment>
<div class="form-field">
<div class="input-with-icon">
<input type="password" id={id} name={name} required />
<label for={id}>{label}</label>
<div class="icons" title="Toggle password visibility">
<IconShowPassword class="show-password" />
<IconHidePassword class="hide-password" />
</div>
</div>
</div>
</Fragment>

<style>
.hide-password {
display: none;
}

.icons {
cursor: pointer;
}

.input-with-icon {
display: flex;
}

.show-password {
color: #888;
}
</style>
22 changes: 22 additions & 0 deletions src/components/PasswordRequirements.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
import PasswordRequirementsCheck from './PasswordRequirementsCheck.astro'
---

<div id="password-requirements">
<h3>Password requirements</h3>
<ul>
<PasswordRequirementsCheck description="At least 12 characters long." />
<PasswordRequirementsCheck description="Contains at least one uppercase letter (A-Z)." />
<PasswordRequirementsCheck description="Contains at least one lowercase letter (a-z)." />
<PasswordRequirementsCheck description="Contains at least one digit (0-9)." />
<PasswordRequirementsCheck
description="Contains at least one special character (non-alphanumeric)."
/>
</ul>
</div>

<style>
ul {
list-style: none;
}
</style>
40 changes: 40 additions & 0 deletions src/components/PasswordRequirementsCheck.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
import IconCheck from '../assets/icon/check.svg'
import IconX from '../assets/icon/x.svg'

const { description } = Astro.props
---

<Fragment>
<li>
<IconCheck class="password-requirement-check" />
<IconX class="password-requirement-x" />
<span>{description}</span>
</li>
</Fragment>

<style>
li {
display: flex;
gap: var(--spacing-small);
align-items: center;
}

.password-requirement-check,
.password-requirement-x {
width: 1.75rem;
min-width: 1.75rem;
}

.password-requirement-check {
color: var(--color-success);
}

.password-requirement-x {
color: var(--color-error);
}

.password-requirement-check {
display: none;
}
</style>
2 changes: 1 addition & 1 deletion src/components/RecipeCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function randint(min: number, max: number) {

<style>
h1 {
font-size: calc(1.5 * var(--spacing-medium));
font-size: var(--font-size-title);
}

.recipe-polaroid {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchBar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { placeholder } = Astro.props
border: none;
border-bottom: 2px solid var(--color-primary);
flex: 1;
font-size: 1.5rem;
font-size: var(--font-size-body);
outline: none;
}

Expand Down
Loading