Arem Daesh Aref Slash
KPCKevin Powell - Community
•Created by Arem Daesh Aref Slash on 10/17/2024 in #front-end
Design Dynamic "Panel" component approach?
1. The panel shows one of many "views" depending on it's state.
2. Each view presents information and may interact with user
3. Any of the views can alter the "panel" state, trigger events
4. Panel responds to state change and events to possibly swap the current view with another
5. Implement using using only javascript/html/css - no frameworks
Ways I know of that might accomlish this:
1. js: directly manipulate the DOM
2. CSS, z-order, hidden/visible, etc
An example would be a "login" panel:
1. state:not-logged-in: the usual username/password and login button
2. state:is-logged-in: "you are logged in as USERNAME", logout button
My impression so far is that css is the more elegant way to do this, however, my knowledge of css pales in comparison to javascript. I just need to get this working quickly without watching a thousand, many out-dated, videos and articles about css.
What are you thoughts on this?
19 replies