From 8c861b3cbd8593517b5595f2ddc38db3d1809189 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Tue, 23 Aug 2022 17:19:18 +0200 Subject: [PATCH] added switch.css --- Webserver/static/Styles/switch.css | 88 ++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Webserver/static/Styles/switch.css diff --git a/Webserver/static/Styles/switch.css b/Webserver/static/Styles/switch.css new file mode 100644 index 0000000..39c5ce7 --- /dev/null +++ b/Webserver/static/Styles/switch.css @@ -0,0 +1,88 @@ + .toggle { + --width: 60px; + --height: 25px; /*calc(var(--width) / 3); */ + + position: relative; + display: inline-block; + width: var(--width); + height: var(--height); + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3); + border-radius: var(--height); + cursor: pointer; + margin-right: 10px; + } + + .toggle input { + display: none; + } + + .toggle .slider { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: var(--height); + background-color: #ccc; + transition: all 0.4s ease-in-out; + } + + .toggle .slider::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: calc(var(--height)); + height: calc(var(--height)); + border-radius: calc(var(--height) / 2); + background-color: #fff; + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3); + transition: all 0.4s ease-in-out; + } + + .toggle input:checked+.slider { + background-color: #2196F3; + } + + .toggle input:checked+.slider::before { + transform: translateX(calc(var(--width) - var(--height))); + } + + .toggle .labels { + position: absolute; + top: 4px; + left: 10px; + width: 100%; + height: 100%; + font-size: 16px; + font-family: sans-serif; + transition: all 0.4s ease-in-out; + } + + .toggle .labels::after { + content: attr(data-off); + position: absolute; + right: 25px; + color: #4d4d4d; + opacity: 1; + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); + transition: all 0.4s ease-in-out; + } + + .toggle .labels::before { + content: attr(data-on); + position: absolute; + left: 5px; + color: #ffffff; + opacity: 0; + text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.4); + transition: all 0.4s ease-in-out; + } + + .toggle input:checked~.labels::after { + opacity: 0; + } + + .toggle input:checked~.labels::before { + opacity: 1; + } \ No newline at end of file