diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6b665aa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} diff --git a/000-boilerplate/index.html b/000-boilerplate/index.html index c1ff5cb..964d393 100644 --- a/000-boilerplate/index.html +++ b/000-boilerplate/index.html @@ -3,17 +3,52 @@ - My Project -

My Project

+
+
+

Be the Best

+
+
+

Be the Best

+
+
+

Be the Best

+
+
+

Be the Best

+
+
+

Be the Best

+
+
diff --git a/000-boilerplate/script.js b/000-boilerplate/script.js index e69de29..c6bcdd0 100644 --- a/000-boilerplate/script.js +++ b/000-boilerplate/script.js @@ -0,0 +1,14 @@ +const panels = document.querySelectorAll(".panel"); + +panels.forEach((panel) => { + panel.addEventListener("click", () => { + removeActiveClasses(); + panel.classList.add("active"); + }); +}); + +const removeActiveClasses = () => { + panels.forEach((panel) => { + panel.classList.remove("active"); + }); +}; diff --git a/000-boilerplate/style.css b/000-boilerplate/style.css index b35d72c..f0d16e9 100644 --- a/000-boilerplate/style.css +++ b/000-boilerplate/style.css @@ -1,16 +1,75 @@ -@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap"); +@import url("https://fonts.googleapis.com/css2?family=Muli&display=swap"); * { box-sizing: border-box; } body { - font-family: "Roboto", sans-serif; + font-family: "Muli", sans-serif; display: flex; - flex-direction: column; align-items: center; justify-content: center; height: 100vh; overflow: hidden; margin: 0; } + +.container { + display: flex; + width: 90vw; +} + +@keyframes expand { + from { + flex: 0.5; + } + + to { + flex: 5; + } +} + +@keyframes shrink { + from { + flex: 5; + } + + to { + flex: 0.5; + } +} + +.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; +} + +.panel h3 { + font-size: 24px; + position: absolute; + bottom: 20px; + left: 20px; + margin: 0; + opacity: 0; + transition: opacity 0.3s ease-in 0.4s; +} + +.panel.active { + animation: expand 0.7s ease-in forwards; +} + +.panel:not(.active) { + animation: shrink 0.7s ease-in forwards; +} + +.panel.active h3 { + opacity: 1; +} \ No newline at end of file diff --git a/002-progress steps/index.html b/002-progress steps/index.html index 07e7c79..e084a67 100644 --- a/002-progress steps/index.html +++ b/002-progress steps/index.html @@ -3,21 +3,25 @@ - + Progress Steps +
-
-
-
1
+
+
1
+
2
+
3
+
4
- - +
+ + +
- diff --git a/002-progress steps/khar/style.css b/002-progress steps/khar/style.css new file mode 100644 index 0000000..2a59205 --- /dev/null +++ b/002-progress steps/khar/style.css @@ -0,0 +1,120 @@ +@import url("https://fonts.googleapis.com/css2?family=Muli&display=swap"); + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + display: flex; + justify-content: center; + align-items: center; + + margin-top: 5rem; +} + + +.container { + width: 20rem; + height: 8rem; + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; + gap: 1.4rem; +} + + +/* cicles styles */ +#circle-container { + display: flex; + justify-content: space-around; + align-items: center; +} + +.line { + width: 3rem; + border: solid rgb(224, 213, 213) 2px; + +} + +.active-line { + border-color: blue; +} + +.active-line-animation { + animation: line-animation linear alternate forwards 1s; +} + +@keyframes line-animation { + 0% { + background-color: white; + } + + 100% { + background-color: blue; + } +} + +.circle { + padding-top: 0.4rem; + text-align: center; + border: solid black 1px; + width: 2rem; + height: 2rem; + border-radius: 50%; + color: lightgray; +} + +.active-circle { + background-color: blue; +} + +.active-circle-animation { + animation: circle-animation alternate forwards 0.5s linear; +} + +@keyframes circle-animation { + 0% { + background-color: white; + } + + 100% { + background-color: blue; + } +} + + + +/* Button styles */ +#button-container { + width: 12rem; + height: 3rem; + display: flex; + justify-content: center; + align-items: center; + gap: 2rem; + padding: 1rem; +} + +.btn { + text-align: center; + width: 5rem; + height: 2rem; + opacity: 0.9; + border-radius: 0.2rem; + border: none; + color: rgb(70, 59, 59); +} + +.btn:hover { + opacity: 1; + cursor: pointer; +} + +.active-btn { + background-color: blue; + color: white; + opacity: 0.8; +} \ No newline at end of file diff --git a/002-progress steps/script.js b/002-progress steps/script.js index 024a72d..e417bfd 100644 --- a/002-progress steps/script.js +++ b/002-progress steps/script.js @@ -1,34 +1,41 @@ -const progress = document.getElementById("progress"); -const prev = document.getElementById("prev"); -const next = document.getElementById("next"); -const circles = document.querySelectorAll(".circle"); - -let currentActive = 1; +"use strict"; -next.addEventListener("click", () => { - currentActive++; - if (currentActive > circles.length) currentActive = circles.length; - update(); -}); +// select all elements i need +const circles = document.querySelectorAll(".circle"); +const lines = document.querySelectorAll(".line"); +const prevBtn = document.querySelector(".prev"); +const nextBtn = document.querySelector(".next"); +let whichNumber = 0; -prev.addEventListener("click", () => { - currentActive--; - if (currentActive < 1) currentActive = 1; - update(); +// Next Event +nextBtn.addEventListener("click", (e) => { + if (whichNumber < 3) { + whichNumber++; + prevBtn.classList.add("active-btn"); + circles[whichNumber].classList.add("active-circle"); + circles[whichNumber].classList.add("active-circle-animation"); + lines[whichNumber - 1].classList.add("active-line"); + lines[whichNumber - 1].classList.add("active-line-animation"); + } + if (whichNumber == 3) { + nextBtn.classList.remove("active-btn"); + nextBtn.disabled = true; + } + console.log(whichNumber); }); -const update = () => { - circles.forEach((circle, index) => { - if (index < currentActive) circle.classList.add("active"); - else circle.classList.remove("active"); - }); - const actives = document.querySelectorAll(".active"); - progress.style.width = - ((actives.length - 1) / (circles.length - 1)) * 100 + "%"; - if (currentActive === 1) prev.disabled = true; - else if (currentActive === circles.length) next.disabled = true; - else { - prev.disabled = false; - next.disabled = false; +// Prev Event +prevBtn.addEventListener("click", (e) => { + if (whichNumber > 0) { + nextBtn.classList.add("active-btn"); + circles[whichNumber].classList.remove("active-circle"); + circles[whichNumber].classList.remove("active-circle-animation"); + lines[whichNumber - 1].classList.remove("active-line"); + lines[whichNumber - 1].classList.remove("active-line-animation"); + whichNumber--; } -}; + if (whichNumber == 0) { + prevBtn.classList.remove("active-btn"); + return; + } +}); diff --git a/002-progress steps/style.css b/002-progress steps/style.css deleted file mode 100644 index b4dfe95..0000000 --- a/002-progress steps/style.css +++ /dev/null @@ -1,100 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Muli&display=swap"); - -:root { - --line-border-fill: #3498db; - --line-border-empty: #e0e0e0; -} - -* { - box-sizing: border-box; -} - -body { - font-family: "Muli", sans-serif; - background-color: #f6f7fb; - display: flex; - align-items: center; - justify-content: center; - height: 100vh; - overflow: hidden; - margin: 0; -} - -.container { - text-align: center; -} - -.progress-container { - display: flex; - justify-content: space-between; - position: relative; - margin-bottom: 30px; - max-width: 100%; - width: 350px; -} - -.progress-container::before { - content: ""; /* Mandatory with ::before */ - background-color: var(--line-border-empty); - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - height: 4px; - width: 100%; - z-index: -1; -} - -.progress { - background-color: var(--line-border-fill); - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - height: 4px; - width: 0%; - z-index: -1; - transition: 0.4s ease; -} - -.circle { - background-color: #fff; - color: #999; - border-radius: 50%; - height: 30px; - width: 30px; - display: flex; - align-items: center; - justify-content: center; - border: 3px solid var(--line-border-empty); - transition: 0.4s ease; -} - -.circle.active { - border-color: var(--line-border-fill); -} - -.btn { - background-color: var(--line-border-fill); - color: #fff; - border: 0; - border-radius: 6px; - cursor: pointer; - font-family: inherit; - padding: 8px 30px; - margin: 5px; - font-size: 14px; -} - -.btn:active { - transform: scale(0.98); -} - -.btn:focus { - outline: 0; -} - -.btn:disabled { - background-color: var(--line-border-empty); - cursor: not-allowed; -} diff --git a/004-hidden search widget/.vscode/settings.json b/004-hidden search widget/.vscode/settings.json new file mode 100644 index 0000000..6b665aa --- /dev/null +++ b/004-hidden search widget/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} diff --git a/004-hidden search widget/index.html b/004-hidden search widget/index.html index 3c8792a..1d061f2 100644 --- a/004-hidden search widget/index.html +++ b/004-hidden search widget/index.html @@ -3,19 +3,24 @@ - + magnifier + -