Refactor Password Generator page layout and add reusable PageTitle component

Introduce a new `PageTitle` component to encapsulate the title and description logic, simplifying the `password-generator.astro` page by removing redundant title rendering. This change enhances maintainability and reusability of the title section across different pages.
This commit is contained in:
Patrick Alvin Alcala 2025-06-04 12:18:07 +08:00
parent 982bf1f262
commit 27974d63df

View file

@ -2,15 +2,12 @@
import Layout from '../layouts/Layout.astro'
import PasswordGeneratorComponent from '../components/Password-Generator/PasswordGeneratorComponent.tsx'
import { RiSystemLockPasswordLine } from 'solid-icons/ri'
import PageTitle from '../components/PageTitle/PageTitle'
---
<Layout title="Password Generator - AIO Tools">
<div class="page">
<section class="title">
<RiSystemLockPasswordLine class="title__icon" opacity={1} />
<h1 class="title__text">Password Generator</h1>
<p class="title__description">Generate a strong and secure password for your accounts online.</p>
</section>
<PageTitle title="Password Generator" description="Generate a strong and secure password for your accounts online." />
<section class="content">
<PasswordGeneratorComponent client:load />
@ -22,7 +19,6 @@ import { RiSystemLockPasswordLine } from 'solid-icons/ri'
@use '/src/assets/css/viewport.sass' as view
.page
font-family: 'Inter', sans-serif
text-align: center
margin: 4rem 0 0 0
transition: margin 0.4s ease-in-out
@ -30,26 +26,8 @@ import { RiSystemLockPasswordLine } from 'solid-icons/ri'
@media screen and (max-width: view.$tablet)
margin-top: 1rem
.title
color: #ffffff
&__text
font-size: clamp(1.2rem, 5vw, 2.4rem)
margin-bottom: 1rem
&__description
font-size: clamp(0.5rem, 2vw, 1rem)
opacity: 0.6
margin-bottom: 3rem
&__icon
font-size: clamp(2rem, 5vw, 4rem)
.content
display: flex
justify-content: center
align-items: center
// border: 1px solid #ffffff
// padding: 2rem
// border-radius: 8px
</style>