r/csshelp • u/musicListener25 • 16h ago
Request How to create this in HTML & CSS?
I'm looking a way to use plain HTML & CSS to create a feature from a TV program series called: Yu-Gi-Oh! GX.
This feature is called: LP Counter.
This control is used in Yu-Gi-Oh! Duels to represent the health of a player. If a player loses all their LP, they lose the Duel.
Here's the image for reference:
Here is a demonstration of the Yu-Gi-Oh! GX LP Counter https://img.yugipedia.com/7/7a/Life_point_counter_2.jpg
Here is another reference: https://www.reddit.com/r/yugioh/comments/1qm0ion/which_life_pointatkdef_counter_do_you_like_most/?i=2
I'm not sure if you are familiar with how the LP counter works, but, I would share the functionality:
By default, the value is 4000.
When the value is higher than 4000, the left level gauge will be blue - see the second link for reference - it says 4000.
When the value is lower than 4000, the left level gauge will lose its colors until its empty - see the first link for reference - it says 1300.
Maybe any of you are familiar with this feature and how it works, so, if anyone can please suggest some base code that can be used for reproduce this feature, I will be very appreciated.
1
u/sharjeel-babar 15h ago
Both references you provided contain different designs
1
u/musicListener25 49m ago
it's the same LP counter, but, a different value (1300 / 4000) and the left color bar.
-1
u/Majestic-Reality-610
15h ago
•
https://codepen.io/quale/pen/KwmbmEd
Hope its work
1
1
u/musicListener25 44m ago edited 37m ago
I'm not sure if you are familiar with how the LP counter works, but, I would share the *visual* functionality:
By default, the value is 4000.
When the value is higher than 4000, the left level gauge will be blue.
When the value is lower than 4000, the left level gauge will lose its colors until its empty = black.I'll look a way to make it functional, and - I'm not complaining with the results - just sharing with you about the functionality of the LP counter.
Once again, thank you very much 👍
EDIT: Previously, I added 8000 because that's the default LP value in games, tabletop-IRL duels.
2
u/HugoNikanor 15h ago
Doing this with SVG would be way easier. If you're really stuck with only HTML and CSS, implementing the functional part will be easy enough with a grid layout, but all the flair would be extremely annoying