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
37 changes: 19 additions & 18 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- Navigation -->
<nav class="navbar">
<div class="nav-container">
<div class="nav-brand">
<div class="nav-brand" style="margin: 10px;">
<i class="fas fa-recycle"></i>
<span>ReWear</span>
</div>
Expand All @@ -36,13 +36,19 @@
</div>

<div id="auth-buttons">
<button id="theme-toggle" class="theme-toggle">
<i class="fas fa-moon"></i> Dark
</button>
<button class="btn btn-outline" onclick="showPage('login')">Login</button>
<button class="btn btn-primary" onclick="showPage('signup')">Sign Up</button>
</div>
</div>
<div class="nav-auth">

<div id="user-menu" style="display: none;">
<button id="theme-toggle-user" class="theme-toggle">
<i class="fas fa-moon"></i> Dark
</button>
<span id="user-points" class="points-badge"></span>
<span id="username-display"></span>
<button id="notifications-bell" class="btn btn-icon" style="margin-right: 10px; display: none;"
Expand Down Expand Up @@ -157,32 +163,27 @@ <h3>Earn & Redeem Points</h3>
</div>
</section>

<section class="how-rewear" style="padding: 60px 20px; background-color: #f9f9f9; text-align: center;">
<section class="how-rewear">
<div class="container">
<h2 style="font-size: 2.5rem; margin-bottom: 40px; color: #333;">How ReWear Works</h2>
<div class="how-grid"
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px;">
<h2 class="how-title">How ReWear Works</h2>
<div class="how-grid">

<div class="how-card">

<i class="fas fa-upload" style="font-size: 2.5rem; color: #4CAF50; margin-bottom: 20px;"></i>
<h3 style="font-size: 1.5rem; margin-bottom: 10px; color: #222;">List Your Items</h3>
<p style="color: #555;">Upload photos and details of clothing you no longer wear.</p>
<i class="fas fa-upload how-icon how-icon-green"></i>
<h3 class="how-card-title">List Your Items</h3>
<p class="how-card-description">Upload photos and details of clothing you no longer wear.</p>
</div>

<div class="how-card">

<i class="fas fa-exchange-alt"
style="font-size: 2.5rem; color: #FF9800; margin-bottom: 20px;"></i>
<h3 style="font-size: 1.5rem; margin-bottom: 10px; color: #222;">Swap or Redeem</h3>
<p style="color: #555;">Exchange directly with others or use points to get items you love.</p>
<i class="fas fa-exchange-alt how-icon how-icon-orange"></i>
<h3 class="how-card-title">Swap or Redeem</h3>
<p class="how-card-description">Exchange directly with others or use points to get items you love.</p>
</div>

<div class="how-card">

<i class="fas fa-leaf" style="font-size: 2.5rem; color: #8BC34A; margin-bottom: 20px;"></i>
<h3 style="font-size: 1.5rem; margin-bottom: 10px; color: #222;">Reduce Waste</h3>
<p style="color: #555;">Help create a more sustainable fashion ecosystem.</p>
<i class="fas fa-leaf how-icon how-icon-light-green"></i>
<h3 class="how-card-title">Reduce Waste</h3>
<p class="how-card-description">Help create a more sustainable fashion ecosystem.</p>
</div>

</div>
Expand Down
47 changes: 47 additions & 0 deletions frontend/static/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
// Dark Mode Toggle Functionality
function initializeTheme() {
// Check for saved theme preference or default to light mode
const savedTheme = localStorage.getItem('theme') || 'light';
document.documentElement.setAttribute('data-theme', savedTheme);

// Update toggle button text
updateThemeToggleText(savedTheme);
}

function toggleTheme() {
const currentTheme = document.documentElement.getAttribute('data-theme') || 'light';
const newTheme = currentTheme === 'light' ? 'dark' : 'light';

document.documentElement.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
updateThemeToggleText(newTheme);
}

function updateThemeToggleText(theme) {
const toggleButtons = [
document.getElementById('theme-toggle'),
document.getElementById('theme-toggle-user')
];

toggleButtons.forEach(button => {
if (button) {
button.innerHTML = theme === 'light'
? '<i class="fas fa-moon"></i> Dark'
: '<i class="fas fa-sun"></i> Light';
}
});
}

function setupEventListeners() {
// Theme toggle setup for both buttons
const themeToggleButtons = [
document.getElementById('theme-toggle'),
document.getElementById('theme-toggle-user')
];

themeToggleButtons.forEach(button => {
if (button) {
button.addEventListener('click', toggleTheme);
}
});

// Stub function to prevent errors
// Add event listeners here if needed in future
}
Expand All @@ -14,6 +60,7 @@ const API_BASE = "/api";

// Initialize app
document.addEventListener("DOMContentLoaded", function () {
initializeTheme();
checkAuth();
loadCategories();
loadFeaturedItems();
Expand Down
Loading