From d5c5f2838f02ac8b581eaae48969e733ccb7f1b7 Mon Sep 17 00:00:00 2001 From: Doug Masiero Date: Thu, 27 Feb 2025 18:25:53 -0500 Subject: [PATCH] Updated buttons --- .cursorrules | 68 +++++++++++++++++++++++++++++++++ db/freesched.db | Bin 20480 -> 20480 bytes public/admin.js | 28 ++++++++++++++ public/styles.css | 94 +++++++++++++++++++++++++++++++++++++++++----- views/admin.html | 17 ++++++--- views/index.html | 13 +++++-- 6 files changed, 202 insertions(+), 18 deletions(-) create mode 100644 .cursorrules diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..d2cf643 --- /dev/null +++ b/.cursorrules @@ -0,0 +1,68 @@ +{ + "version": 1, + "rules": [ + { + "name": "Server Code", + "pattern": "server.js", + "description": "Main Express.js server file containing API endpoints and server configuration" + }, + { + "name": "Frontend Views", + "pattern": "views/*.html", + "description": "HTML templates for the application views" + }, + { + "name": "Static Assets", + "pattern": "public/**/*", + "description": "Static assets including JavaScript, CSS, and images" + }, + { + "name": "Client-side JavaScript", + "pattern": "public/*.js", + "description": "Client-side JavaScript files for frontend functionality" + }, + { + "name": "Database", + "pattern": "db/**/*", + "description": "SQLite database files and related resources" + }, + { + "name": "Node Modules", + "pattern": "node_modules/**/*", + "description": "Third-party dependencies", + "ignore": true + }, + { + "name": "Package Configuration", + "pattern": "package*.json", + "description": "NPM package configuration files" + }, + { + "name": "Git Files", + "pattern": ".git/**/*", + "description": "Git repository files", + "ignore": true + }, + { + "name": "System Files", + "pattern": "**/.DS_Store", + "description": "macOS system files", + "ignore": true + } + ], + "fileAssociations": { + ".js": "javascript", + ".html": "html", + ".css": "css", + ".json": "json", + ".md": "markdown" + }, + "search": { + "excludePatterns": [ + "node_modules/**/*", + ".git/**/*", + "**/.DS_Store", + "db/*.db" + ] + } +} \ No newline at end of file diff --git a/db/freesched.db b/db/freesched.db index 717d16ae0d09fc2a60e444cb689576e58e31e5f9..b9d462f9235115bbd8d61c984b01f993e14c9658 100644 GIT binary patch delta 23 ecmZozz}T>WalWali^qQ!67&D-*Lt3I+gQ)dvRv diff --git a/public/admin.js b/public/admin.js index 759754b..ae15582 100644 --- a/public/admin.js +++ b/public/admin.js @@ -1434,7 +1434,35 @@ document.addEventListener('DOMContentLoaded', async () => { selectedAdminDate = null; // Clear selected date selectedDateDisplay.textContent = ''; timeSlots.innerHTML = ''; // Clear time slots + + // Re-render the calendar await renderAdminCalendar(currentAdminMonth, currentAdminYear); + + // If a date was previously selected in the calendar, update the time slots UI + const selectedDateElement = document.querySelector('#adminCalendarDates .date-item.selected'); + if (selectedDateElement) { + const day = parseInt(selectedDateElement.textContent); + selectedAdminDate = new Date(currentAdminYear, currentAdminMonth, day); + await updateTimeSlots(selectedAdminDate); + } else { + // If no date was selected, select today's date if it's in the current month + const today = new Date(); + if (today.getMonth() === currentAdminMonth && today.getFullYear() === currentAdminYear) { + selectedAdminDate = today; + await updateTimeSlots(today); + + // Find and highlight today in the calendar + const dateItems = document.querySelectorAll('#adminCalendarDates .date-item'); + const todayDay = today.getDate(); + const todayElement = Array.from(dateItems).find(item => { + return item.textContent && parseInt(item.textContent) === todayDay; + }); + + if (todayElement) { + todayElement.classList.add('selected'); + } + } + } } catch (error) { console.error('Error deleting availability:', error); alert('Failed to delete availability. Please try again.'); diff --git a/public/styles.css b/public/styles.css index 5e623a6..4476b18 100644 --- a/public/styles.css +++ b/public/styles.css @@ -63,7 +63,6 @@ width: 70%; padding: 20px; position: relative; - min-height: 600px; /* Ensure minimum height for the content area */ } .calendar-header h1 { @@ -156,9 +155,9 @@ .time-slots .text-muted { color: #6c757d; /* Muted text color, matching Calendly */ - font-size: 1rem; /* Slightly larger font, e.g., 20px instead of 16px */ + font-size: rem; /* Slightly larger font, e.g., 20px instead of 16px */ font-weight: bold; /* Bold text */ - padding: 1rem 0; + padding: 2.2rem 0; text-align: center; } @@ -171,34 +170,91 @@ .timezone { font-size: 0.875rem; color: #666; + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; +} + +#timezone { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; } .powered-by { font-size: 0.75rem; color: #666; - text-align: right; - position: absolute; - bottom: 20px; - right: 20px; opacity: 0.8; transition: opacity 0.3s ease; - z-index: 1; + z-index: 10; background-color: transparent; padding: 5px; - margin: 0; + margin-left: auto; /* Push to the right */ pointer-events: auto; } +.powered-by.text-end { + text-align: right; +} + .powered-by a { color: inherit; text-decoration: none; cursor: pointer; } +.powered-by a.github-link { + display: inline-flex; + align-items: center; + background-color: #e9e9e9; + color: #333; + padding: 8px 12px; + border-radius: 20px; + font-size: 14px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + white-space: nowrap; +} + +.octocat-icon { + margin-right: 8px; + display: flex; + align-items: center; +} + +.octocat-icon svg { + fill: #333; +} + .powered-by:hover { opacity: 1; } +/* Admin-specific powered-by styling */ +.admin-powered-by { + position: absolute; + bottom: 20px; + right: 20px; + margin-top: 0; +} + +/* Index-specific powered-by styling */ +.index-powered-by { + text-align: right; + margin-top: 0; + margin-left: auto; + display: inline-flex; + justify-content: flex-end; + align-items: center; + flex-shrink: 0; +} + +/* Add clearance for elements with flex classes */ +.d-flex.flex-column.gap-2.mt-3 { + margin-bottom: 50px; /* Increased margin to ensure these elements don't overlap with the powered-by button */ +} + /* Admin-specific styles */ #admin .calendar { margin-bottom: 20px; @@ -247,6 +303,22 @@ text-align: center; margin-top: 30px; } + + .admin-powered-by { + position: relative; + bottom: auto; + right: auto; + text-align: right; + margin-top: 20px; + } + + .index-powered-by { + position: relative; + text-align: right; + margin-left: auto; + display: inline-flex; + justify-content: flex-end; + } } /* Sidebar buttons styling */ @@ -301,4 +373,8 @@ background-color: #0099cc; border-color: #0099cc; box-shadow: 0 0 15px rgba(0, 191, 255, 0.7); /* Enhanced glow on hover */ +} + +.time-slots { + margin-bottom: 50px; /* Increased margin to ensure time slots don't overlap with the powered-by button */ } \ No newline at end of file diff --git a/views/admin.html b/views/admin.html index 6447228..bbb2124 100644 --- a/views/admin.html +++ b/views/admin.html @@ -22,10 +22,10 @@

30 min

- - - - + + + +
@@ -79,8 +79,13 @@ -
- Powered by FreeSched +
diff --git a/views/index.html b/views/index.html index f782431..3a8dafb 100644 --- a/views/index.html +++ b/views/index.html @@ -53,9 +53,16 @@
-

Eastern Time - US & Canada ()

-
- Powered by FreeSched +
+ Eastern Time - US & Canada () + + + + Powered by FreeSched + +