Skip to content

Commit

Permalink
Merge pull request #61 from acend/changes
Browse files Browse the repository at this point in the history
load more > team members
  • Loading branch information
fintinc authored Oct 8, 2024
2 parents bee7b61 + c3a87c0 commit 4496121
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
31 changes: 31 additions & 0 deletions site/assets/js/views/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,37 @@ export default function() {
el.classList.toggle('active');
});
});


// Hide more than 6 team members
const teamMembers = Array.from(team);
const showMore = document.querySelector('.btn-showmore');
let visibleCount = window.innerWidth > 768 ? 6 : 3;
const counter = visibleCount


teamMembers.slice(visibleCount).forEach(member => {
member.classList.add('d-none');
});


showMore.addEventListener('click', function() {
const hiddenMembers = teamMembers.slice(visibleCount, visibleCount + counter);
hiddenMembers.forEach(member => {
member.classList.remove('d-none');
});

window.scrollTo({
top: hiddenMembers[0].offsetTop - 100,
behavior: 'smooth'
});

visibleCount += counter;

if (visibleCount >= teamMembers.length) {
showMore.classList.add('d-none');
}
});
}


Expand Down
6 changes: 6 additions & 0 deletions site/assets/scss/common/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,9 @@ a {
padding-right: var(--bs-gutter-x);
padding-left: var(--bs-gutter-x);
}

@include media-breakpoint-down(md) {
.overflow-x-hidden {
overflow-x: scroll !important;
}
}
3 changes: 3 additions & 0 deletions site/hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"btn-outline-light",
"btn-outline-primary",
"btn-primary",
"btn-showmore",
"btn-sm",
"button",
"c-caption",
Expand Down Expand Up @@ -299,6 +300,8 @@
"md",
"me-1",
"me-10",
"me-14",
"me-16",
"me-2",
"me-20",
"me-3",
Expand Down
4 changes: 2 additions & 2 deletions site/layouts/partials/team-member-compact.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div data-scroll class="col person">
<div class="inner position-relative">
<div class="col person">
<div data-scroll class="inner position-relative">

{{ if .image }}
{{- partial "img" (dict "page" . "src" .image "width" 392 "process" "fill 784x1056" "alt" "{{ .title }}") }}
Expand Down
12 changes: 7 additions & 5 deletions site/layouts/ueber-uns/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<div class="row flex-nowrap">

{{ range .items}}
<div class="col-8 col-md-6">
<div data-scroll_ class="timeline-item me-20 me-lg-48">
<div class="col-10 col-md-6">
<div data-scroll_ class="timeline-item me-14 me-lg-48">
<h2>{{ .title }}</h2>
<p>{{ .subtitle }}</p>
{{ with .img }}
Expand Down Expand Up @@ -60,12 +60,14 @@ <h3 data-scroll class="h4">{{ .title }}</h3>
<h2 id="team" data-scroll class="mb-5">{{ .title | markdownify }}</h2>
</div>

<div class="team-list row row-cols-1 row-cols-md-2 row-cols-lg-3 gy-8 mb-16 mb-lg-32">

<div class="team-list row row-cols-1 row-cols-md-2 row-cols-lg-3 gy-8 mb-4">
{{ range .team_member }}
{{ partial "team-member-compact" . }}
{{ end }}

</div>

<div data-scroll class="d-flex mb-16 mb-lg-32">
<button class="btn btn-sm btn-outline-primary btn-showmore mx-auto">Mehr anzeigen</button>
</div>

{{ end }}
Expand Down

0 comments on commit 4496121

Please sign in to comment.