feat: add profile setup, verification, and authentication context
- Implement ProfileSetup component for user profile creation with username validation. - Create ProtectedRoute component to guard routes based on authentication status. - Add VerifyAuthCode component for email verification with resend functionality. - Establish AuthContext for managing user authentication state and actions. - Enhance CookieContext for consent management with server-side verification. - Set up Firebase configuration for authentication and analytics. - Update styles for authentication components and header layout. - Configure Vite proxy for API requests during development.
This commit is contained in:
@@ -21,20 +21,32 @@
|
||||
}
|
||||
|
||||
.nav {
|
||||
@include flex-center();
|
||||
justify-content: space-between;
|
||||
padding: 16px 20px;
|
||||
max-width: map-get($breakpoints, xl);
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
column-gap: 14px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 14px clamp(24px, 4vw, 72px);
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.nav-brand {
|
||||
justify-self: start;
|
||||
min-width: 0;
|
||||
|
||||
a {
|
||||
font-size: map-get($font-sizes, xl);
|
||||
font-size: clamp(1.3rem, 2.1vw, map-get($font-sizes, xl));
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
@include gradient-text();
|
||||
@include transition();
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
max-width: 44vw;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&:hover {
|
||||
transform: scale(1.05);
|
||||
@@ -42,63 +54,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
.nav-menu {
|
||||
display: flex;
|
||||
gap: 32px;
|
||||
|
||||
a {
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
@include link-hover();
|
||||
}
|
||||
|
||||
&.mobile-menu {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: calc(100vh - 80px);
|
||||
background: var(--bg-primary);
|
||||
flex-direction: column;
|
||||
padding: 40px 20px;
|
||||
gap: 24px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
@include box-shadow(large);
|
||||
@include transition(transform opacity);
|
||||
|
||||
&.open {
|
||||
top: 80px;
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&:not(.open) {
|
||||
transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
font-size: map-get($font-sizes, lg);
|
||||
padding: 16px 0;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
}
|
||||
.nav-spacer {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.nav-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
gap: 6px;
|
||||
justify-self: end;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.theme-toggle,
|
||||
.menu-toggle,
|
||||
.language-toggle {
|
||||
.language-toggle,
|
||||
.auth-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
min-height: auto;
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
@include transition();
|
||||
@@ -127,30 +103,202 @@
|
||||
}
|
||||
}
|
||||
|
||||
.menu-toggle {
|
||||
display: none;
|
||||
.auth-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: map-get($font-sizes, sm);
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
min-width: 110px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@include respond-to(md) {
|
||||
display: block;
|
||||
.auth-toggle--logout {
|
||||
color: #dc2626;
|
||||
border: 1px solid rgba(220, 38, 38, 0.35);
|
||||
background: rgba(220, 38, 38, 0.08);
|
||||
|
||||
&:hover {
|
||||
color: #ffffff;
|
||||
background: #dc2626;
|
||||
}
|
||||
}
|
||||
|
||||
.desktop-menu {
|
||||
@include respond-to(md) {
|
||||
display: none;
|
||||
.auth-avatar {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--border-color);
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-secondary);
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 0.84rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-drawer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
background: var(--bg-primary);
|
||||
border-top: 1px solid var(--border-color);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
@include transition(max-height opacity);
|
||||
|
||||
&.open {
|
||||
max-height: 86px;
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-drawer-list {
|
||||
margin: 0;
|
||||
padding: 14px clamp(24px, 4vw, 72px);
|
||||
list-style: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: clamp(12px, 1.1vw, 22px);
|
||||
overflow-x: auto;
|
||||
scrollbar-width: thin;
|
||||
|
||||
a {
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
font-size: 0.96rem;
|
||||
padding: 4px 0;
|
||||
white-space: nowrap;
|
||||
@include link-hover();
|
||||
|
||||
&.is-active {
|
||||
color: #1d4ed8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive
|
||||
@include respond-to(md) {
|
||||
@media (max-width: 1400px) {
|
||||
.header {
|
||||
.nav {
|
||||
padding: 12px 16px;
|
||||
padding: 12px clamp(14px, 2.4vw, 30px);
|
||||
}
|
||||
|
||||
.mobile-menu {
|
||||
display: flex !important;
|
||||
.auth-toggle {
|
||||
min-width: 36px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.auth-toggle-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.logout-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-drawer-list {
|
||||
padding: 10px clamp(14px, 2.4vw, 30px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1401px) {
|
||||
.header {
|
||||
.logout-text {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.header {
|
||||
.nav {
|
||||
padding: 12px 14px;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
}
|
||||
|
||||
.nav-brand a {
|
||||
max-width: 58vw;
|
||||
}
|
||||
|
||||
.language-toggle .language-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.auth-toggle,
|
||||
.language-toggle {
|
||||
min-width: 36px;
|
||||
padding: 8px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-drawer {
|
||||
position: fixed;
|
||||
top: 64px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: calc(100vh - 64px);
|
||||
border-bottom: none;
|
||||
transform: translateX(100%);
|
||||
max-height: none;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
@include transition(transform opacity);
|
||||
|
||||
&.open {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-drawer-list {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: 0;
|
||||
padding: 18px 16px;
|
||||
|
||||
li {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
padding: 14px 0;
|
||||
font-size: map-get($font-sizes, lg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user