chhoumann / DemoVault

Demo vault for Obsidian stuff by Christian.
155 stars 47 forks source link

Update view.js #16

Closed PeterBeckley closed 9 months ago

PeterBeckley commented 10 months ago

Progress bars can have their color changed via CSS based on value as a portion of 100%, but currently this view calculates a value is calculated as a non percentage progress of a target. The bar length is correct, but the value will not reflect the percentage complete.

Example: progress 32, target 36 = 60% complete. the HTML is rendered as value="32" max="36"

The CSS will style this as 32% complete. It does it this way in demo vault now and results in inconsistent colors used. So much so that two progress bars which both actually = 33% complete can be colored differently if the value of one is "10" and one is "50".

Snag_ed3d85

My change updates the calculation to force the max to 100 and set the value to the percentage of progress as it relates to target.