33 Commits

Author SHA1 Message Date
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
Dayowe
6a22bac56c No modal bg 2025-06-26 18:09:18 +02:00
Dayowe
650b469202 Fix share/embed modals 2025-06-26 18:03:39 +02:00
Dayowe
238e7cdc97 Move inline to css 2025-06-26 17:29:25 +02:00
Dayowe
85cf1b22cc Fixes 2025-06-26 17:24:32 +02:00
Dayowe
3ef5908b09 css variables 2025-06-26 17:19:18 +02:00
Dayowe
271c8baafd Unit as buttons and othe rimprovements 2025-06-26 16:34:38 +02:00
Dayowe
7b66f395bb Fixes 2025-06-26 15:55:39 +02:00
Dayowe
26d2b6b1db Update daily food amount with proper units 2025-06-26 15:17:13 +02:00
Dayowe
b552b5e88e Updates and fixes 2025-06-26 14:32:32 +02:00
Dayowe
9a9c0b9ad0 Minor fixes and changes 2025-06-26 13:02:28 +02:00
Dayowe
d3872aef40 Inplace editing 2025-06-26 12:34:06 +02:00
Dayowe
c7d4d8eb9e List food sources separately in bottom section 2025-06-26 12:29:35 +02:00
Dayowe
0a7020cb88 Percentage system overhaul 2025-06-26 12:21:18 +02:00
Dayowe
e789f481f3 Commit before redesign 2025-06-26 12:00:51 +02:00
Dayowe
61b238fdf0 Lock into place 2025-06-26 11:47:33 +02:00
Dayowe
4d493b7d71 Constrain slider 2025-06-26 11:27:03 +02:00
Dayowe
f3baa12bd3 Add lock 2025-06-26 11:19:29 +02:00
Dayowe
119f1905ec Add food sources 2025-06-26 11:09:29 +02:00
Dayowe
19416c7592 Add plausible classes 2025-06-15 22:59:45 +02:00
Dayowe
6af1f8fa13 Update file 2025-06-15 21:57:39 +02:00
Dayowe
28f5a459dd fixes 2025-06-09 10:12:28 +02:00
Dayowe
d3bec564a9 Scale option 2025-06-09 10:01:29 +02:00
Dayowe
768659a74f Fix border 2025-06-09 09:58:09 +02:00
Dayowe
bb04a4d63f Add North American calorie unit support (kcal/kg, kcal/cup, kcal/can) 2025-06-09 09:53:16 +02:00
Dayowe
46b3560a68 Update iframe .. rewrite a bit 2025-06-08 23:45:32 +02:00
Dayowe
954321fe6f Update 2025-06-08 22:27:21 +02:00
Dayowe
5afb3a8c5a Update 2025-06-08 20:31:11 +02:00