diff --git a/public/styles/scanner.css b/public/styles/scanner.css deleted file mode 100644 index fca3ddb..0000000 --- a/public/styles/scanner.css +++ /dev/null @@ -1,536 +0,0 @@ -/* Reset and Base Styles */ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body { - font-family: - system-ui, - -apple-system, - BlinkMacSystemFont, - "Segoe UI", - Roboto, - "Helvetica Neue", - Arial, - sans-serif; -} - -/* Container */ -.app-container { - min-height: 100vh; - background: linear-gradient(135deg, #2d5016 0%, #1a472a 50%, #0f3d3e 100%); - padding: 1rem; -} - -.content-wrapper { - max-width: 42rem; - margin: 0 auto; -} - -/* Main Card */ -.main-card { - background: #1f2937; - border-radius: 1rem; - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); - padding: 1.5rem; - margin-bottom: 1rem; -} - -/* Header */ -.header { - display: flex; - align-items: center; - justify-content: center; - gap: 0.75rem; - margin-bottom: 0.5rem; -} - -.header-emoji { - font-size: 2.25rem; -} - -.header-title { - font-size: 2.25rem; - font-weight: bold; - background: white; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; -} - -.header-subtitle { - text-align: center; - color: #4b5563; - font-size: 0.875rem; - margin-bottom: 1.5rem; -} - -/* Buttons */ -.btn { - width: 100%; - font-weight: 600; - padding: 1rem 1.5rem; - cursor: pointer; - transition: all 0.3s ease; - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; - font-size: 1rem; - background: rgba(255, 255, 255, 0.1); - backdrop-filter: blur(10px); - border: 2px solid rgba(255, 255, 255, 0.2); - border-radius: 12px; - color: white; -} - -.btn:hover { - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); - transform: scale(1.05); -} - -.btn-cancel { - background: #4b5563; - color: white; -} - -.btn-cancel:hover { - background: #374151; -} - -.btn-danger { - background: #dc2626; - color: white; - padding: 0.5rem 1rem; - margin-top: 0.75rem; -} - -.btn-danger:hover { - background: #b91c1c; -} - -.btn-green { - background: #16a34a; - color: white; - padding: 0.75rem 1.5rem; -} - -.btn-green:hover { - background: #15803d; -} - -/* Form Elements */ -.input { - width: 100%; - padding: 0.75rem 1rem; - border: 2px solid #d1d5db; - border-radius: 0.75rem; - font-size: 1rem; - transition: all 0.3s ease; -} - -.input:focus { - outline: none; - border-color: #16a34a; - box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1); -} - -.form { - display: flex; - flex-direction: column; - gap: 0.75rem; -} - -/* Divider */ -.divider { - position: relative; - margin: 1.5rem 0; -} - -.divider-line { - position: absolute; - inset: 0; - display: flex; - align-items: center; -} - -.divider-line > div { - width: 100%; - border-top: 1px solid #d1d5db; -} - -.divider-text { - position: relative; - display: flex; - justify-content: center; - font-size: 0.875rem; -} - -.divider-text span { - padding: 0 0.5rem; - background: #1f2937; - color: lightgrey; -} - -/* Scanner */ -.scanner-container { - display: flex; - flex-direction: column; - gap: 1rem; -} - -.video-wrapper { - position: relative; - background: black; - border-radius: 0.75rem; - overflow: hidden; - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); -} - -.video { - width: 100%; - height: 16rem; - object-fit: cover; -} - -.video-overlay { - position: absolute; - inset: 0; - border: 4px solid #4ade80; - opacity: 0.5; - margin: 2rem; - border-radius: 0.5rem; -} - -.barcode-display { - position: absolute; - bottom: 1rem; - left: 1rem; - right: 1rem; - background: #16a34a; - color: white; - padding: 0.5rem 1rem; - border-radius: 0.5rem; - text-align: center; - font-family: "Courier New", monospace; - animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; -} - -@keyframes pulse { - 0%, - 100% { - opacity: 1; - } - 50% { - opacity: 0.5; - } -} - -.scanner-info { - text-align: center; - font-size: 0.875rem; - color: #4b5563; -} - -/* Loading */ -.loading-container { - text-align: center; - padding: 2rem 0; -} - -.spinner { - display: inline-block; - width: 3rem; - height: 3rem; - border: 4px solid #16a34a; - border-top-color: transparent; - border-radius: 50%; - animation: spin 1s linear infinite; -} - -@keyframes spin { - to { - transform: rotate(360deg); - } -} - -.loading-text { - margin-top: 1rem; - color: #4b5563; -} - -/* Error */ -.error-box { - background: #fef2f2; - border: 2px solid #fecaca; - border-radius: 0.75rem; - padding: 1rem; - color: #b91c1c; -} - -.error-title { - font-weight: 600; -} - -.error-message { - font-size: 0.875rem; - margin-top: 0.25rem; -} - -/* Product Display */ -.product-card { - display: flex; - flex-direction: column; - gap: 1rem; -} - -.product-header { - margin-bottom: 1rem; -} - -.product-title { - font-size: 1.5rem; - font-weight: bold; - color: white; -} - -.product-brand { - color: lightgrey; -} - -.product-barcode { - font-size: 0.875rem; - color: #6b7280; - margin-top: 0.25rem; -} - -/* Analysis Boxes */ -.analysis-box { - padding: 1rem; - border-radius: 0.75rem; - border: 2px solid; - margin-bottom: 1rem; -} - -.analysis-box.vegan-yes { - background: #f0fdf4; - border-color: #86efac; -} - -.analysis-box.vegan-no-high { - background: #fef2f2; - border-color: #fca5a5; -} - -.analysis-box.vegan-uncertain { - background: #fefce8; - border-color: #fde047; -} - -.analysis-box.rating-excellent { - background: #f0fdf4; - border-color: #86efac; -} - -.analysis-box.rating-good { - background: #dbeafe; - border-color: #93c5fd; -} - -.analysis-box.rating-moderate { - background: #fefce8; - border-color: #fde047; -} - -.analysis-box.rating-poor { - background: #ffedd5; - border-color: #fdba74; -} - -.analysis-box.rating-avoid { - background: #fef2f2; - border-color: #fca5a5; -} - -.analysis-box.rating-default { - background: #f9fafb; - border-color: #d1d5db; -} - -.analysis-header { - display: flex; - align-items: center; - gap: 0.5rem; - margin-bottom: 0.5rem; -} - -.analysis-emoji { - font-size: 1.5rem; -} - -.analysis-title { - font-weight: bold; - font-size: 1.125rem; -} - -.confidence-badge { - margin-left: auto; - font-size: 0.75rem; - padding: 0.25rem 0.5rem; - background: white; - border-radius: 9999px; -} - -.analysis-reason { - font-size: 0.875rem; -} - -.analysis-details { - margin-top: 0.5rem; - font-size: 0.75rem; - background: white; - padding: 0.5rem; - border-radius: 0.25rem; -} - -/* Weight Loss Score */ -.score-header { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 0.75rem; -} - -.score-value { - font-size: 1.875rem; - font-weight: bold; -} - -.score-value.score-excellent { - color: #16a34a; -} - -.score-value.score-good { - color: #2563eb; -} - -.score-value.score-moderate { - color: #ca8a04; -} - -.score-value.score-poor { - color: #ea580c; -} - -.score-value.score-avoid { - color: #dc2626; -} - -.score-recommendation { - font-size: 0.875rem; - margin-bottom: 0.75rem; -} - -/* Nutritional Grid */ -.nutrition-grid { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 0.5rem; - margin-bottom: 0.75rem; - font-size: 0.75rem; -} - -.nutrition-item { - background: white; - padding: 0.5rem; - border-radius: 0.25rem; -} - -/* Pros and Cons */ -.pros-cons { - margin-bottom: 0.5rem; -} - -.pros-cons-title { - font-size: 0.75rem; - font-weight: 600; -} - -.pros-cons-title.pros { - color: #15803d; -} - -.pros-cons-title.cons { - color: #b91c1c; -} - -.pros-cons-list { - list-style: none; - font-size: 0.75rem; - margin-top: 0.25rem; -} - -.pros-cons-list li { - background: white; - padding: 0.25rem; - border-radius: 0.25rem; - margin-bottom: 0.25rem; -} - -/* Ingredients */ -.ingredients-box { - background: #f9fafb; - padding: 1rem; - border-radius: 0.75rem; - margin-top: 1rem; - margin-bottom: 1rem; -} - -.ingredients-title { - font-weight: bold; - margin-bottom: 0.5rem; - font-size: 0.875rem; -} - -.ingredients-text { - font-size: 0.75rem; - color: #374151; -} - -/* SVG Icons */ -.icon { - width: 1.5rem; - height: 1.5rem; -} - -.icon-sm { - width: 1.25rem; - height: 1.25rem; -} - -/* Utility Classes */ -.space-y-4 > * + * { - margin-top: 1rem; -} - -.space-y-3 > * + * { - margin-top: 0.75rem; -} - -.space-y-2 > * + * { - margin-top: 0.5rem; -} - -.space-y-1 > * + * { - margin-top: 0.25rem; -} - -.gap-2 { - gap: 0.5rem; -} - -.gap-3 { - gap: 0.75rem; -} diff --git a/src/components/Scanner.astro b/src/components/Scanner.astro index 2cdfb5b..2c1dd1c 100644 --- a/src/components/Scanner.astro +++ b/src/components/Scanner.astro @@ -2,6 +2,545 @@ // Astro component - no props needed --- + +