64 Commits

Author SHA1 Message Date
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
d489a87722 Add doc 2025-11-12 16:48:43 +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
c4770d5ee6 Fix data-theme and data-scale widget attributes not being applied
- Remove theme/scale assignments that override widget options in build process
- Widget now properly uses data-theme and data-scale attributes from HTML
- Both light and dark themes work correctly when multiple widgets on same page
- Scale attribute properly applies to each widget independently
2025-08-18 14:54:25 +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
c7a4aa01ba Improve build system and clean up project structure
- Configure build script to create backups in backup/ directory
- Add backup/ directory to .gitignore to keep repo clean
- Add .gitignore file with common exclusions
- Remove obsolete dog-food-calculator-widget.js file
- Move all temporary and reference files to sundog-calculator-meta/

This keeps the project root clean and organized while maintaining
automatic backups during builds.
2025-08-18 09:21:54 +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
976e7d9136 Updte file 2025-06-26 18:10:03 +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
c4a15a95b3 Update README.md 2025-06-26 17:35:39 +02:00
Dayowe
90d9055667 Update file 2025-06-26 17:29: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
f781bbae74 Update 2025-06-26 13:10: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
081c4c2a7f Fix widget data-theme and data-scale attribute handling
Fixed the build script to properly handle data-theme and data-scale attributes:
- Remove duplicate theme/scale assignments that were overriding options
- Apply theme classes to correct element (#dogCalculator)
- Support all three themes: light, dark, system
- Remove duplicate applyTheme/applyScale calls in init method
2025-06-19 11:11:33 +02:00
Dayowe
f0666c247b Update build.js to actually use iframe.html as source of truth; data-theem and data-scale not working 2025-06-19 10:50:09 +02:00
Dayowe
19416c7592 Add plausible classes 2025-06-15 22:59:45 +02:00
Dayowe
ed7205a9c2 Do not transform class names 2025-06-15 22:39:41 +02:00
Dayowe
69739c63a9 Update 2025-06-15 22:23:59 +02:00
Dayowe
fab1e5f400 Delete files 2025-06-15 22:23:26 +02:00
Dayowe
6af1f8fa13 Update file 2025-06-15 21:57:39 +02:00
Dayowe
e430783717 Initial commit 2025-06-15 21:57:27 +02:00
Dayowe
112951c240 Initial commit 2025-06-15 20:50:45 +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
c7cb3a2acb icons 2025-06-08 23:12:52 +02:00
Dayowe
4d29490f0c fix urls 2025-06-08 23:09:10 +02:00