From a2cfd00f19eb950e5f8d8f7f5534081fa734707f Mon Sep 17 00:00:00 2001 From: blake Date: Fri, 13 Feb 2026 08:34:49 -0600 Subject: [PATCH] - Added testimonial section - Lessed the hover scale effect for the project cards --- css/style.css | 106 ++++++++++++++++++++++++++++++++++++--- img/icons/check.svg | 50 ++++++++++++++++++ img/icons/left-arrow.svg | 42 ++++++++++++++++ index.html | 30 ++++++++++- script.js | 66 +++++++++++++++++++++++- 5 files changed, 286 insertions(+), 8 deletions(-) create mode 100644 img/icons/check.svg create mode 100644 img/icons/left-arrow.svg diff --git a/css/style.css b/css/style.css index b102ffc..d0233e3 100644 --- a/css/style.css +++ b/css/style.css @@ -18,7 +18,7 @@ Default: 1 - Secondary: #ffe642, #2d54c7 -- Tints: +- Tints: - Shades: @@ -313,6 +313,96 @@ p { width: 5rem; } +/* Testimonial Section */ +.testimonial-section { + background: linear-gradient( + to bottom, + transparent, + #2d54c7, + #2d54c7, + transparent + ); + display: flex; + align-items: center; + justify-content: center; + padding: 5rem 2rem; +} + +.testimonial-slider { + display: flex; + flex-direction: column; + align-items: center; + gap: 2rem; + max-width: 120rem; + width: 100%; +} + +.testimonial-slides { + position: relative; + width: 100%; + overflow: hidden; +} + +.testimonial-slide { + display: none; + flex-direction: column; + align-items: center; + gap: 1rem; + padding: 2rem; + animation: fadeIn 0.5s ease; +} + +.testimonial-slide.active { + display: flex; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +.testimonial-text { + font-style: italic; + margin-bottom: 2rem; +} + +.client-name { + font-family: "Space Grotesk", sans-serif; + font-size: 2.5rem; + font-weight: 700; +} + +.testimonial-controls { + display: flex; + gap: 2rem; +} + +.testimonial-btn { + background-color: transparent; + border: 3px solid #fff; + color: #fff; + width: 3.5rem; + height: 3.5rem; + border-radius: 50%; + font-size: 2rem; + cursor: pointer; + transition: all 0.3s; + display: flex; + align-items: center; + justify-content: center; +} + +.testimonial-btn:hover { + background-color: #ffe642; + border-color: #ffe642; + color: #0b1532; + transform: scale(1.05); +} + .about-section { display: flex; justify-content: center; @@ -410,26 +500,30 @@ p { .project-card:hover { box-shadow: 0 1rem 1rem 0 #2d54c7; - transform: scale(1.1); + transform: scale(1.02); } .project-card--1 { - background-image: linear-gradient(rgba(11, 21, 50, 0.75)), + background-image: + linear-gradient(rgba(11, 21, 50, 0.75)), url("/img/client-img/ten8locker.jpg"); } .project-card--2 { - background-image: linear-gradient(rgba(11, 21, 50, 0.75)), + background-image: + linear-gradient(rgba(11, 21, 50, 0.75)), url("/img/client-img/christshands.jpg"); } .project-card--3 { - background-image: linear-gradient(rgba(11, 21, 50, 0.75)), + background-image: + linear-gradient(rgba(11, 21, 50, 0.75)), url("/img/client-img/terrytownpuppies.jpg"); } .project-card--4 { - background-image: linear-gradient(rgba(11, 21, 50, 0.75)), + background-image: + linear-gradient(rgba(11, 21, 50, 0.75)), url("/img/client-img/hopefoodpantry.jpg"); } diff --git a/img/icons/check.svg b/img/icons/check.svg new file mode 100644 index 0000000..a7d17ee --- /dev/null +++ b/img/icons/check.svg @@ -0,0 +1,50 @@ + + + + + + + diff --git a/img/icons/left-arrow.svg b/img/icons/left-arrow.svg new file mode 100644 index 0000000..1ef5ffc --- /dev/null +++ b/img/icons/left-arrow.svg @@ -0,0 +1,42 @@ + + + + + + diff --git a/index.html b/index.html index 6a2a683..ec041ab 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + @@ -169,6 +169,34 @@ +
+
+
+ check icon +

Testimonials

+
+
+
+ + +
+
+
+
diff --git a/script.js b/script.js index ef38f5d..ba8de97 100644 --- a/script.js +++ b/script.js @@ -16,6 +16,70 @@ navLinks.forEach((link) => { }); }); +// Testimonial Slider +const testimonials = [ + { + text: "Working with Blake at Cosmically Creative was an incredibly valuable experience and made the process of developing a website seem very straightforward and easy-going. He provided several ideas and illustrations of what we could do for a website that would help connect the people in need and interested in what our organization is about and the services we have to offer. Blake communicated very well with us and kept us informed of the progress he was making through this process. He listens very well and works hard to understand our needs and desires for this website tool to be best for our organization. We highly recommend his services!!", + name: "‐ Christ's Hands", + }, + { + text: "Cosmically Creative built my website exactly how I envisioned it—clean, functional, and professional. They were easy to work with, quick to respond, and clearly cared about getting every detail right. The end result speaks for itself. From our first conversation, they took the time to understand my business and what I needed the site to accomplish. I never felt rushed or out of the loop—updates came regularly, and my feedback was always taken seriously. I'd recommend them to anyone looking for a web developer who actually listens.", + name: "‐ Ten8Locker", + }, +]; + +const slidesContainer = document.querySelector(".testimonial-slides"); +let currentSlide = 0; + +function buildSlides() { + testimonials.forEach((testimonial, i) => { + const slide = document.createElement("div"); + slide.classList.add("testimonial-slide"); + if (i === 0) slide.classList.add("active"); + slide.innerHTML = ` +

“${testimonial.text}”

+

${testimonial.name}

+ `; + slidesContainer.appendChild(slide); + }); +} + +function showSlide(index) { + const slides = document.querySelectorAll(".testimonial-slide"); + slides.forEach((slide) => slide.classList.remove("active")); + currentSlide = (index + slides.length) % slides.length; + slides[currentSlide].classList.add("active"); +} + +buildSlides(); + +function setSlidesHeight() { + const slides = document.querySelectorAll(".testimonial-slide"); + let maxHeight = 0; + slides.forEach((slide) => { + slide.classList.add("active"); + maxHeight = Math.max(maxHeight, slide.scrollHeight); + slide.classList.remove("active"); + }); + slidesContainer.style.minHeight = maxHeight + "px"; + slides[currentSlide].classList.add("active"); +} + +setSlidesHeight(); +window.addEventListener("resize", setSlidesHeight); + +document + .querySelector(".testimonial-btn--prev") + .addEventListener("click", () => { + showSlide(currentSlide - 1); + }); + +document + .querySelector(".testimonial-btn--next") + .addEventListener("click", () => { + showSlide(currentSlide + 1); + }); + // Scroll Animations document.addEventListener("DOMContentLoaded", () => { const observerOptions = { root: null, rootMargin: "0px", threshold: 0.5 }; @@ -29,7 +93,7 @@ document.addEventListener("DOMContentLoaded", () => { }; const observer = new IntersectionObserver(onIntersection, observerOptions); const elementsToAnimate = document.querySelectorAll( - ".animate-on-scroll, .animate-on-scroll-delay" + ".animate-on-scroll, .animate-on-scroll-delay", ); elementsToAnimate.forEach((el) => observer.observe(el)); });