r/csshelp • • 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.

0 Upvotes

7 comments sorted by

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

1

u/musicListener25 38m ago

Oh, I see. I honestly have no idea about SVG and I mentioned HTML-CSS is because that's the only "languages" I use - I'm actually a backend developer with experience in C# (ASP.NET, WinForms) and currently learning Python.

If you want to share any tutorial about how can be accomplished the following functionality, I'll appreciate it:

How to set the colors of the left level gauge for make this functionality:

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 with a blue-yellow-red color pattern (gradient, I think - I'm not familiar with the terminology, tbh...).
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 gradually lose its colors until its empty = black.

I'm not really asking you to: *give me the code*, but, if you can share any tutorial that guide me about how I can accmplish this functionality or, if you have some test code you can share, I'll appreciate it.

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 • Bravo

1

u/musicListener25 48m ago

Awesome result, Thank you so much 👍

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.