10 Commits

Author SHA1 Message Date
Dayowe
374d067cf4 Fixes and improvements 2025-11-12 18:34:26 +01:00
Dayowe
73c4648978 Updates 2025-11-12 18:00:36 +01:00
Dayowe
da9fd20ffb Remve oz, cups, lb 2025-11-12 17:00:45 +01:00
Dayowe
7fd139b321 Kaya transition v1 2025-11-12 16:44:43 +01:00
Dayowe
90657f9aa4 Remove embedding and js widget 2025-10-28 09:58:20 +01:00
Dayowe
99b516d087 Add range calculations for dog food amounts based on life stage
- Implement range multipliers for different life stages (e.g., 1.6-1.8x for intact adults)
- Display MER and food amounts as ranges (e.g., '2042-2298 cal/day')
- Add CSS to prevent value wrapping with white-space: nowrap
- Increase calculator max-width from 600px to 640px for better text layout
- Based on veterinary RER multiplier ranges for more accurate feeding recommendations
2025-08-18 15:33:44 +02:00
Dayowe
4ec42fdbc0 Add cups unit option for kcal/cup measurements
Features:
- Add cups as a unit option that only works with kcal/cup energy measurements
- Cups button is disabled with tooltip when kcal/cup is not selected
- Auto-select cups when user selects kcal/cup as energy unit
- Auto-switch to appropriate units when changing energy measurement types
- Calculate cup amounts directly from calories without density assumptions

Fixes:
- Ensure cups display correct values immediately upon auto-selection
- Fix "Per day" radio button to be pre-selected when feeding config becomes visible
- Handle empty unit values with failsafe fallback to active button

Technical details:
- Direct calorie-to-cups conversion bypassing gram conversions
- Pre-calculate cups values in food breakdown for efficient display
- Set unit before updating calculations to avoid timing issues
- Added CSS styling for disabled button state across all themes
2025-08-18 14:36:25 +02:00
Dayowe
8758ac1dbc Add per-meal feeding frequency feature
- Added feeding configuration section with daily/per-meal toggle
- Implemented meals per day selector (1-10 meals)
- Updated all calculations to support per-meal division
- Dynamic unit labels change from "/day" to "/meal"
- Added helpful meal count display for multi-day calculations
- Proper dark theme support for new UI elements
- Mobile responsive design for feeding controls
- Centered meal input group for better UX

This feature allows users to easily switch between viewing daily food amounts
and per-meal portions, making feeding schedules more practical to follow.
2025-08-18 12:45:44 +02:00
Dayowe
73793f43a1 Reorganize source structure for better maintainability
- Move from 3-file structure to organized 5-file structure
- Create css/ and js/ subdirectories for better organization
- Split styles into main.css and themes.css for clarity
- Extract configuration constants to separate config.js file
- Rename template.html to index.html for clarity
- Update build.js to handle new organized structure
- Replace magic numbers with CALCULATOR_CONFIG constants

New structure:
  src/
    ├── index.html       (HTML template)
    ├── css/
    │   ├── main.css     (Core styles)
    │   └── themes.css   (Theme variations)
    └── js/
        ├── config.js    (Configuration constants)
        └── calculator.js (Main logic)

This provides a good balance between organization and simplicity,
making the codebase easier to maintain without over-modularization.
2025-08-18 09:05:00 +02:00
Dayowe
ba3e0a6a6a Modularize calculator into separate source files
- Split 3470-line iframe.html into manageable components
- Created src/ directory with styles.css, template.html, calculator.js
- Updated build.js to assemble from modular source files
- Maintains identical functionality with improved maintainability
- Single source of truth: edit in src/, run build.js to generate both outputs
2025-08-17 21:20:05 +02:00