From 9a4d5dd07b41fe8d6202672e12fb75532294b201 Mon Sep 17 00:00:00 2001 From: Edwin Eames Date: Tue, 3 Feb 2026 20:57:11 -0500 Subject: [PATCH] feat(frontend): redesign home page with charts, map, and pricing dropdown - Header: Replace date with oil price dropdown showing all pricing tiers (regular, same day, prime, emergency) and service pricing - Footer: Add search shortcuts reference (@, !, #, $) - Home page complete redesign: - Animated stat cards (today's deliveries, week gallons, deliveries, revenue) - 28-day delivery trend chart using Chart.js - Mini map showing today's delivery routes with Leaflet - Quick actions grid for common tasks - Town distribution visualization with progress bars - Gradient styling and fade-in animations Co-Authored-By: Claude Opus 4.5 --- src/layouts/footers/footer.vue | 80 +++- src/layouts/headers/headerauth.vue | 154 ++++++- src/pages/Index.vue | 692 ++++++++++++++++++++--------- 3 files changed, 694 insertions(+), 232 deletions(-) diff --git a/src/layouts/footers/footer.vue b/src/layouts/footers/footer.vue index 154f6e9..c1ab3fb 100755 --- a/src/layouts/footers/footer.vue +++ b/src/layouts/footers/footer.vue @@ -15,11 +15,35 @@
Spring Rebuilders - (508) 799-9342
+ @@ -29,13 +53,45 @@ import { ref } from 'vue'; const copyReviewLink = async () => { - try { - await navigator.clipboard.writeText('https://g.page/r/CZHnPQ85LsMUEBM/review') - alert('Link copied to clipboard!') - } catch (err) { - console.error('Failed to copy text: ', err) - alert('Failed to copy link. Please try again.') - } + const textToCopy = 'https://g.page/r/CZHnPQ85LsMUEBM/review'; + + // Try the modern Clipboard API first (works in secure contexts like HTTPS or localhost) + if (navigator.clipboard && window.isSecureContext) { + try { + await navigator.clipboard.writeText(textToCopy); + alert('Link copied to clipboard!'); + return; + } catch (err) { + console.warn('Clipboard API failed, falling back to legacy method.', err); + } + } + + // Fallback for non-secure contexts (like HTTP LAN) + const textArea = document.createElement("textarea"); + textArea.value = textToCopy; + + // Ensure it's not visible but part of the DOM + textArea.style.position = "fixed"; + textArea.style.left = "-9999px"; + textArea.style.top = "0"; + document.body.appendChild(textArea); + + textArea.focus(); + textArea.select(); + + try { + const successful = document.execCommand('copy'); + if (successful) { + alert('Link copied to clipboard!'); + } else { + alert('Unable to copy link. Please manually copy: ' + textToCopy); + } + } catch (err) { + console.error('Fallback copy failed', err); + alert('Unable to copy link. Please manually copy: ' + textToCopy); + } + + document.body.removeChild(textArea); }; diff --git a/src/layouts/headers/headerauth.vue b/src/layouts/headers/headerauth.vue index daf67c0..824892d 100755 --- a/src/layouts/headers/headerauth.vue +++ b/src/layouts/headers/headerauth.vue @@ -2,10 +2,10 @@