From b591904038ea454af0ed931ab134958a09a519df Mon Sep 17 00:00:00 2001 From: ThronRycer Date: Fri, 9 Apr 2021 18:29:20 +0200 Subject: [PATCH] Day 1: Add CSS Only Soluition --- 50Days/day1_cssonly/index.html | 74 ++++++++++++++++++++++++++++++++++ 50Days/day1_cssonly/script.js | 0 50Days/day1_cssonly/style.css | 72 +++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 50Days/day1_cssonly/index.html create mode 100644 50Days/day1_cssonly/script.js create mode 100644 50Days/day1_cssonly/style.css diff --git a/50Days/day1_cssonly/index.html b/50Days/day1_cssonly/index.html new file mode 100644 index 0000000..a735d5f --- /dev/null +++ b/50Days/day1_cssonly/index.html @@ -0,0 +1,74 @@ + + + + + + + + + + Day 1 - Expanding Cards + + + +
+ + + + + + + + + + + + + +
+ + + + diff --git a/50Days/day1_cssonly/script.js b/50Days/day1_cssonly/script.js new file mode 100644 index 0000000..e69de29 diff --git a/50Days/day1_cssonly/style.css b/50Days/day1_cssonly/style.css new file mode 100644 index 0000000..2094bf6 --- /dev/null +++ b/50Days/day1_cssonly/style.css @@ -0,0 +1,72 @@ +@import url("https://fonts.googleapis.com/css2?family=Muli&display=swap"); + +* { + box-sizing: border-box; +} + +body { + font-family: "Muli", sans-serif; + display: flex; + align-items: center; + justify-content: center; + height: 100vh; + overflow: hidden; + margin: 0; +} + +.container { + display: flex; + width: 90vw; +} + +.panel { + background-size: auto 100%; + background-position: center; + background-repeat: no-repeat; + height: 80vh; + border-radius: 50px; + color: #fff; + cursor: pointer; + flex: 0.5; + margin: 10px; + position: relative; + transition: flex 0.7s ease-in; +} + +.panel h3 { + font-size: 24px; + position: absolute; + bottom: 20px; + left: 20px; + margin: 0; + opacity: 0; + transition: opacity 0.4s ease-in; +} + +.panel.active { + flex: 5; +} + +.img-toggle { + display: none; +} + +.img-toggle:checked + .panel { + flex: 5; +} + +.img-toggle:checked + .panel h3 { + opacity: 1; + transition: opacity 0.5s ease-in 0.2s; +} + +@media (max-width: 480px) { + .container { + width: 100vw; + } + + .panel:nth-of-type(4), + .panel:nth-of-type(5) { + display: none; + } +}