-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add single-row version of carousel to homepage with hoverable links * fix logos to scroll from middle * make the initial middle carousel animation not repeat
- Loading branch information
Showing
6 changed files
with
284 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,95 @@ | ||
<!-- | ||
Can be 1 row scrolling left, or 3 rows scrolling left/right offset | ||
3 rows of customer logos carousel - data looks like | ||
logos: | ||
- name: name1 | ||
link: (optional) | ||
- name: name2 | ||
link: (optional) | ||
- name: name3 | ||
link: (optional) | ||
... | ||
--> | ||
|
||
<!-- divide the list into thirds to make the 3 rows --> | ||
{{ $length := .logos | len }} | ||
{{ $row_size := div $length 3 }} | ||
{{ $first_row := first $row_size .logos }} | ||
{{ $second_row := first $row_size (after $row_size .logos) }} | ||
{{ $third_row := after (mul 2 $row_size) .logos }} | ||
<div class="hidden md:block stacked-carousel-container relative mx-auto"> | ||
<div class="carousel-left-primary"> | ||
{{ range $first_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary carousel-left-secondary"> | ||
{{ range $first_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-right-primary top-20"> | ||
{{ range $second_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-right-primary carousel-right-secondary top-20"> | ||
{{ range $second_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary top-40"> | ||
{{ range $third_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
optional flags: | ||
single_row: makes the carousel just one row, with gray hover behavior and (optional) links | ||
--> | ||
{{ if .single_row }} | ||
<div class="hidden md:block stacked-carousel-container stacked-carousel-container-single relative mx-auto"> | ||
<div class="carousel-left-primary"> | ||
{{ range .logos }} | ||
{{ if .link }} | ||
<a href="{{ .link }}"> | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name "hoverable" true) }}</div> | ||
</a> | ||
{{ else }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name "hoverable" true) }}</div> | ||
{{ end }} | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary carousel-left-secondary"> | ||
{{ range .logos }} | ||
{{ if .link }} | ||
<a href="{{ .link }}"> | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name "hoverable" true) }}</div> | ||
</a> | ||
{{ else }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name "hoverable" true) }}</div> | ||
{{ end }} | ||
{{ end }} | ||
</div> | ||
</div> | ||
<div class="carousel-left-primary carousel-left-secondary top-40"> | ||
{{ range $third_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
{{ else }} | ||
<!-- divide the list into thirds to make the 3 rows --> | ||
{{ $length := .logos | len }} | ||
{{ $row_size := div $length 3 }} | ||
{{ $first_row := first $row_size .logos }} | ||
{{ $second_row := first $row_size (after $row_size .logos) }} | ||
{{ $third_row := after (mul 2 $row_size) .logos }} | ||
<div class="hidden md:block stacked-carousel-container relative mx-auto"> | ||
<div class="carousel-left-initial"> | ||
{{ range $first_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary"> | ||
{{ range $first_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary carousel-left-secondary"> | ||
{{ range $first_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-right-initial top-20"> | ||
{{ range $second_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-right-primary top-20"> | ||
{{ range $second_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-right-primary carousel-right-secondary top-20"> | ||
{{ range $second_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-initial top-40"> | ||
{{ range $third_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary top-40"> | ||
{{ range $third_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
<div class="carousel-left-primary carousel-left-secondary top-40"> | ||
{{ range $third_row }} | ||
<div class="w-24 h-12 m-4">{{ partial "customer-logo.html" (dict "logo" .name) }}</div> | ||
{{ end }} | ||
</div> | ||
</div> | ||
</div> | ||
{{ end }} |
Oops, something went wrong.