diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/audioplayer/assets/maile.mp3 b/audioplayer/assets/maile.mp3 new file mode 100644 index 0000000..c16df20 Binary files /dev/null and b/audioplayer/assets/maile.mp3 differ diff --git a/audioplayer/audioplayer.html b/audioplayer/audioplayer.html new file mode 100644 index 0000000..1cf558f --- /dev/null +++ b/audioplayer/audioplayer.html @@ -0,0 +1,70 @@ + + + + + + + Audio Player + + + + + +
+
+

Hi, this is audio or music player build using ismple html, css, and javascript

+

This is a simple audio player with the functinality of play, pause, next, and farward. Here i have used + custom timing, next, pause, play and back functionality.

+
+
+
+ circle profile image of the audio player +
+ +
+ +
Maile Covered by John Chamling Rai
+
+ +
+

00:00

+
+ + + + +
+
+ + +
+
+ + + + + + + \ No newline at end of file diff --git a/audioplayer/js/audioplayer.js b/audioplayer/js/audioplayer.js new file mode 100644 index 0000000..3fef5ca --- /dev/null +++ b/audioplayer/js/audioplayer.js @@ -0,0 +1,77 @@ +let audioPlayer = document.getElementById("audio-player") +let progressBar = document.getElementById("progressBar") +let timer = document.querySelector(".audio-player-wrapper__timer") +let audioPlayerWrapper = document.querySelector(".audio-player-wrapper") + +// controls +let playBtn = document.querySelector(".audio-player-wrapper__play") +let skipPrev = document.querySelector(".audio-player-wrapper__skipPrev") +let skipNext = document.querySelector(".audio-player-wrapper__nextSkip") + +document.addEventListener("DOMContentLoaded", () => { + // Update progress bar as the audio plays + audioPlayer.addEventListener("timeupdate", () => { + const progress = (audioPlayer.currentTime / audioPlayer.duration) * 100 + progressBar.value = progress + + // Calculate total time and current time + let totalSeconds = Math.floor(audioPlayer.duration || 0) + let minutes = Math.floor(totalSeconds / 60) + let seconds = totalSeconds % 60 + + let currentSeconds = Math.floor(audioPlayer.currentTime || 0) + let currentMinutes = Math.floor(currentSeconds / 60) + let currentDisplaySeconds = currentSeconds % 60 + + timer.innerHTML = `${currentMinutes + .toString() + .padStart(2, "0")}:${currentDisplaySeconds + .toString() + .padStart(2, "0")} / ${minutes}:${seconds.toString().padStart(2, "0")}` + }) + + // Play and pause functionality + playBtn.addEventListener("click", () => { + if (audioPlayer.paused) { + audioPlayer.play() + } else { + audioPlayer.pause() + } + }) + + // Update play/pause button icon + audioPlayer.addEventListener("play", () => { + playBtn.innerHTML = `` + }) + + audioPlayer.addEventListener("pause", () => { + playBtn.innerHTML = `` + }) + + // Skip functionality + skipPrev.addEventListener("click", () => { + audioPlayer.currentTime = Math.max(0, audioPlayer.currentTime - 10) + }) + + skipNext.addEventListener("click", () => { + audioPlayer.currentTime = Math.min( + audioPlayer.duration, + audioPlayer.currentTime + 10 + ) + }) + + // Dragging progress bar + progressBar.addEventListener("input", (e) => { + const newTime = (progressBar.value / 100) * audioPlayer.duration + audioPlayer.currentTime = newTime + }) + + // Update progress bar and handle drag + progressBar.addEventListener("mousedown", () => { + audioPlayer.pause() // Pause audio while dragging + }) + + progressBar.addEventListener("mouseup", () => { + audioPlayer.play() // Resume audio after dragging + }) +}) diff --git a/audioplayer/styles/audioplayer.css b/audioplayer/styles/audioplayer.css new file mode 100644 index 0000000..96195d8 --- /dev/null +++ b/audioplayer/styles/audioplayer.css @@ -0,0 +1,110 @@ +@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"); +* { + margin: 0px; + padding: 0px; + box-sizing: border-box; + font-family: "Courier Prime", monospace; + font-weight: 400; + font-style: normal; +} + +.audio-player-wrapper { + min-height: 100vh; + width: 100vw; + height: 100%; + padding-top: 50px; + padding-inline: 50px; + margin-bottom: 100px; + display: flex; + align-items: center; + flex-direction: column; + gap: 50px; +} +.audio-player-wrapper__heading { + text-align: center; + line-height: 40px; +} +.audio-player-wrapper__heading h1 { + font-size: 32px; +} +.audio-player-wrapper__heading p { + font-size: 20px; +} +.audio-player-wrapper__audio-wrapper { + border: 1px solid #c1d8c3; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + gap: 20px; + height: 500px; + width: 400px; + border-radius: 10px; + padding: 0px 50px; + box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1); +} +.audio-player-wrapper figure { + width: 100%; + display: flex; + flex-direction: column; + gap: 15px; +} +.audio-player-wrapper figure figcaption { + line-height: 30px; + text-transform: capitalize; +} +.audio-player-wrapper__image { + border: 1px solid orangered; + overflow: hidden; + height: 180px; + width: 180px; + border-radius: 100%; + filter: drop-shadow(0 0 1.5rem #94c0f3); + animation: circle 2s infinite alternate; +} +@keyframes circle { + 0% { + scale: 1; + } + 50% { + scale: 0.98; + } + 100% { + scale: 1; + } +} +.audio-player-wrapper__image img { + height: 100%; + width: 100%; + -o-object-fit: cover; + object-fit: cover; + -o-object-position: top; + object-position: top; +} +.audio-player-wrapper__controls { + display: flex; + justify-content: space-between; + padding-block: 20px; +} +.audio-player-wrapper__controls button { + display: flex; + justify-content: center; + align-items: center; + height: 30px; + width: 30px; + border: none; + background: none; +} +.audio-player-wrapper__controls button svg { + height: 50px; + width: 50px; + fill: #0075ff; +} + +#audio-player-wrapper__progressContainer { + width: 100%; +} +#audio-player-wrapper__progressContainer input[type=range] { + width: 100%; + height: 100%; +}/*# sourceMappingURL=audioplayer.css.map */ \ No newline at end of file diff --git a/audioplayer/styles/audioplayer.css.map b/audioplayer/styles/audioplayer.css.map new file mode 100644 index 0000000..cf1b4e6 --- /dev/null +++ b/audioplayer/styles/audioplayer.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["audioplayer.scss","audioplayer.css"],"names":[],"mappings":"AAAQ,oLAAA;AAER;EACE,WAAA;EACA,YAAA;EACA,sBAAA;EACA,uCAAA;EACA,gBAAA;EACA,kBAAA;ACAF;;ADGA;EACE,iBAAA;EACA,YAAA;EACA,YAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EAEA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,SAAA;ACDF;ADGE;EACE,kBAAA;EACA,iBAAA;ACDJ;ADEI;EACE,eAAA;ACAN;ADGI;EACE,eAAA;ACDN;ADKE;EACE,yBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,6BAAA;EACA,SAAA;EACA,aAAA;EACA,YAAA;EACA,mBAAA;EACA,iBAAA;EACA,iDAAA;ACHJ;ADME;EACE,WAAA;EACA,aAAA;EACA,sBAAA;EACA,SAAA;ACJJ;ADMI;EACE,iBAAA;EACA,0BAAA;ACJN;ADQE;EACE,2BAAA;EACA,gBAAA;EACA,aAAA;EACA,YAAA;EACA,mBAAA;EACA,uCAAA;EACA,uCAAA;ACNJ;ADQI;EACE;IACE,QAAA;ECNN;EDQI;IACE,WAAA;ECNN;EDQI;IACE,QAAA;ECNN;AACF;ADSI;EACE,YAAA;EACA,WAAA;EACA,oBAAA;KAAA,iBAAA;EACA,uBAAA;KAAA,oBAAA;ACPN;ADWE;EACE,aAAA;EACA,8BAAA;EACA,mBAAA;ACTJ;ADWI;EACE,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;ACTN;ADWM;EACE,YAAA;EACA,WAAA;EACA,aAAA;ACTR;;ADkBA;EACE,WAAA;ACfF;ADiBE;EACE,WAAA;EACA,YAAA;ACfJ","file":"audioplayer.css"} \ No newline at end of file diff --git a/audioplayer/styles/audioplayer.scss b/audioplayer/styles/audioplayer.scss new file mode 100644 index 0000000..d5da5c1 --- /dev/null +++ b/audioplayer/styles/audioplayer.scss @@ -0,0 +1,125 @@ +@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"); + +* { + margin: 0px; + padding: 0px; + box-sizing: border-box; + font-family: "Courier Prime", monospace; + font-weight: 400; + font-style: normal; +} + +.audio-player-wrapper { + min-height: 100vh; + width: 100vw; + height: 100%; + padding-top: 50px; + padding-inline: 50px; + margin-bottom: 100px; + + display: flex; + align-items: center; + flex-direction: column; + gap: 50px; + + &__heading { + text-align: center; + line-height: 40px; + h1 { + font-size: 32px; + } + + p { + font-size: 20px; + } + } + + &__audio-wrapper { + border: 1px solid #c1d8c3; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + gap: 20px; + height: 500px; + width: 400px; + border-radius: 10px; + padding: 0px 50px; + box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1); + } + + figure { + width: 100%; + display: flex; + flex-direction: column; + gap: 15px; + + figcaption { + line-height: 30px; + text-transform: capitalize; + } + } + + &__image { + border: 1px solid orangered; + overflow: hidden; + height: 180px; + width: 180px; + border-radius: 100%; + filter: drop-shadow(0 0 1.5rem #94c0f3); + animation: circle 2s infinite alternate; + + @keyframes circle { + 0% { + scale: 1; + } + 50% { + scale: 0.98; + } + 100% { + scale: 1; + } + } + + img { + height: 100%; + width: 100%; + object-fit: cover; + object-position: top; + } + } + + &__controls { + display: flex; + justify-content: space-between; + padding-block: 20px; + + button { + display: flex; + justify-content: center; + align-items: center; + height: 30px; + width: 30px; + border: none; + background: none; + + svg { + height: 50px; + width: 50px; + fill: #0075ff; + } + } + } + + // &__timer { + // } +} + +#audio-player-wrapper__progressContainer { + width: 100%; + + input[type="range"] { + width: 100%; + height: 100%; + } +} diff --git a/day1/assignment1.js b/day1/assignment.js similarity index 96% rename from day1/assignment1.js rename to day1/assignment.js index 72a5cb1..9589b5b 100644 --- a/day1/assignment1.js +++ b/day1/assignment.js @@ -1,3 +1,4 @@ +let result = document.getElementsByClassName("result") // Define Array and objects and console them with appropriate console tools. // Defining an array diff --git a/day1/assignment2.js b/day1/assignment2.js index b9bf00f..0445c4d 100644 --- a/day1/assignment2.js +++ b/day1/assignment2.js @@ -11,5 +11,7 @@ let resultc = temperatureConversion(45, "c") let resultf = temperatureConversion(90, "f") // consoling the results +console.log("Start of the consoles of question 2") console.log(resultc) console.log(resultf) +console.log("End of the consoles of questions 2") diff --git a/day1/assignment3.js b/day1/assignment3.js index 2dfcf03..0f30bea 100644 --- a/day1/assignment3.js +++ b/day1/assignment3.js @@ -5,8 +5,8 @@ function percentageGrade(mark) { let grade = mark + let percentage = (mark / 100) * 100 if (grade > 90) { - let percentage = grade console.log(`You received ${grade} and its ${percentage}% in overall.`) } diff --git a/day1/day1.html b/day1/day1.html new file mode 100644 index 0000000..bfb31db --- /dev/null +++ b/day1/day1.html @@ -0,0 +1,30 @@ + + + + + + + Day 1 Assignments + + + +

Question 1 to 5 Consoles.

+ +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/day2/day2.html b/day2/day2.html new file mode 100644 index 0000000..5c4e567 --- /dev/null +++ b/day2/day2.html @@ -0,0 +1,153 @@ + + + + + + + Day Assignments + + + +

Day2 - Assignment 1

+
+        function isEven(num) {
+        let evenNumbers = []
+        for (let i = 1; i <= num; i++) { if (i % 2==0) { evenNumbers.push(i) } } return evenNumbers } // calling function and
+            function returns an array of even numbers. so we to loop through it. var even=isEven(100) // printing the array of
+            even numbers. console.log(even) // consoling each even number using for each loop. even.forEach((e)=> {
+            console.log(e)
+            })
+
+    
+

Day2 - Assignment 2

+
+        // Create an array. Remove 3 elements starting from index 4, and insert 5 new elements at that position using the
+        appropriate method.
+        
+        let fruits = [
+        "orange",
+        "apple",
+        "mango",
+        "grapes",
+        "pineaples",
+        "watermelon",
+        "guava",
+        "kiwi",
+        "strawberry",
+        ]
+        // removing the three elements from the fruits array.
+        fruits.pop() //this remove n-1 element
+        fruits.pop() // this remove n-2 element
+        fruits.pop() // this remove n-3 element
+        
+        // ===== note that is implementing below
+        // or we can use splice() to remove the element from an array.
+        console.table(fruits)
+        
+        // adding the element from index 4
+        
+        fruits.splice(4, 0, "newFruit1", "newFruit2", "newFruit3") //starting from index 4 and remove 0 element from the array.
+        console.table(fruits)
+
+    
+

Day2 - Assignment 3

+
// Create an array.
+    // Remove first element
+    // Remove last element
+    // Add new element at the beginning
+    // Add a new element at the end
+    // Console log all the arrays along with the original modified array.
+    
+    const sampleArray = [
+    "apple",
+    "banana",
+    "cherry",
+    "date",
+    "elderberry",
+    "fig",
+    "grape",
+    "honeydew",
+    "kiwi",
+    "lemon",
+    ]
+    console.log("original array")
+    console.table(sampleArray)
+    
+    // removing the first element of the array
+    sampleArray.shift()
+    console.log("removing the first element")
+    console.log(sampleArray)
+    
+    // removing the last element
+    sampleArray.pop()
+    console.log("removing the element from the last")
+    console.log(sampleArray)
+    
+    // adding the new element add the beginning
+    sampleArray.unshift("guava")
+    console.log("adding new element at the beginning")
+    console.log(sampleArray)
+    
+    //add new element at the end
+    sampleArray.push("lastelement")
+    console.log("adding new element at last")
+    console.log(sampleArray)
+
+

Day2 -Assignment 4

+
+    // Create a new array element.
+    // Create a new array with the multiplication of 5
+    // Create a new array finding the maximum number of new array (task number 4.a)
+    // Also list out the even numbers of both new and original array.
+    
+    const arrayNumbers = [1, 2, 3, 4, 5, 20, 6, 7, 8, 9, 10, 40, 60, 90, 200]
+    
+    // creating a new array that is multiple of 5
+    let newArrayNumbers = arrayNumbers.map((x) => x * 5)
+    
+    // creating new array based on newArrayNumbers, finding the maximum number.
+    
+    // ========= METHOD 1
+    let maxNumber = newArrayNumbers.reduce((acc, curr) => (acc > curr ? acc : curr))
+    let newMaxArray = []
+    newMaxArray.push(maxNumber)
+    
+    // ======== METHOD 2
+    let max = 0
+    for (let i = 0; i < newArrayNumbers.length; i++) { if (max> newArrayNumbers[i]) {
+        max = max
+        } else {
+        max = newArrayNumbers[i]
+        }
+        }
+    
+        // defining new array
+        let newMaxArray1 = []
+        newMaxArray1.push(max)
+        // Consoling the output
+        // original array
+        console.log("Original array: ")
+        console.log(arrayNumbers)
+    
+        // multiple of five
+        console.log("Multiple of 5 array:")
+        console.log(newArrayNumbers)
+    
+        // max array
+        console.log("Finding the max array element using reduce function")
+        console.log(newMaxArray)
+        // second method console
+        console.log("Finding the max array elemment using loop:")
+        console.log(newMaxArray1)
+
+
+ + + + + + \ No newline at end of file diff --git a/day5/assets/css/slider.css b/day5/assets/css/slider.css new file mode 100644 index 0000000..24c765d --- /dev/null +++ b/day5/assets/css/slider.css @@ -0,0 +1,55 @@ +* { + margin: 0px; + padding: 0px; + box-sizing: border-box; +} + +.swiper { + width: 100%; + height: 400px; +} + +.thumbs-swiper { + width: 100%; + height: 150px; + margin-bottom: 20px; + padding: 20px 30px; +} + +.swiper-slide img { + width: 100%; + height: 100%; + -o-object-fit: cover; + object-fit: cover; + -o-object-position: center; + object-position: center; + overflow: hidden; +} +.swiper-slide img:hover { + cursor: pointer; +} + +.thumbs-swiper .swiper-slide img { + border-radius: 10px; +} + +@media screen and (min-width: 768px) { + .swiper { + height: 500px; + } + .thumbs-swiper { + height: 120px; + } +} +@media screen and (min-width: 1024px) { + .swiper, + .thumbs-swiper { + max-width: 1920px; + } + .swiper { + height: 760px; + } + .thumbs-swiper { + height: 200px; + } +}/*# sourceMappingURL=slider.css.map */ \ No newline at end of file diff --git a/day5/assets/css/slider.css.map b/day5/assets/css/slider.css.map new file mode 100644 index 0000000..c6ee941 --- /dev/null +++ b/day5/assets/css/slider.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["slider.scss","slider.css"],"names":[],"mappings":"AAAA;EACE,WAAA;EACA,YAAA;EACA,sBAAA;ACCF;;ADEA;EACE,WAAA;EACA,aAAA;ACCF;;ADEA;EACE,WAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;ACCF;;ADEA;EACE,WAAA;EACA,YAAA;EACA,oBAAA;KAAA,iBAAA;EACA,0BAAA;KAAA,uBAAA;EAEA,gBAAA;ACAF;ADEE;EACE,eAAA;ACAJ;;ADIA;EACE,mBAAA;ACDF;;ADIA;EACE;IACE,aAAA;ECDF;EDIA;IACE,aAAA;ECFF;AACF;ADKA;EACE;;IAEE,iBAAA;ECHF;EDMA;IACE,aAAA;ECJF;EDOA;IACE,aAAA;ECLF;AACF","file":"slider.css"} \ No newline at end of file diff --git a/day5/assets/css/slider.scss b/day5/assets/css/slider.scss new file mode 100644 index 0000000..0082909 --- /dev/null +++ b/day5/assets/css/slider.scss @@ -0,0 +1,59 @@ +* { + margin: 0px; + padding: 0px; + box-sizing: border-box; +} + +.swiper { + width: 100%; + height: 400px; +} + +.thumbs-swiper { + width: 100%; + height: 150px; + margin-bottom: 20px; + padding: 20px 30px; +} + +.swiper-slide img { + width: 100%; + height: 100%; + object-fit: cover; + object-position: center; + + overflow: hidden; + + &:hover { + cursor: pointer; + } +} + +.thumbs-swiper .swiper-slide img { + border-radius: 10px; +} + +@media screen and (min-width: 768px) { + .swiper { + height: 500px; + } + + .thumbs-swiper { + height: 120px; + } +} + +@media screen and (min-width: 1024px) { + .swiper, + .thumbs-swiper { + max-width: 1920px; + } + + .swiper { + height: 760px; + } + + .thumbs-swiper { + height: 200px; + } +} diff --git a/day5/assets/image1.jpg b/day5/assets/image1.jpg new file mode 100644 index 0000000..c851391 Binary files /dev/null and b/day5/assets/image1.jpg differ diff --git a/day5/assets/image2.jpg b/day5/assets/image2.jpg new file mode 100644 index 0000000..3dc61b7 Binary files /dev/null and b/day5/assets/image2.jpg differ diff --git a/day5/assets/image3.jpg b/day5/assets/image3.jpg new file mode 100644 index 0000000..70ac4c1 Binary files /dev/null and b/day5/assets/image3.jpg differ diff --git a/day5/assets/image4.jpg b/day5/assets/image4.jpg new file mode 100644 index 0000000..6fa5bc8 Binary files /dev/null and b/day5/assets/image4.jpg differ diff --git a/day5/assets/image5.jpg b/day5/assets/image5.jpg new file mode 100644 index 0000000..68a4b6f Binary files /dev/null and b/day5/assets/image5.jpg differ diff --git a/day5/assets/image6.jpg b/day5/assets/image6.jpg new file mode 100644 index 0000000..739faf5 Binary files /dev/null and b/day5/assets/image6.jpg differ diff --git a/day5/assets/image7.jpg b/day5/assets/image7.jpg new file mode 100644 index 0000000..739faf5 Binary files /dev/null and b/day5/assets/image7.jpg differ diff --git a/day5/assets/image8.jpg b/day5/assets/image8.jpg new file mode 100644 index 0000000..540d3e2 Binary files /dev/null and b/day5/assets/image8.jpg differ diff --git a/day5/slider.html b/day5/slider.html new file mode 100644 index 0000000..05b4f32 --- /dev/null +++ b/day5/slider.html @@ -0,0 +1,37 @@ + + + + + + + Slider using SwiperJS + + + + + + + +
+ +
+
+ + + +
+
+ + +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/day5/swiper.js b/day5/swiper.js new file mode 100644 index 0000000..46906bc --- /dev/null +++ b/day5/swiper.js @@ -0,0 +1,101 @@ +let swiperMain = document.querySelector(".main-swiper") +let thumbSwiper = document.querySelector(".thumbs-swiper") + +let chessImages = [ + "/javascript/day5/assets/image1.jpg", + "/javascript/day5/assets/image2.jpg", + "/javascript/day5/assets/image3.jpg", + "/javascript/day5/assets/image4.jpg", + "/javascript/day5/assets/image5.jpg", + "/javascript/day5/assets/image6.jpg", + "/javascript/day5/assets/image7.jpg", + "/javascript/day5/assets/image8.jpg", +] + +// For main swiper +if (swiperMain) { + chessImages.forEach((image) => { + // creating swiper-wrapper element. + let swiperWrapper = document.querySelector(".swiper-wrapper") + swiperWrapper.classList.add("swiper-wrapper") + + // creating swiper-slide element. + let swiperSlide = document.createElement("div") + swiperSlide.classList.add("swiper-slide") + + // creating img element. + let imageTag = document.createElement("img") + imageTag.src = image + imageTag.alt = image + + // appending the childs. + swiperSlide.appendChild(imageTag) + swiperWrapper.appendChild(swiperSlide) + }) +} else { + console.log("swiper-main element is not found in the dom.") +} + +// For thumbsSwiper + +if (thumbSwiper) { + chessImages.forEach((image) => { + // create swiper-slide element + let thumbSwiperSlide = document.createElement("div") + thumbSwiperSlide.classList.add("swiper-slide") + + // create image + let thumbImage = document.createElement("img") + thumbImage.alt = image + thumbImage.src = image + thumbSwiperSlide.appendChild(thumbImage) + document.getElementById("swiper-wrapper").appendChild(thumbSwiperSlide) + }) +} else { + console.log("thumbs swiper dom is not loaded.") +} + +// thumb swiper +const thumbsSwiper = new Swiper(".thumbs-swiper", { + spaceBetween: 10, + slidesPerView: 8, + freeMode: true, + watchSlidesProgress: true, + loop: true, + autoplay: { + delay: 2000, + }, + breakpoints: { + 768: { + slidesPerView: 6, + }, + 400: { + slidesPerView: 4, + }, + 200: { + slidesPerView: 2, + }, + }, +}) +const mainSwiper = new Swiper(".main-swiper", { + spaceBetween: 10, + loop: true, + autoplay: { + delay: 2000, + }, + navigation: { + nextEl: ".swiper-button-next", + prevEl: ".swiper-button-prev", + }, + pagination: { + el: ".swiper-pagination", + clickable: true, + }, + scrollbar: { + el: ".swiper-scrollbar", + draggable: true, + }, + thumbs: { + swiper: thumbsSwiper, + }, +}) diff --git a/final/assets/announcement.png b/final/assets/announcement.png new file mode 100644 index 0000000..58895d5 Binary files /dev/null and b/final/assets/announcement.png differ diff --git a/final/assets/background.jpg b/final/assets/background.jpg new file mode 100644 index 0000000..cf671c3 Binary files /dev/null and b/final/assets/background.jpg differ diff --git a/final/assets/badge.png b/final/assets/badge.png new file mode 100644 index 0000000..af2f4f0 Binary files /dev/null and b/final/assets/badge.png differ diff --git a/final/assets/chess.png b/final/assets/chess.png new file mode 100644 index 0000000..46758d8 Binary files /dev/null and b/final/assets/chess.png differ diff --git a/final/assets/target.png b/final/assets/target.png new file mode 100644 index 0000000..0af8ff3 Binary files /dev/null and b/final/assets/target.png differ diff --git a/final/assets/team/team1.jpg b/final/assets/team/team1.jpg new file mode 100644 index 0000000..2e5f004 Binary files /dev/null and b/final/assets/team/team1.jpg differ diff --git a/final/assets/team/team2.jpg b/final/assets/team/team2.jpg new file mode 100644 index 0000000..40de761 Binary files /dev/null and b/final/assets/team/team2.jpg differ diff --git a/final/assets/team/team3.jpg b/final/assets/team/team3.jpg new file mode 100644 index 0000000..5dad90c Binary files /dev/null and b/final/assets/team/team3.jpg differ diff --git a/final/assets/team/team4.jpg b/final/assets/team/team4.jpg new file mode 100644 index 0000000..ad2e359 Binary files /dev/null and b/final/assets/team/team4.jpg differ diff --git a/final/assets/trophy.png b/final/assets/trophy.png new file mode 100644 index 0000000..17c6698 Binary files /dev/null and b/final/assets/trophy.png differ diff --git a/final/index.html b/final/index.html new file mode 100644 index 0000000..768314c --- /dev/null +++ b/final/index.html @@ -0,0 +1,222 @@ + + + + + + + JavaScript Final Assignment + + + + + + + + +
+ +
+ + + + + + + + +
+

Featured Teams Members

+ +
+
+ + +
+
+
Team Member 2
+ Image of team member 2 +
+
+
+
Team Member 3
+ Image of team member 3 +
+
+
+
Team Member 4
+ Image of team member 4 +
+
+
+
Team Member 1
+ Image of team member 1 +
+
+
+
Team Member 1
+ Image of team member 1 +
+
+
+
Team Member 1
+ Image of team member 1 +
+
+
+
Team Member 1
+ Image of team member 1 +
+
+
+
Team Member 1
+ Image of team member 1 +
+
+ + +
+ +
+ + +
+

Our Events Teams

+ +
+ +
+ +
+
+
Team 1
+ Image of Team 1 +
+
+
+
Team 1
+ Image of Team 1 +
+
+
+
Team 1
+ Image of Team 1 +
+
+
+
Team 1
+ Image of Team 1 +
+ +
+ + + + + + +
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/final/js/bubble.js b/final/js/bubble.js new file mode 100644 index 0000000..16f46f9 --- /dev/null +++ b/final/js/bubble.js @@ -0,0 +1,91 @@ +const canvas = document.getElementById("bubbleCanvas") +const ctx = canvas.getContext("2d") + +canvas.width = window.innerWidth +canvas.height =350 + +// Bubble class for handling each bubble's properties +class Bubble { + constructor(x, y, radius, speedX, speedY, color) { + this.x = x + this.y = y + this.radius = radius + this.speedX = speedX + this.speedY = speedY + this.color = color + } + + // Update the bubble's position and handle collision + update(bubbles) { + this.x += this.speedX + this.y += this.speedY + + // Check for collision with the left and right edges and reverse the direction + if (this.x + this.radius > canvas.width || this.x - this.radius < 0) { + this.speedX = -this.speedX // Reverse direction on collision with edges + } + + // Check for collision with the top and bottom edges + if (this.y + this.radius > canvas.height || this.y - this.radius < 0) { + this.speedY = -this.speedY // Bounce vertically without resetting + } + + // Check for collision with other bubbles + for (let i = 0; i < bubbles.length; i++) { + if (this === bubbles[i]) continue + + let dx = this.x - bubbles[i].x + let dy = this.y - bubbles[i].y + let distance = Math.sqrt(dx * dx + dy * dy) + + if (distance < this.radius + bubbles[i].radius) { + this.speedX = -this.speedX + this.speedY = -this.speedY + this.color = getRandomColor() + } + } + } + + // Draw the bubble + draw() { + ctx.beginPath() + ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2) + ctx.fillStyle = this.color + ctx.fill() + ctx.closePath() + } +} + +// Function to get random color +function getRandomColor() { + const letters = "0123456789ABCDEF" + let color = "#" + for (let i = 0; i < 6; i++) { + color += letters[Math.floor(Math.random() * 16)] + } + return color +} + +// Initialize bubbles +let bubbles = [] +for (let i = 0; i < 6; i++) { + let radius = Math.random() * 30 + 10 // Bubble size between 10px and 40px + let x = Math.random() * canvas.width + let y = Math.random() * canvas.height + let speedX = (Math.random() - 0.5) * 3 + let speedY = (Math.random() - 0.5) * 3 + let color = getRandomColor() + bubbles.push(new Bubble(x, y, radius, speedX, speedY, color)) +} + +// Animation loop +function animate() { + ctx.clearRect(0, 0, canvas.width, canvas.height) + for (let bubble of bubbles) { + bubble.update(bubbles) + bubble.draw() + } + requestAnimationFrame(animate) +} + +animate() diff --git a/final/js/gsap.js b/final/js/gsap.js new file mode 100644 index 0000000..4e616bb --- /dev/null +++ b/final/js/gsap.js @@ -0,0 +1,174 @@ +gsap.registerPlugin(ScrollTrigger) + +// gradient colors collection +const gradients = [ + "linear-gradient(90deg, #D3F1DF, #85A98F)", + "linear-gradient(180deg, #D3F1DF, #5A6C57)", + "linear-gradient(45deg, #D3F1DF, #525B44)", + "linear-gradient(135deg, #85A98F, #5A6C57)", + "linear-gradient(360deg, #85A98F, #525B44)", + "radial-gradient(circle, #D3F1DF, #5A6C57)", + "radial-gradient(ellipse, #85A98F, #525B44)", + "radial-gradient(circle at center, #5A6C57, #D3F1DF)", +] + +// Popup Section + +let gradientIndex = 0 + +function changeGradient() { + gradientIndex = (gradientIndex + 1) % gradients.length + + gsap.to(".popup", { + background: gradients[gradientIndex], + duration: 1, + }) + + gsap.to("#navbar", { + background: gradients[gradientIndex], + duration: 0.5, + }) +} +setInterval(changeGradient, 5000) + +const text = document.getElementById("popup") +const textContent = text.textContent +text.innerHTML = textContent + .split(" ") + .map((word) => { + const color = gsap.utils.random([ + "#2C3E50", + "#4A4A4A", + "#4B6A52", + "#3E4E43", + "#333333", + "#2C3E47", + ]) + return `${word} ` + }) + .join("") + +gsap.from(".popup-word", { + opacity: 0, + y: 20, + duration: 1, + stagger: 0.5, + ease: "power1.out", + onComplete: () => { + document.querySelector(".container__navbar").scrollIntoView({ + behavior: "smooth", + }) + + // Animate the navbar after scrolling + gsap.fromTo(".container__navbar", { + y: 0, + duration: 2, + ease: "power2.inOut", + }) + }, +}) +// Popup Section End + +// Menu Open + +document.addEventListener("DOMContentLoaded", () => { + let menu = document.querySelector(".menu") + let navbar = document.querySelector(".navbar__list") + let close = document.querySelector(".close") + let tl = gsap.timeline() + + tl.to(".navbar__list", { + right: 0, + duration: 1.5, + }) + + tl.from(".navbar__item", { + x: 100, + duration: 0.8, + stagger: 0.5, + opacity: 0, + }) + tl.pause() + + if (menu) { + menu.addEventListener("click", (e) => { + tl.play() + }) + } else { + console.log("menu is not") + } + + // for closing the menu bar + + if (close) { + close.addEventListener("click", (e) => { + tl.reverse() + }) + } else { + console.log("close is not loaded.") + } +}) + +// End of Menu Open + +// Leadspace section +let leadspace__title = document.querySelector(".leadspace__title") +leadspace__title.innerHTML = leadspace__title.textContent + .split(" ") + .map((word) => { + const color = gsap.utils.random([ + "#2C3E50", + "#4A4A4A", + "#4B6A52", + "#3E4E43", + "#333333", + "#2C3E47", + ]) + return `${word}` + }) + .join("
") + +gsap.from(".leadspace-title", { + opacity: 0, + duration: 3, + stagger: 0.5, + scrollTrigger: { + trigger: ".leadspace-title", + start: "100 90%", + end: "100 20%", + }, +}) + +gsap.from(".leadspace__subtitle", { + x: -200, + opacity: 0, + duration: 3, + delay: 2, + stagger: 0.5, + scrollTrigger: { + trigger: ".leadspace__subtitle", + }, +}) + +gsap.from(".leadspace__cta", { + opacity: 0, + duration: 3, + delay: 3, + x: -200, + scrollTrigger: { + trigger: ".leadspace__cta", + }, +}) + +gsap.from(".trophy", { + opacity: 0, + x: 500, + duration: 4, + rotate: 360, + delay: 4, + scrollTrigger: { + trigger: ".trophy", + }, +}) + +// End of leadspace section diff --git a/final/js/slider.js b/final/js/slider.js new file mode 100644 index 0000000..f858a32 --- /dev/null +++ b/final/js/slider.js @@ -0,0 +1,68 @@ +// For the progress bar +window.addEventListener("scroll", function () { + const scrollHeight = + document.documentElement.scrollHeight - window.innerHeight + const scrollPosition = window.scrollY + const scrollPercent = (scrollPosition / scrollHeight) * 100 + + document.getElementById("progress-bar").style.width = scrollPercent + "%" +}) + +// end of progressbar. + +const swipers = document.querySelectorAll(".swiper") + +swipers.forEach((swiperContainer, index) => { + const paginationClass = `swiper-pagination-${index}` + const scrollbarClass = `swiper-scrollbar-${index}` + console.log(swipers) + console.log(swiperContainer) + + // Add unique classes for each Swiper instance's pagination and scrollbar + const scrollbarEl = document.createElement("div") + scrollbarEl.className = `swiper-scrollbar ${scrollbarClass}` + swiperContainer.appendChild(scrollbarEl) + + const paginationEl = document.createElement("div") + paginationEl.className = `swiper-pagination ${paginationClass}` + swiperContainer.appendChild(paginationEl) + + // Initialize slider1 + // if (typeof sliders !== "undefined") { + new Swiper(swiperContainer, { + loop: true, + spaceBetween: 30, + speed: 2000, + pauseOnMouseEnter: true, + effect: "fade", + fadeEffect: { + crossFade: true, + }, + // coverflowEffect: + // sliders[index] !== 0 + // ? { + // rotate: 50, + // stretch: 0, + // depth: 100, + // modifier: 1, + // slideShadows: true, + // } + // : undefined, + slidesPerView: "auto", + autoplay: { + delay: 2000, + disableOnInteraction: false, + }, + pagination: { + el: `.${paginationClass}`, + clickable: true, + }, + scrollbar: { + el: `.${scrollbarClass}`, + }, + }) + + // Add event listeners for pausing autoplay on mouse enter and resume on mouse leave + swiperContainer.addEventListener("mouseenter", () => swiper.autoplay.stop()) + swiperContainer.addEventListener("mouseleave", () => swiper.autoplay.start()) +}) diff --git a/index.html b/index.html index 2caf4dc..307bfad 100644 --- a/index.html +++ b/index.html @@ -36,11 +36,7 @@

javascript Assignments

day 1
@@ -48,14 +44,11 @@

javascript Assignments

day 2
- + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a11874e --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "javascript", + "version": "1.0.0", + "main": "index.js", + "repository": "git@github.com:devhimall/javascript.git", + "author": "devhimall ", + "license": "MIT", + "dependencies": { + "gsap": "^3.12.5", + "swiper": "^11.1.15" + } +} diff --git a/styles/leadspace.css b/styles/leadspace.css new file mode 100644 index 0000000..711124b --- /dev/null +++ b/styles/leadspace.css @@ -0,0 +1,342 @@ +@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Crimson+Pro:ital,wght@0,200..900;1,200..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"); +:root { + --primary-color: #3e4e43; + --hover-color: orangered; + --background-color: #66785f; + --text-dark: #333333; + --text-light: #d1cfc6; + --accent-color: #2c3e47; + --secondary-accent: #4b6a52; + --secondary-color: #ffffff; +} + +*, +::before, +::after { + margin: 0px; + padding: 0px; + box-sizing: border-box; +} + +body { + font-family: serif; + font-optical-sizing: auto; + font-weight: 400; + font-style: normal; + overflow-x: hidden; +} + +#progress-bar { + position: fixed; + top: 0; + left: 0; + width: 0%; + height: 5px; + background-color: var(--hover-color); + z-index: 9999; +} + +.container { + height: 100%; + width: 100%; +} +.container .popup { + min-height: 100vh; + height: 100%; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + font-size: clamp(50px, 10vw, 50px); + padding: 50px; + background-color: var(--background-color); +} +.container .popup__title { + font-weight: 500; + text-transform: uppercase; + text-align: center; +} +.container .popup__title .popup-word { + font-size: clamp(50px, 10vw, 130px); +} +.container__navbar { + min-height: 100vh; + height: 100%; + width: 100%; + color: var(--primary-color); + position: relative; + z-index: 3; +} +.container__navbar .navbar__wrapper { + display: flex; + justify-content: space-between; + align-items: center; + width: 90%; + margin: auto; + padding: 40px 0px; + font-size: 20px; +} +.container__navbar .navbar__wrapper__logo { + text-align: center; +} +.container__navbar .navbar__wrapper__list { + display: flex; + gap: 30px; + list-style: none; +} +.container__navbar .navbar__wrapper__link { + text-decoration: none; + text-transform: capitalize; +} +.container__navbar .navbar__text { + color: var(--primary-color); + font-size: clamp(40px, 8vw, 60px); + text-decoration: none; + font-weight: 600; +} +.container__navbar .navbar__text:hover { + cursor: pointer; +} +.container__navbar .navbar__list { + position: absolute; + height: 100vh; + width: 80%; + top: 0; + right: -500px; + background-color: var(--secondary-accent); + color: var(--text-light); + list-style: none; + display: flex; + flex-direction: column; + gap: 10px; + padding: 30px; +} +@media screen and (min-width: 768px) { + .container__navbar .navbar__list { + width: 500px; + } +} +.container__navbar .navbar__menu:hover { + cursor: pointer; +} +.container__navbar .navbar__close { + right: 0; + width: 100%; + text-align: end; + margin-bottom: 30px; +} +.container__navbar .navbar__item { + width: 100%; + padding: 20px 20px; + line-height: 28px; + border-radius: 8px; +} +.container__navbar .navbar__link { + text-decoration: none; + width: 100%; + color: var(--secondary-color); + font-weight: 500; + line-height: 28px; +} +.container__leadspace, .container__slider { + height: 600px; + width: 100%; +} +.container__leadspace { + height: 100%; + width: 100%; + position: absolute; + top: 0; + z-index: -1; + display: grid; + grid-template-columns: repeat(1, 1fr); + align-items: center; + gap: 20px; + padding-top: 30%; + padding-left: 50px; +} +@media screen and (min-width: 768px) { + .container__leadspace { + grid-template-columns: repeat(2, 1fr); + padding-top: 15%; + } +} +.container__leadspace .leadspace__wrapper { + height: 100%; + width: 90%; + margin: auto; + display: flex; + flex-direction: column; + justify-content: center; + gap: 50px; +} +.container__leadspace .leadspace__image-wrapper { + display: none; + justify-content: center; + align-items: center; + grid-template-columns: repeat(1, 1fr); + height: 100%; +} +@media screen and (min-width: 768px) { + .container__leadspace .leadspace__image-wrapper { + display: grid; + grid-template-columns: repeat(2, auto); + gap: 20px; + } +} +.container__leadspace .leadspace__image-wrapper img { + height: 150px; + width: 150px; +} +.container__leadspace .leadspace__title { + font-size: clamp(40px, 4vw, 50px); + font-weight: 600; + line-height: clamp(40px, 6vw, 50px); + width: 200px; + text-wrap: wrap; +} +.container__leadspace .leadspace__subtitle { + font-size: clamp(24px, 4vw, 30px); + line-height: clamp(30px, 4vw, 40px); +} +.container__leadspace .leadspace__cta { + background-color: var(--primary-color); + color: var(--secondary-color); + padding: 20px 30px; + width: -moz-fit-content; + width: fit-content; + font-size: 18px; + text-transform: capitalize; + text-decoration: none; + border-radius: 2px; +} +.container__leadspace .leadspace__cta:hover { + background-color: var(--hover-color); + transition: all 500ms ease-in-out; +} +.container .container__slider { + height: -moz-fit-content; + height: fit-content; + padding: 100px 20px; +} +.container .container__slider .slider__title { + font-size: clamp(24px, 4vw, 45px); + text-transform: capitalize; + line-height: clamp(40px, 6vw, 60px); + padding: 30px 0px; + width: 90%; + margin: auto; +} +.container .swiper { + width: 100%; + height: 600px; + padding: 50px 20px; +} +.container .swiper .swiper-wrapper { + height: 100%; + width: 100%; +} +.container .swiper .swiper-wrapper .swiper-slide { + overflow-y: hidden; + position: relative; + height: 500px; +} +.container .swiper .swiper-wrapper .swiper-slide img { + height: 100%; + width: 100%; + -o-object-fit: cover; + object-fit: cover; + -o-object-position: top; + object-position: top; + z-index: 0; +} +.container .swiper .swiper-wrapper .swiper-slide__overlay { + height: 100%; + width: 100%; + position: absolute; + z-index: 8; + background-color: black; + opacity: 0.5; +} +.container .swiper .swiper-wrapper .swiper-slide__content { + height: 100%; + width: 100%; + position: absolute; + z-index: 9; + color: var(--text-light); + display: flex; + justify-content: center; + align-items: center; +} +.container .swiper .swiper-wrapper .swiper-slide:first-child { + background-color: red; +} +.container .swiper .swiper-wrapper .swiper-slide:nth-child(2) { + background-color: blue; +} +.container .swiper .swiper-wrapper .swiper-slide:nth-child(3) { + background-color: green; +} +@media screen and (min-width: 768px) { + .container .swiper { + padding: 50px; + } +} +.container .slider--events { + margin-top: 0px; +} +.container .footer { + background-color: var(--secondary-accent); + height: 600px; + width: 100%; + position: relative; +} +.container .footer #bubbleCanvas { + height: 100%; + width: 100%; + position: relative; + z-index: 0; +} +.container .footer__overlay { + position: absolute; + top: 0; + height: 100%; + width: 100%; + background-color: var(--primary-color); + opacity: 0.3; + z-index: 1; +} +.container .footer__lists { + display: grid; + grid-template-columns: repeat(1, 1fr); + gap: 20px; + text-align: start; + padding: 0px 30px; + list-style: none; + font-size: clamp(16px, 1vw, 18px); + color: var(--secondary-color); + position: absolute; + top: 100px; + z-index: 2; +} +.container .footer__lists li { + display: flex; + flex-direction: column; + gap: 20px; + font-weight: 300; + width: 100%; +} +.container .footer__lists li:first-child { + font-weight: 800; + font-size: 24px; +} +@media screen and (min-width: 768px) { + .container .footer { + height: 350px; + } + .container .footer__lists { + grid-template-columns: repeat(3, 1fr); + width: 90%; + margin: auto; + } +}/*# sourceMappingURL=leadspace.css.map */ \ No newline at end of file diff --git a/styles/leadspace.css.map b/styles/leadspace.css.map new file mode 100644 index 0000000..934a0fc --- /dev/null +++ b/styles/leadspace.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["leadspace.scss","leadspace.css"],"names":[],"mappings":"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","file":"leadspace.css"} \ No newline at end of file diff --git a/styles/leadspace.scss b/styles/leadspace.scss new file mode 100644 index 0000000..583eaf8 --- /dev/null +++ b/styles/leadspace.scss @@ -0,0 +1,385 @@ +@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Crimson+Pro:ital,wght@0,200..900;1,200..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"); +:root { + --primary-color: #3e4e43; + --hover-color: orangered; + --background-color: #66785f; + --text-dark: #333333; + --text-light: #d1cfc6; + --accent-color: #2c3e47; + --secondary-accent: #4b6a52; + --secondary-color: #ffffff; +} + +$navbar: "navbar"; +$leadspace: "leadspace"; + +*, +::before, +::after { + margin: 0px; + padding: 0px; + box-sizing: border-box; +} + +body { + font-family: serif; + font-optical-sizing: auto; + font-weight: 400; + font-style: normal; + overflow-x: hidden; +} + +#progress-bar { + position: fixed; + top: 0; + left: 0; + width: 0%; + height: 5px; + background-color: var(--hover-color); + z-index: 9999; +} + +.container { + height: 100%; + width: 100%; + + // Popup + .popup { + min-height: 100vh; + height: 100%; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + font-size: clamp(50px, 10vw, 50px); + padding: 50px; + background-color: var(--background-color); + + &__title { + font-weight: 500; + text-transform: uppercase; + text-align: center; + + .popup-word { + font-size: clamp(50px, 10vw, 130px); + } + } + } + + &__navbar { + min-height: 100vh; + height: 100%; + width: 100%; + color: var(--primary-color); + position: relative; + z-index: 3; + + .#{$navbar} { + &__wrapper { + display: flex; + justify-content: space-between; + align-items: center; + width: 90%; + margin: auto; + padding: 40px 0px; + font-size: 20px; + + &__logo { + text-align: center; + } + + &__list { + display: flex; + gap: 30px; + list-style: none; + } + + // logo text: + &__link { + text-decoration: none; + text-transform: capitalize; + } + } + + &__text { + color: var(--primary-color); + font-size: clamp(40px, 8vw, 60px); + text-decoration: none; + font-weight: 600; + + &:hover { + cursor: pointer; + } + } + + &__list { + position: absolute; + height: 100vh; + width: 80%; + top: 0; + right: -500px; + background-color: var(--secondary-accent); + color: var(--text-light); + list-style: none; + display: flex; + flex-direction: column; + gap: 10px; + padding: 30px; + + @media screen and (min-width: 768px) { + width: 500px; + } + } + + &__menu { + &:hover { + cursor: pointer; + } + } + + &__close { + right: 0; + width: 100%; + text-align: end; + margin-bottom: 30px; + } + &__item { + width: 100%; + padding: 20px 20px; + line-height: 28px; + border-radius: 8px; + } + &__link { + text-decoration: none; + width: 100%; + color: var(--secondary-color); + font-weight: 500; + line-height: 28px; + } + } + } + + &__leadspace, + &__slider { + height: 600px; + width: 100%; + } + + // Leadspace section styles + &__leadspace { + height: 100%; + width: 100%; + position: absolute; + top: 0; + z-index: -1; + display: grid; + grid-template-columns: repeat(1, 1fr); + align-items: center; + gap: 20px; + padding-top: 30%; + padding-left: 50px; + + @media screen and (min-width: 768px) { + grid-template-columns: repeat(2, 1fr); + padding-top: 15%; + } + + .#{$leadspace} { + &__wrapper { + height: 100%; + width: 90%; + margin: auto; + display: flex; + flex-direction: column; + justify-content: center; + gap: 50px; + } + + &__image-wrapper { + display: none; + justify-content: center; + align-items: center; + grid-template-columns: repeat(1, 1fr); + height: 100%; + @media screen and (min-width: 768px) { + display: grid; + grid-template-columns: repeat(2, auto); + gap: 20px; + } + img { + height: 150px; + width: 150px; + // border: 1px solid red; + } + } + + &__title { + font-size: clamp(40px, 4vw, 50px); + font-weight: 600; + line-height: clamp(40px, 6vw, 50px); + width: 200px; + text-wrap: wrap; + } + + &__subtitle { + font-size: clamp(24px, 4vw, 30px); + line-height: clamp(30px, 4vw, 40px); + } + + &__cta { + background-color: var(--primary-color); + color: var(--secondary-color); + padding: 20px 30px; + width: fit-content; + font-size: 18px; + text-transform: capitalize; + text-decoration: none; + border-radius: 2px; + &:hover { + background-color: var(--hover-color); + transition: all 500ms ease-in-out; + } + } + } + } + + // End of Leadspace section style + .container__slider { + height: fit-content; + padding: 100px 20px; + + .slider__title { + font-size: clamp(24px, 4vw, 45px); + text-transform: capitalize; + line-height: clamp(40px, 6vw, 60px); + padding: 30px 0px; + width: 90%; + margin: auto; + } + } + + .swiper { + width: 100%; + height: 600px; + padding: 50px 20px; + + .swiper-wrapper { + height: 100%; + width: 100%; + .swiper-slide { + overflow-y: hidden; + position: relative; + height: 500px; + + img { + height: 100%; + width: 100%; + object-fit: cover; + object-position: top; + z-index: 0; + } + + &__overlay { + height: 100%; + width: 100%; + position: absolute; + z-index: 8; + background-color: black; + opacity: 0.5; + } + &__content { + height: 100%; + width: 100%; + position: absolute; + z-index: 9; + color: var(--text-light); + display: flex; + justify-content: center; + align-items: center; + } + } + .swiper-slide:first-child { + background-color: red; + } + + .swiper-slide:nth-child(2) { + background-color: blue; + } + + .swiper-slide:nth-child(3) { + background-color: green; + } + } + + @media screen and (min-width: 768px) { + padding: 50px; + } + } + + .slider--events { + margin-top: 0px; + // display: none; + } + + // footer + .footer { + background-color: var(--secondary-accent); + height: 600px; + width: 100%; + position: relative; + + #bubbleCanvas { + height: 100%; + width: 100%; + position: relative; + z-index: 0; + } + + &__overlay { + position: absolute; + top: 0; + height: 100%; + width: 100%; + background-color: var(--primary-color); + opacity: 0.3; + z-index: 1; + } + + &__lists { + display: grid; + grid-template-columns: repeat(1, 1fr); + gap: 20px; + text-align: start; + padding: 0px 30px; + list-style: none; + font-size: clamp(16px, 1vw, 18px); + color: var(--secondary-color); + position: absolute; + top: 100px; + z-index: 2; + + li { + display: flex; + flex-direction: column; + gap: 20px; + font-weight: 300; + width: 100%; + } + + li:first-child { + font-weight: 800; + font-size: 24px; + } + } + + @media screen and (min-width: 768px) { + height: 350px; + + &__lists { + grid-template-columns: repeat(3, 1fr); + width: 90%; + margin: auto; + } + } + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..d33142c --- /dev/null +++ b/yarn.lock @@ -0,0 +1,13 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +gsap@^3.12.5: + version "3.12.5" + resolved "https://registry.yarnpkg.com/gsap/-/gsap-3.12.5.tgz#136c02dad4c673b441bdb1ca00104bfcb4eae7f4" + integrity sha512-srBfnk4n+Oe/ZnMIOXt3gT605BX9x5+rh/prT2F1SsNJsU1XuMiP0E2aptW481OnonOGACZWBqseH5Z7csHxhQ== + +swiper@^11.1.15: + version "11.1.15" + resolved "https://registry.yarnpkg.com/swiper/-/swiper-11.1.15.tgz#e2258c8d38282e2f115ca463d6e8c5b84cdcf1ca" + integrity sha512-IzWeU34WwC7gbhjKsjkImTuCRf+lRbO6cnxMGs88iVNKDwV+xQpBCJxZ4bNH6gSrIbbyVJ1kuGzo3JTtz//CBw==