<div style="display:flex; height:10px; width:50px; border-radius:12px; overflow:hidden;">
<div style="width:{{#replace:{{{1|0}}}|-}}%; background: linear-gradient({{#switch: {{lc:{{{2|{{{type|}}}}}}}}
|love = #F7A4E0,#ED81C1
|#default = {{#if:{{#pos:{{{1}}}|-}}|#DC334F,#B70C26|#96CF24,#4CAD40}}
}});"></div>
<div style="width:calc(100% - {{#replace:{{{1|0}}}|-}}%); background:grey;"></div>
</div>
<div style="margin-top:-5px; width:50px; text-align:center;"><small>{{{1|0}}}/100</small></div>
Also optimized the switch, made it case insensitive, and added the option to use "type" unnamed in parameter 2.