diff --git a/iframe.html b/iframe.html index c7eec7d..5460868 100644 --- a/iframe.html +++ b/iframe.html @@ -1466,6 +1466,58 @@ flex: 1; } + /* Editable Food Source Name Styling */ + .dog-calculator-food-source-name-input { + background: transparent; + border: 2px solid transparent; + color: var(--text-primary); + font-size: 1.1rem; + font-weight: 600; + font-family: inherit; + padding: 0.5rem; + border-radius: 4px; + width: 100%; + outline: none; + transition: all 0.2s ease; + cursor: text; + } + + .dog-calculator-food-source-name-input:hover { + border-color: var(--border-color); + background: var(--bg-secondary); + } + + .dog-calculator-food-source-name-input:focus { + border-color: var(--primary-color); + background: var(--bg-primary); + box-shadow: 0 0 0 3px rgba(241, 154, 95, 0.1); + } + + .dog-calculator-food-source-name-input::placeholder { + color: var(--text-secondary); + opacity: 0.7; + } + + /* Dark theme adjustments */ + .dog-calculator-container.theme-dark .dog-calculator-food-source-name-input:hover { + background: #2a2530; + } + + .dog-calculator-container.theme-dark .dog-calculator-food-source-name-input:focus { + background: #1e1a24; + } + + /* System theme adjustments */ + @media (prefers-color-scheme: dark) { + .dog-calculator-container.theme-system .dog-calculator-food-source-name-input:hover { + background: #2a2530; + } + + .dog-calculator-container.theme-system .dog-calculator-food-source-name-input:focus { + background: #1e1a24; + } + } + /* Responsive adjustments */ @media (max-width: 576px) { .dog-calculator-food-amount-item { @@ -1477,6 +1529,10 @@ .dog-calculator-food-amount-label { justify-content: center; } + + .dog-calculator-food-source-name-input { + font-size: 1rem; + } } @@ -2130,10 +2186,13 @@ updateFoodSourceNames() { this.foodSources.forEach((fs, index) => { - fs.name = `Food Source ${index + 1}`; - const titleElement = document.getElementById(`food-title-${fs.id}`); - if (titleElement) { - titleElement.textContent = fs.name; + // Only update if the name is still the default pattern + if (fs.name.match(/^Food Source \d+$/)) { + fs.name = `Food Source ${index + 1}`; + const titleElement = document.getElementById(`food-title-${fs.id}`); + if (titleElement) { + titleElement.value = fs.name; + } } }); } @@ -2163,7 +2222,7 @@ const cardHTML = `