refactor(hero): improve hierarchy and responsive actions
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
justify-content: flex-end;
|
||||
padding: clamp(1.125rem, 2.5vw, 2rem) var(--layout-page-gutter) 0;
|
||||
}
|
||||
|
||||
@@ -31,11 +31,14 @@
|
||||
width: var(--size-icon-button);
|
||||
height: var(--size-icon-button);
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: var(--radius-pill);
|
||||
background: color-mix(in srgb, var(--bg-raised) 82%, transparent);
|
||||
color: var(--color-blue-700);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background-color var(--motion-duration-fast) ease,
|
||||
border-color var(--motion-duration-fast) ease,
|
||||
color var(--motion-duration-fast) ease,
|
||||
transform var(--motion-duration-fast) var(--motion-ease-out);
|
||||
}
|
||||
@@ -71,7 +74,7 @@
|
||||
margin: 0 auto;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
padding-top: clamp(4rem, 6.5vw, 6rem);
|
||||
padding-top: clamp(4rem, 6vw, 5.5rem);
|
||||
padding-bottom: clamp(1.75rem, 3vw, 2.5rem);
|
||||
padding-left: 1.25rem;
|
||||
padding-right: 1.25rem;
|
||||
@@ -115,9 +118,22 @@
|
||||
.heroTitle {
|
||||
margin-bottom: clamp(0.5rem, 1vw, 0.875rem);
|
||||
color: var(--text-primary);
|
||||
font-size: clamp(2rem, 3.6vw, 3.375rem);
|
||||
line-height: 1.15;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: clamp(2rem, 4vw, 3.5rem);
|
||||
line-height: 1.02;
|
||||
text-shadow: none;
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
.heroGreeting {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.42em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.heroName {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -125,10 +141,11 @@
|
||||
.heroSubtitle {
|
||||
margin-bottom: clamp(1.25rem, 2.8vw, 2.25rem);
|
||||
color: var(--text-primary);
|
||||
font-size: clamp(0.6875rem, 1vw, 0.9375rem);
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
max-width: 34rem;
|
||||
color: var(--text-secondary);
|
||||
font-size: clamp(0.9375rem, 1.25vw, 1.125rem);
|
||||
font-weight: 480;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
/* ── Action buttons ─────────────────────────────────────────── */
|
||||
@@ -279,8 +296,8 @@
|
||||
}
|
||||
|
||||
.iconButton {
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
}
|
||||
|
||||
.heroContent {
|
||||
@@ -291,49 +308,36 @@
|
||||
}
|
||||
|
||||
.heroTitle {
|
||||
font-size: clamp(1.625rem, 7.8vw, 2.25rem);
|
||||
white-space: normal;
|
||||
max-width: 17rem;
|
||||
line-height: 1.15;
|
||||
width: 100%;
|
||||
max-width: 21rem;
|
||||
font-size: clamp(1.875rem, 8vw, 2.25rem);
|
||||
line-height: 1.04;
|
||||
}
|
||||
|
||||
.heroSubtitle {
|
||||
white-space: normal;
|
||||
max-width: 15.625rem;
|
||||
font-size: 0.6875rem;
|
||||
letter-spacing: 0.12em;
|
||||
max-width: 18rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.actionButtons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
width: 100%;
|
||||
max-width: 17.25rem;
|
||||
gap: 0.375rem;
|
||||
grid-template-columns: repeat(2, clamp(5rem, 9vw, 7.5rem));
|
||||
width: fit-content;
|
||||
max-width: none;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.heroButtonPrimary {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.heroButton {
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
height: 2.375rem;
|
||||
height: 2.75rem;
|
||||
padding: 0 0.375rem;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.contactBar {
|
||||
flex-direction: column;
|
||||
gap: 0.3125rem;
|
||||
white-space: normal;
|
||||
font-size: 0.71875rem;
|
||||
}
|
||||
|
||||
.contactItem {
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.contactDivider {
|
||||
display: none;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +347,8 @@
|
||||
@media (hover: hover) and (pointer: fine) {
|
||||
.iconButton:hover {
|
||||
color: var(--color-blue-500);
|
||||
border-color: var(--accent-default);
|
||||
background: var(--bg-raised);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import Image from 'next/image';
|
||||
import { Moon, Sun, Languages, Phone } from 'lucide-react';
|
||||
import { Moon, Sun } from 'lucide-react';
|
||||
import { useTheme } from '@/context/ThemeContext';
|
||||
import styles from './HeroSection.module.css';
|
||||
|
||||
@@ -11,13 +11,14 @@ export const HeroSection: React.FC = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.heroContentWrapper}>
|
||||
{/* Top Floating Controls */}
|
||||
{/* Top utility control */}
|
||||
<div className={styles.topBar}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleTheme}
|
||||
className={styles.iconButton}
|
||||
aria-label="Toggle theme"
|
||||
title={`Switch to ${theme === 'light' ? 'Dark' : 'Light'} Mode`}
|
||||
aria-label={`Switch to ${theme === 'light' ? 'dark' : 'light'} mode`}
|
||||
title={`Switch to ${theme === 'light' ? 'dark' : 'light'} mode`}
|
||||
>
|
||||
{theme === 'light' ? (
|
||||
<Moon size={28} strokeWidth={1.8} className={styles.themeIcon} />
|
||||
@@ -25,14 +26,6 @@ export const HeroSection: React.FC = () => {
|
||||
<Sun size={28} strokeWidth={1.8} className={styles.controlIcon} />
|
||||
)}
|
||||
</button>
|
||||
|
||||
<button
|
||||
className={styles.iconButton}
|
||||
aria-label="Switch Language"
|
||||
title="Farsi version coming soon"
|
||||
>
|
||||
<Languages size={28} strokeWidth={2} className={styles.controlIcon} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Hero Central Content */}
|
||||
@@ -55,11 +48,12 @@ export const HeroSection: React.FC = () => {
|
||||
|
||||
{/* Display Typography */}
|
||||
<h1 className={`font-display ${styles.heroTitle}`}>
|
||||
Hi, I'm Amirhossein Khalili
|
||||
<span className={styles.heroGreeting}>Hi, I'm</span>
|
||||
<span className={styles.heroName}>Amirhossein Khalili</span>
|
||||
</h1>
|
||||
|
||||
<p className={styles.heroSubtitle}>
|
||||
A PASSIONATE PRODUCT ENGINEER
|
||||
Product engineer building useful, resilient software.
|
||||
</p>
|
||||
|
||||
{/* Action Buttons */}
|
||||
@@ -75,51 +69,6 @@ export const HeroSection: React.FC = () => {
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{/* Contact Info Strip */}
|
||||
<div className={styles.contactBar}>
|
||||
<a href="mailto:amirhosseinkhalili901@gmail.com" className={styles.contactItem}>
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 24 24"
|
||||
aria-hidden="true"
|
||||
className={styles.contactIcon}
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M3 5h3l6 5 6-5h3v14h-3V9l-6 5-6-5v10H3V5Z"
|
||||
/>
|
||||
</svg>
|
||||
<span>amirhosseinkhalili901@gmail.com</span>
|
||||
</a>
|
||||
|
||||
<div className={styles.contactDivider} />
|
||||
|
||||
<a href="tel:+989388263077" className={styles.contactItem}>
|
||||
<Phone size={20} strokeWidth={1.8} className={`${styles.contactIcon} ${styles.filledIcon}`} />
|
||||
<span>+98 9388263077</span>
|
||||
</a>
|
||||
|
||||
<div className={styles.contactDivider} />
|
||||
|
||||
<div className={styles.contactItem}>
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 24 24"
|
||||
aria-hidden="true"
|
||||
className={styles.contactIcon}
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
fillRule="evenodd"
|
||||
d="M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 4.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
<span>Karaj, Alborz, Iran</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user