diff --git a/50Days/day1/index.html b/50Days/day1/index.html new file mode 100644 index 0000000..5f737d6 --- /dev/null +++ b/50Days/day1/index.html @@ -0,0 +1,61 @@ + + + + + + + + + + Day 1 - Expanding Cards + + + +
+
+

Explore The World

+
+
+

Winter in Sweden

+
+
+

Summer in Australia

+
+
+

New York

+
+
+

South East Asia

+
+
+ + + + diff --git a/50Days/day1/script.js b/50Days/day1/script.js new file mode 100644 index 0000000..c36888b --- /dev/null +++ b/50Days/day1/script.js @@ -0,0 +1,14 @@ +const panels = document.querySelectorAll('.panel'); + +panels.forEach((panel) => { + panel.addEventListener('click', () => { + removeActiveClasses(); + panel.classList.add('active'); + }); +}); + +removeActiveClasses = () => { + panels.forEach((panel) => { + panel.classList.remove('active'); + }); +}; diff --git a/50Days/day1/style.css b/50Days/day1/style.css new file mode 100644 index 0000000..2b4c214 --- /dev/null +++ b/50Days/day1/style.css @@ -0,0 +1,64 @@ +@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; +} + +.panel.active h3 { + opacity: 0.9; + 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; + } +}