diff --git a/docs/taskbar.md b/docs/taskbar.md index 8b89edd..5dd5630 100644 --- a/docs/taskbar.md +++ b/docs/taskbar.md @@ -13,6 +13,12 @@ The taskbar is composed of the following components: ## Properties +### Variants +The menu bar variant can be changed by adding the following classes to the menu bar element: + +* `taskbar--floating` - A floating taskbar + + ### Position The taskbar can be positioned by setting the `position` property in the HTML. diff --git a/src/css/taskbar.css b/src/css/taskbar.css index 43e8710..7d43867 100644 --- a/src/css/taskbar.css +++ b/src/css/taskbar.css @@ -2,25 +2,24 @@ --taskbar-bg-color: #1c1c1c; } -#taskbar { - height: 50px; - background-color: var(--taskbar-bg-color); - - position: absolute; - bottom: 0; - width: 100vw; - height: 55px; - padding: 8px; +.taskbar { display: flex; align-items: center; justify-content: space-around; + background-color: var(--taskbar-bg-color); + position: absolute; + bottom: 0; + width: 100vw; + height: 55px; + padding: 8px; } + /* APPS */ -#taskbar .apps { +.taskbar__apps { display: flex; align-items: center; align-content: flex-start; @@ -30,36 +29,41 @@ width: 100%; } -#taskbar .apps taskbar-app { +.taskbar__apps taskbar-app { height: 100%; } -#taskbar .apps .separator { +.taskbar__separator { height: 100%; width: 1px; background-color: #333; } + /* APPLETS */ -#taskbar .applets { +.taskbar__applets { display: flex; } + /* WEATHER APPLET */ -#taskbar .weather { +.taskbar__weather { display: none; } + + /* TIME & DATE */ -#taskbar .time-date { +.taskbar__time-date { display: none; } -/* ##### FLOAT Variant ##### */ -#taskbar[design="float"] { + +/* ##### FLOATING Variant ##### */ +.taskbar--floating { margin: 6px; border-radius: 12px; width: unset; @@ -67,15 +71,15 @@ transform: translateX(-50%); } -#taskbar[position="bottom"][design="float"] .applets { +.taskbar[position="bottom"].taskbar--floating .taskbar__applets { display: none; } /* ##### SIDE Variant ##### */ -#taskbar[position="left"], -#taskbar[position="right"] { +.taskbar[position="left"], +.taskbar[position="right"] { transform: none; height: 80vh; width: 50px; @@ -86,41 +90,41 @@ } -#taskbar[position="left"] { +.taskbar[position="left"] { left: 0; right: unset; } -#taskbar[position="right"] { +.taskbar[position="right"] { right: 0; left: unset; } -#taskbar[position="left"] > *, -#taskbar[position="right"] > * { +.taskbar[position="left"] > *, +.taskbar[position="right"] > * { width: 100%; height: unset; } -#taskbar[position="left"] .apps taskbar-app, -#taskbar[position="right"] .apps taskbar-app { +.taskbar[position="left"] .taskbar__apps taskbar-app, +.taskbar[position="right"] .taskbar__apps taskbar-app { width: 100%; height: unset; } -#taskbar[position="left"] .apps .separator, -#taskbar[position="right"] .apps .separator { +.taskbar[position="left"] .taskbar__separator, +.taskbar[position="right"] .taskbar__separator { width: 100%; height: 1px; } -#taskbar[position="left"] .applets, -#taskbar[position="right"] .applets { +.taskbar[position="left"] .taskbar__applets, +.taskbar[position="right"] .taskbar__applets { display: unset; } -#taskbar[position="left"] .applets *, -#taskbar[position="right"] .applets * { +.taskbar[position="left"] .taskbar__applets *, +.taskbar[position="right"] .taskbar__applets * { width: 100%; height: block; } @@ -129,7 +133,7 @@ /* ### BOTTOM Variant ### */ -#taskbar[position="bottom"] { +.taskbar[position="bottom"] { display: flex; align-items: center; justify-content: space-between; @@ -137,15 +141,15 @@ height: 50px; } -#taskbar[position="bottom"] > * { +.taskbar[position="bottom"] > * { height: 80%; } -#taskbar[position="bottom"] > * > * { +.taskbar[position="bottom"] > * > * { height: 100%; } -#taskbar[position="bottom"] .apps { +.taskbar[position="bottom"] .taskbar__apps { /* center the apps in the middle of the taskbar (ignoring other elements) */ /* position: absolute; @@ -163,34 +167,32 @@ /* hide power button */ -#taskbar[position="bottom"] .applets button-power { +.taskbar[position="bottom"] .taskbar__applets button-power { display: none; } -#taskbar[position="bottom"] .weather { +.taskbar[position="bottom"] .taskbar__weather { display: unset; } /* ## TASKBAR TIME ## */ -#taskbar[position="bottom"] .time-date { +.taskbar[position="bottom"] .taskbar__time-date { display: flex; } -#taskbar .time-date { +.taskbar__time-date { + justify-content: center; + flex-direction: column; color: white; text-align: right; font-size: 14px; - - justify-content: center; - flex-direction: column; - user-select: none; } -#taskbar .time-date * { +.taskbar__time-date * { height: unset; } \ No newline at end of file diff --git a/src/index.html b/src/index.html index c296ad1..36be963 100644 --- a/src/index.html +++ b/src/index.html @@ -68,7 +68,7 @@ - + @@ -160,23 +160,23 @@