From 3a4b43ec88db41a44121c9f7c72329ef78abd182 Mon Sep 17 00:00:00 2001 From: blake Date: Fri, 13 Feb 2026 11:00:06 -0600 Subject: [PATCH] Built a slider for the Projects section --- css/queries.css | 83 +++++++++++++++++++++------ css/style.css | 106 ++++++++++++++++++++++++++++++++-- index.html | 149 +++++++++++++++++++++++++++++++++--------------- script.js | 142 ++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 412 insertions(+), 68 deletions(-) diff --git a/css/queries.css b/css/queries.css index 5d0556b..632511f 100644 --- a/css/queries.css +++ b/css/queries.css @@ -20,8 +20,20 @@ } .project-card { - width: 45rem; - height: 28rem; + width: 42rem; + height: 26rem; + } + + .project-track { + height: 54rem; + } + + .project-slide.slide-prev { + transform: translate(calc(-50% - 38rem), 0) scale(0.8); + } + + .project-slide.slide-next { + transform: translate(calc(-50% + 38rem), 0) scale(0.8); } .steps-header { @@ -78,8 +90,20 @@ } .project-card { - width: 40rem; - height: 25rem; + width: 35rem; + height: 22rem; + } + + .project-track { + height: 50rem; + } + + .project-slide.slide-prev { + transform: translate(calc(-50% - 32rem), 0) scale(0.75); + } + + .project-slide.slide-next { + transform: translate(calc(-50% + 32rem), 0) scale(0.75); } .contact-grid { @@ -177,7 +201,7 @@ .about-content { max-width: 90%; - padding: 10rem 0; + padding: 25rem 0; } .about-wrapper { @@ -188,13 +212,33 @@ bottom: -28rem; } - .project-grid { - grid-template-columns: 1fr; + .project-card { + width: 45rem; + height: 28rem; } - .project-card { + .project-desc { + max-width: 65rem; + } + + .project-slide { width: 65rem; - height: 40rem; + } + + .project-track { + height: 58rem; + } + + .project-slide.slide-prev { + transform: translate(calc(-50% - 50rem), 0) scale(0.8); + opacity: 0; + pointer-events: none; + } + + .project-slide.slide-next { + transform: translate(calc(-50% + 50rem), 0) scale(0.8); + opacity: 0; + pointer-events: none; } .contact-grid { @@ -297,18 +341,25 @@ /************************/ @media (max-width: 31em) { - .project-card { - width: 55rem; - height: 32rem; - } - .about-content { padding-bottom: 30rem; } .project-card { - width: 42rem; - height: 28rem; + width: 38rem; + height: 24rem; + padding: 2rem; + display: flex; + flex-direction: column; + justify-content: center; + } + + .project-desc { + max-width: 38rem; + } + + .project-track { + height: 54rem; } .contact-grid { diff --git a/css/style.css b/css/style.css index f8e4dbb..972b183 100644 --- a/css/style.css +++ b/css/style.css @@ -470,10 +470,107 @@ p { top: 3rem; } -.project-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 5rem; +.project-carousel { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + gap: 3rem; + width: 100%; + max-width: 160rem; +} + +.project-track { + position: relative; + width: 100%; + height: 58rem; + overflow: hidden; +} + +.project-slide { + position: absolute; + top: 0; + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + width: 50rem; + transition: + transform 0.6s ease, + opacity 0.6s ease; + will-change: transform, opacity; +} + +.project-desc { + text-align: left; + max-width: 50rem; + width: 100%; + margin-top: 2rem; + transition: opacity 0.6s ease; +} + +.project-slide.slide-active { + transform: translateX(-50%) scale(1); + opacity: 1; + z-index: 3; +} + +.project-slide.slide-prev { + transform: translate(calc(-50% - 44rem), 0) scale(0.8); + opacity: 0.4; + z-index: 2; +} + +.project-slide.slide-next { + transform: translate(calc(-50% + 44rem), 0) scale(0.8); + opacity: 0.4; + z-index: 2; +} + +.project-slide.slide-prev .project-desc, +.project-slide.slide-next .project-desc { + opacity: 0.15; +} + +.project-slide.slide-hidden-left { + transform: translate(calc(-50% - 90rem), 0) scale(0.6); + opacity: 0; + z-index: 1; + pointer-events: none; +} + +.project-slide.slide-hidden-right { + transform: translate(calc(-50% + 90rem), 0) scale(0.6); + opacity: 0; + z-index: 1; + pointer-events: none; +} + +.project-controls { + display: flex; + gap: 2rem; +} + +.project-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; +} + +.project-btn:hover { + background-color: #ffe642; + border-color: #ffe642; + color: #0b1532; + transform: scale(1.05); } .tag { @@ -500,7 +597,6 @@ p { .project-card:hover { box-shadow: 0 1rem 1rem 0 #2d54c7; - transform: scale(1.02); } .project-card--1 { diff --git a/index.html b/index.html index 1e162ff..a51479c 100644 --- a/index.html +++ b/index.html @@ -242,57 +242,114 @@

Past Projects

astronaut -
-
-

Valor Design Labs

- Shopify +