page redesigns and init calendar work

This commit is contained in:
Blake Ridgway
2025-11-29 09:59:51 -06:00
parent 3c08445dc6
commit bf72ef4503
13 changed files with 8138 additions and 1042 deletions

View File

@@ -1,174 +1,875 @@
<template>
<div class="login-container">
<div class="login-card">
<h1>Login to RideAware</h1>
<p class="subtitle">Train with Focus. Ride with Awareness</p>
<div class="card-header">
<div class="logo-wrapper">
<svg viewBox="0 0 24 24" fill="none">
<path d="M3 9L12 2L21 9V20C21 20.5304 20.7893 21.0391 20.4142 21.4142C20.0391 21.7893 19.5304 22 19 22H5C4.46957 22 3.96086 21.7893 3.58579 21.4142C3.21071 21.0391 3 20.5304 3 20V9Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/>
<circle cx="12" cy="13" r="2" fill="currentColor"/>
</svg>
</div>
<h1>Welcome Back</h1>
<p class="subtitle">Train with Focus. Ride with Awareness.</p>
</div>
<form @submit.prevent="handleLogin">
<form @submit.prevent="handleLogin" class="login-form">
<!-- Username Field -->
<div class="form-group">
<label for="username">Username</label>
<input
id="username"
v-model="form.username"
type="text"
placeholder="Enter your username"
required
/>
<div class="input-wrapper">
<input
id="username"
v-model="form.username"
type="text"
placeholder="Enter your username"
required
:disabled="auth.loading"
autocomplete="username"
/>
<svg class="input-icon" viewBox="0 0 24 24" fill="none">
<path d="M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="12" cy="7" r="4" stroke="currentColor" stroke-width="2"/>
</svg>
</div>
</div>
<!-- Password Field -->
<div class="form-group">
<label for="password">Password</label>
<input
id="password"
v-model="form.password"
type="password"
placeholder="Enter your password"
required
/>
<div class="input-wrapper">
<input
id="password"
v-model="form.password"
:type="showPassword ? 'text' : 'password'"
placeholder="Enter your password"
required
:disabled="auth.loading"
autocomplete="current-password"
/>
<button
type="button"
@click="showPassword = !showPassword"
class="password-toggle"
:title="showPassword ? 'Hide password' : 'Show password'"
>
<svg v-if="showPassword" viewBox="0 0 24 24" fill="none">
<path d="M1 12S6 4 12 4C18 4 23 12 23 12S18 20 12 20C6 20 1 12 1 12Z" stroke="currentColor" stroke-width="2"/>
<circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="2"/>
</svg>
<svg v-else viewBox="0 0 24 24" fill="none">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20C7 20 2.73 16.46 1 11.64M9.9 4.24C10.94 4.09 11.97 4 12 4C17 4 21.27 7.54 23 12.35" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
<line x1="1" y1="1" x2="23" y2="23" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
</div>
</div>
<!-- Remember Me & Forgot Password -->
<div class="form-options">
<label class="remember-me">
<input v-model="rememberMe" type="checkbox" />
<span>Remember me</span>
</label>
<RouterLink to="/password-reset" class="forgot-password">
Forgot password?
</RouterLink>
</div>
<!-- Login Button -->
<button type="submit" :disabled="auth.loading" class="btn-primary">
{{ auth.loading ? 'Logging in...' : 'Login' }}
<span v-if="auth.loading" class="loading-content">
<svg class="spinner" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" fill="none" opacity="0.25"/>
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" fill="none" stroke-dasharray="31.416" stroke-dashoffset="31.416" opacity="0.75"/>
</svg>
Logging in...
</span>
<span v-else>Login</span>
</button>
</form>
<!-- Error Message -->
<div v-if="auth.error" class="error-message">
{{ auth.error }}
<svg viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2"/>
<line x1="12" y1="8" x2="12" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
<line x1="12" y1="16" x2="12.01" y2="16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
<div>
<p class="error-title">Login Failed</p>
<p class="error-text">{{ auth.error }}</p>
</div>
</div>
<div class="links">
<RouterLink to="/signup">Don't have an account? Sign up</RouterLink>
<RouterLink to="/password-reset">Forgot password?</RouterLink>
<!-- Divider -->
<div class="divider">
<span>Or</span>
</div>
<!-- Sign Up Link -->
<div class="signup-section">
<p>Don't have an account?</p>
<RouterLink to="/signup" class="signup-link">
Sign up now
<svg viewBox="0 0 24 24" fill="none">
<line x1="5" y1="12" x2="19" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
<polyline points="12 5 19 12 12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</RouterLink>
</div>
</div>
<!-- Background Decorations -->
<div class="background-decoration">
<div class="decoration-blob blob-1"></div>
<div class="decoration-blob blob-2"></div>
<div class="decoration-blob blob-3"></div>
</div>
<!-- Bottom Link -->
<div class="bottom-link">
<RouterLink to="/">Back to Home</RouterLink>
</div>
</div>
</template>
<script setup>
import { reactive } from 'vue';
import { useRouter } from 'vue-router';
import { useAuth } from '@/composables/useAuth';
import { reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import { useAuth } from '@/composables/useAuth'
const router = useRouter();
const auth = useAuth();
const router = useRouter()
const auth = useAuth()
const showPassword = ref(false)
const rememberMe = ref(false)
const form = reactive({
username: '',
password: '',
});
password: ''
})
async function handleLogin() {
try {
await auth.login(form.username, form.password);
router.push('/dashboard');
await auth.login(form.username, form.password)
if (rememberMe.value) {
localStorage.setItem('rememberMe', 'true')
localStorage.setItem('username', form.username)
} else {
localStorage.removeItem('rememberMe')
localStorage.removeItem('username')
}
router.push('/dashboard')
} catch (error) {
console.error('Login error:', error);
console.error('Login error:', error)
}
}
</script>
<style scoped>
.login-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 1rem;
position: relative;
overflow: hidden;
}
/* ============================================
LOGIN CARD
============================================ */
.login-card {
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-radius: 2rem;
padding: 3rem;
max-width: 480px;
width: 100%;
max-width: 400px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
border: 1px solid rgba(255, 255, 255, 0.2);
animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
z-index: 10;
}
/* ============================================
CARD HEADER
============================================ */
.card-header {
text-align: center;
margin-bottom: 2rem;
}
.logo-wrapper {
width: 80px;
height: 80px;
margin: 0 auto 1.5rem;
padding: 1.5rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 2rem;
color: white;
display: flex;
align-items: center;
justify-content: center;
animation: logoFloat 0.8s ease-out 0.2s both;
}
.logo-wrapper svg {
width: 100%;
height: 100%;
}
h1 {
margin: 0 0 0.5rem 0;
color: #2c3e50;
font-size: 1.8rem;
margin: 0 0 0.75rem 0;
font-size: 2rem;
font-weight: 800;
color: #1f2937;
animation: titleSlide 0.6s ease-out 0.3s both;
}
.subtitle {
color: #7f8c8d;
margin-bottom: 1.5rem;
margin: 0;
font-size: 1rem;
color: #6b7280;
font-weight: 500;
font-style: italic;
animation: subtitleFade 0.6s ease-out 0.4s both;
}
/* ============================================
LOGIN FORM
============================================ */
.login-form {
display: flex;
flex-direction: column;
gap: 1.5rem;
animation: formSlide 0.6s ease-out 0.5s both;
}
.form-group {
margin-bottom: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
label {
font-weight: 600;
color: #374151;
font-size: 0.95rem;
display: block;
margin-bottom: 0.5rem;
color: #2c3e50;
font-weight: 500;
}
.input-wrapper {
position: relative;
display: flex;
align-items: center;
}
input {
width: 100%;
padding: 0.75rem;
border: 1px solid #bdc3c7;
border-radius: 4px;
padding: 1rem 1rem 1rem 3rem;
border: 2px solid #e5e7eb;
border-radius: 1rem;
font-size: 1rem;
transition: border-color 0.3s;
font-family: inherit;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
background: white;
box-sizing: border-box;
}
input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
transform: translateY(-2px);
}
input:disabled {
background: #f9fafb;
cursor: not-allowed;
opacity: 0.6;
}
input::placeholder {
color: #9ca3af;
}
.input-icon {
position: absolute;
left: 1rem;
width: 20px;
height: 20px;
color: #9ca3af;
pointer-events: none;
}
.password-toggle {
position: absolute;
right: 1rem;
width: 24px;
height: 24px;
background: none;
border: none;
color: #9ca3af;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
}
.password-toggle svg {
width: 100%;
height: 100%;
}
.password-toggle:hover {
color: #667eea;
}
/* ============================================
FORM OPTIONS
============================================ */
.form-options {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.9rem;
}
.remember-me {
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
color: #374151;
font-weight: 500;
user-select: none;
}
.remember-me input {
width: auto;
padding: 0;
border: 2px solid #e5e7eb;
border-radius: 0.375rem;
cursor: pointer;
accent-color: #667eea;
margin: 0;
}
.remember-me input:checked {
background: #667eea;
}
.forgot-password {
color: #667eea;
text-decoration: none;
font-weight: 600;
transition: all 0.2s ease;
}
.forgot-password:hover {
color: #764ba2;
text-decoration: underline;
}
/* ============================================
SUBMIT BUTTON
============================================ */
.btn-primary {
width: 100%;
padding: 0.75rem;
padding: 1.125rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 4px;
border-radius: 1rem;
font-size: 1rem;
font-weight: 600;
font-weight: 700;
cursor: pointer;
transition: transform 0.2s;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
display: flex;
align-items: center;
justify-content: center;
min-height: 52px;
}
.btn-primary:hover:not(:disabled) {
transform: translateY(-2px);
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
.btn-primary:active:not(:disabled) {
transform: translateY(-1px);
}
.btn-primary:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
}
.error-message {
margin-top: 1rem;
padding: 0.75rem;
background-color: #fee;
color: #c33;
border-radius: 4px;
font-size: 0.9rem;
}
.links {
.loading-content {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-top: 1.5rem;
align-items: center;
gap: 0.75rem;
}
.spinner {
width: 20px;
height: 20px;
animation: spin 1s linear infinite;
}
/* ============================================
ERROR MESSAGE
============================================ */
.error-message {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem;
background: #fef2f2;
border: 2px solid #fecaca;
border-radius: 1rem;
color: #dc2626;
animation: slideInError 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.error-message svg {
width: 24px;
height: 24px;
flex-shrink: 0;
}
.error-title {
margin: 0 0 0.25rem 0;
font-weight: 600;
font-size: 0.95rem;
}
.error-text {
margin: 0;
font-size: 0.85rem;
opacity: 0.9;
}
/* ============================================
DIVIDER
============================================ */
.divider {
position: relative;
text-align: center;
margin: 1.5rem 0;
}
.divider::before {
content: '';
position: absolute;
top: 50%;
left: 0;
right: 0;
height: 1px;
background: #e5e7eb;
}
.divider span {
position: relative;
background: white;
padding: 0 1rem;
color: #9ca3af;
font-size: 0.9rem;
font-weight: 500;
}
/* ============================================
SIGNUP SECTION
============================================ */
.signup-section {
text-align: center;
}
.links a {
color: #667eea;
text-decoration: none;
font-size: 0.9rem;
.signup-section p {
margin: 0 0 0.75rem 0;
color: #6b7280;
font-size: 0.95rem;
}
.links a:hover {
.signup-link {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: #667eea;
text-decoration: none;
font-weight: 700;
transition: all 0.2s ease;
}
.signup-link svg {
width: 16px;
height: 16px;
transition: all 0.2s ease;
}
.signup-link:hover {
color: #764ba2;
gap: 0.75rem;
}
/* ============================================
BACKGROUND DECORATIONS
============================================ */
.background-decoration {
position: absolute;
inset: 0;
pointer-events: none;
overflow: hidden;
}
.decoration-blob {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
animation: float 8s ease-in-out infinite;
}
.blob-1 {
width: 400px;
height: 400px;
top: -10%;
left: -10%;
animation-delay: 0s;
}
.blob-2 {
width: 300px;
height: 300px;
bottom: -5%;
right: -5%;
animation-delay: 2s;
}
.blob-3 {
width: 200px;
height: 200px;
top: 50%;
left: -5%;
animation-delay: 4s;
}
/* ============================================
BOTTOM LINK
============================================ */
.bottom-link {
position: absolute;
bottom: 2rem;
left: 50%;
transform: translateX(-50%);
z-index: 10;
}
.bottom-link a {
color: white;
text-decoration: none;
font-weight: 500;
transition: all 0.2s ease;
opacity: 0.8;
}
.bottom-link a:hover {
opacity: 1;
text-decoration: underline;
}
/* ============================================
ANIMATIONS
============================================ */
@keyframes slideUp {
from {
transform: translateY(50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes logoFloat {
0% {
transform: scale(0);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
@keyframes titleSlide {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes subtitleFade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes formSlide {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes slideInError {
from {
transform: translateX(-20px);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes float {
0%, 100% {
transform: translateY(0px) rotate(0deg);
}
50% {
transform: translateY(-30px) rotate(180deg);
}
}
/* ============================================
RESPONSIVE DESIGN
============================================ */
@media (max-width: 640px) {
.login-container {
padding: 1rem;
}
.login-card {
padding: 2rem;
border-radius: 1.5rem;
}
.card-header {
margin-bottom: 1.5rem;
}
.logo-wrapper {
width: 64px;
height: 64px;
margin-bottom: 1rem;
padding: 1rem;
}
h1 {
font-size: 1.75rem;
}
.subtitle {
font-size: 0.9rem;
}
.login-form {
gap: 1.25rem;
}
.form-options {
flex-direction: column;
gap: 1rem;
align-items: flex-start;
}
.remember-me {
width: 100%;
}
.forgot-password {
width: 100%;
text-align: center;
}
input {
padding: 0.875rem 0.875rem 0.875rem 2.75rem;
font-size: 16px;
}
.input-icon {
left: 0.75rem;
}
.password-toggle {
right: 0.75rem;
}
.error-message {
flex-direction: column;
text-align: center;
}
.divider {
margin: 1.25rem 0;
}
.divider::before {
left: -50px;
right: -50px;
}
.signup-section p {
font-size: 0.9rem;
}
.blob-1 {
width: 300px;
height: 300px;
}
.blob-2 {
width: 200px;
height: 200px;
}
.blob-3 {
width: 150px;
height: 150px;
}
.bottom-link a {
font-size: 0.9rem;
}
}
@media (max-width: 480px) {
.login-card {
padding: 1.5rem;
border-radius: 1.25rem;
}
.card-header {
margin-bottom: 1.25rem;
}
.logo-wrapper {
width: 56px;
height: 56px;
}
h1 {
font-size: 1.5rem;
}
.subtitle {
font-size: 0.85rem;
}
label {
font-size: 0.9rem;
}
.btn-primary {
padding: 1rem;
font-size: 0.95rem;
}
.form-options {
font-size: 0.85rem;
}
.remember-me,
.forgot-password {
font-size: 0.85rem;
}
.divider span {
font-size: 0.85rem;
padding: 0 0.75rem;
}
.signup-section p {
margin-bottom: 0.5rem;
}
.signup-link {
font-size: 0.9rem;
}
.error-message {
gap: 0.75rem;
padding: 0.75rem;
}
.error-message svg {
width: 20px;
height: 20px;
}
.error-title {
font-size: 0.9rem;
}
.error-text {
font-size: 0.8rem;
}
.bottom-link {
bottom: 1rem;
}
.bottom-link a {
font-size: 0.85rem;
}
}
/* Accessibility */
@media (prefers-reduced-motion: reduce) {
.login-card,
.logo-wrapper,
h1,
.subtitle,
.login-form,
.error-message,
.decoration-blob {
animation: none;
}
input:focus,
.btn-primary:hover,
.password-toggle:hover {
transform: none;
}
}
</style>