Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logos and display in carousel #452

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 43 additions & 8 deletions data/en/clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,48 @@ clients:
show: true
showServices: true

- name: Tactile
image: img/clients/tactile.png
- name: BlueVoyant
image: img/clients/bluevoyant.png
show: true
showServices: true
showServices: false

- name: Trisa
- name: TRISA
image: img/clients/trisa.png
show: true
showServices: true

- name: Qredo
image: img/clients/qredo.png
- name: 202 Group
image: img/clients/202group.png
show: true
showServices: true

- name: 202 Group
image: img/clients/202group.png
- name: mersive
image: img/clients/mersive.png
show: true
showServices: false

- name: WorkMation
image: img/clients/workmation.png
show: true
showServices: false

- name: Bitcoin4U
image: img/clients/btcfu.png
show: true
showServices: false

- name: Tech Sierra
image: img/clients/techsierra.png
show: true
showServices: false

- name: Tactile
image: img/clients/tactile.png
show: true
showServices: true

- name: Qredo
image: img/clients/qredo.png
show: true
showServices: true

Expand All @@ -38,3 +63,13 @@ clients:
image: img/clients/uchicago.png
show: true
showServices: false

- name: UMBC Training Centers
image: img/clients/umbc_c4ai.png
show: true
showServices: false

- name: Georgetown University
image: img/clients/georgetown.png
show: true
showServices: false
35 changes: 26 additions & 9 deletions layouts/shortcodes/clients.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,32 @@ <h2 class="font-bold text-2xl sm:text-4xl text-center mb-10">
</span>
</h2>
{{ end }}
<ul class="flex flex-col md:flex-row md:flex-wrap items-center lg:justify-between gap-12 md:gap-8">
{{ range .clients_item}}
{{ if .show }}
<li>
<img loading="lazy" class="max-w-[180px]" src="{{ .image | absURL }}" alt="{{ .name }}">
</li>
{{ end }}
{{ end }}
</ul>
<div class="embla overflow-hidden" data-loop="true" data-scroll="1">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the user scrolls through the logos, only 1 moves at a time. We can change this to another number. Also, the user will be able to loop through all of the logos. This means that when the user gets to the last logo they will see the first one. This matches how we handle the testimonials.

<div class="embla__viewport overflow-hidden">
<ul class="embla__container flex items-center touch-pinch-zoom">
{{ range .clients_item}}
{{ if .show }}
{{"<!-- Set flex basis to determine the number of slides/logos that will appear. -->" | safeHTML}}
<li class="embla__slide flex-[0_0_50%] md:flex-[0_0_33%] lg:flex-[0_0_20%]">
<figure class="flex justify-center items-center grayscale hover:grayscale-0">
<img class="w-28 h-auto max-h-14 object-contain" loading="lazy" src="{{ .image | absURL }}" alt="{{ .name }}" title="{{ .name }}">
</figure>
</li>
{{ end }}
{{ end }}
</ul>
</div>
<div class="flex justify-between lg:justify-center gap-x-8 items-center mt-4 p-2 sm:p-6">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Displaying on the side of the logos, instead of below them, led to issues where the styles were blocked. I couldn't figure out how to prevent that, so they will appear below the logos for now.

<button type="button" class="embla__prev h-9 w-9 rounded-full bg-[#2F4858] hover:bg-[#2F4858]/80">
<span class="sr-only">Previous</span>
<i class="fa-solid fa-chevron-left mt-1.5 text-white" title="Previous"></i>
</button>
<button type="button" class="embla__next h-9 w-9 rounded-full bg-[#2F4858] hover:bg-[#2F4858]/80">
<span class="sr-only">Next</span>
<i class="fa-solid fa-chevron-right mt-1.5 text-white" title="Next"></i>
</button>
</div>
</div>
</div>
</section>
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/testimonials.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2 class="py-2 font-extrabold text-xl sm:text-2xl lg:text-4xl">{{ .title }}</h2
<p class="my-4 md:text-lg">{{ .description }}</p>
</section>
<section class="my-4 max-w-[350px] sm:max-w-full">
<div class="embla overflow-hidden border">
<div class="embla overflow-hidden border" data-loop="true" data-scroll="1">
<div class="embla__viewport">
<div class="embla__container flex">
{{ range .testimonial }}
Expand Down
Binary file added static/img/clients/bluevoyant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/clients/btcfu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/clients/georgetown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/clients/mersive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/clients/techsierra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/clients/umbc_c4ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/clients/workmation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 14 additions & 10 deletions static/js/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// Initialize Embla carousel
const emblaRoot = document.querySelector('.embla');
const emblaViewport = emblaRoot?.querySelector('.embla__viewport');
const prevBtn = emblaRoot?.querySelector('.embla__prev');
const nextBtn = emblaRoot?.querySelector('.embla__next');
const options = { loop: true };
// Initialize Embla carousel.
const emblaRoot = document.querySelectorAll('.embla');

if (emblaRoot) {
const carousel = EmblaCarousel(emblaViewport, options);
prevBtn.addEventListener('click', carousel.scrollPrev, false);
nextBtn.addEventListener('click', carousel.scrollNext, false);
}
emblaRoot?.forEach((root) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that there are 2 carousels on the same, page, the JavaScript has been updated so that separate options may be set for each one. Although the align option should always be start to ensure the carousel begins with the first slide that we set. Currently, the options for both carousels are the same but adding this flexibility now will make it easier if we want to make changes.

// Set carousel options from the data attributes.
const options = { loop: Boolean(root?.dataset?.loop), slidesToScroll: Number(root?.dataset?.scroll), align: "start" };
const carousel = EmblaCarousel(root?.querySelector('.embla__viewport'), options);

const prevBtn = root?.querySelector('.embla__prev');
const nextBtn = root?.querySelector('.embla__next');

prevBtn?.addEventListener('click', carousel?.scrollPrev, false);
nextBtn?.addEventListener('click', carousel?.scrollNext, false);
});
};
73 changes: 60 additions & 13 deletions static/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,10 @@ video {
visibility: visible;
}

.invisible {
visibility: hidden;
}

.static {
position: static;
}
Expand Down Expand Up @@ -1397,6 +1401,10 @@ video {
margin-top: 0.25rem;
}

.mt-1\.5 {
margin-top: 0.375rem;
}

.mt-10 {
margin-top: 2.5rem;
}
Expand Down Expand Up @@ -1561,6 +1569,10 @@ video {
height: 2rem;
}

.h-9 {
height: 2.25rem;
}

.h-\[100px\] {
height: 100px;
}
Expand All @@ -1585,6 +1597,10 @@ video {
height: 100%;
}

.max-h-14 {
max-height: 3.5rem;
}

.max-h-96 {
max-height: 24rem;
}
Expand Down Expand Up @@ -1630,6 +1646,10 @@ video {
width: 6rem;
}

.w-28 {
width: 7rem;
}

.w-3 {
width: 0.75rem;
}
Expand Down Expand Up @@ -1678,6 +1698,10 @@ video {
width: 20rem;
}

.w-9 {
width: 2.25rem;
}

.w-96 {
width: 24rem;
}
Expand Down Expand Up @@ -1714,10 +1738,6 @@ video {
max-width: 80rem;
}

.max-w-\[180px\] {
max-width: 180px;
}

.max-w-\[350px\] {
max-width: 350px;
}
Expand Down Expand Up @@ -1750,6 +1770,10 @@ video {
flex: 0 0 100%;
}

.flex-\[0_0_50\%\] {
flex: 0 0 50%;
}

.flex-none {
flex: none;
}
Expand Down Expand Up @@ -1784,6 +1808,11 @@ video {
cursor: pointer;
}

.touch-pinch-zoom {
--tw-pinch-zoom: pinch-zoom;
touch-action: var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom);
}

.resize {
resize: both;
}
Expand Down Expand Up @@ -2262,6 +2291,11 @@ video {
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}

.object-contain {
-o-object-fit: contain;
object-fit: contain;
}

.object-cover {
-o-object-fit: cover;
object-fit: cover;
Expand Down Expand Up @@ -2709,11 +2743,6 @@ video {
color: rgb(75 85 99 / var(--tw-text-opacity));
}

.text-red-800 {
--tw-text-opacity: 1;
color: rgb(153 27 27 / var(--tw-text-opacity));
}

.text-red-900 {
--tw-text-opacity: 1;
color: rgb(127 29 29 / var(--tw-text-opacity));
Expand Down Expand Up @@ -2778,6 +2807,11 @@ video {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.grayscale {
--tw-grayscale: grayscale(100%);
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.filter {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
Expand Down Expand Up @@ -3300,6 +3334,11 @@ em {
color: rgb(148 163 184 / var(--tw-text-opacity));
}

.hover\:grayscale-0:hover {
--tw-grayscale: grayscale(0);
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.focus\:outline-none:focus {
outline: 2px solid transparent;
outline-offset: 2px;
Expand Down Expand Up @@ -3672,6 +3711,10 @@ em {
max-width: 24rem;
}

.md\:flex-\[0_0_33\%\] {
flex: 0 0 33%;
}

.md\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
Expand All @@ -3692,10 +3735,6 @@ em {
flex-direction: row;
}

.md\:flex-wrap {
flex-wrap: wrap;
}

.md\:items-center {
align-items: center;
}
Expand Down Expand Up @@ -3975,6 +4014,10 @@ em {
width: 100%;
}

.lg\:flex-\[0_0_20\%\] {
flex: 0 0 20%;
}

.lg\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
Expand All @@ -3995,6 +4038,10 @@ em {
align-items: center;
}

.lg\:justify-center {
justify-content: center;
}

.lg\:justify-between {
justify-content: space-between;
}
Expand Down