-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Masonry grid styling and add carousel dots
- Loading branch information
Lindsey Zylstra
committed
Nov 15, 2024
1 parent
1b92f46
commit c3dfc1f
Showing
4 changed files
with
55 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script setup lang="ts"> | ||
import { useCarousel } from './useCarousel'; | ||
const { scrollTo, selectedIndex, scrollSnaps } = useCarousel(); | ||
</script> | ||
|
||
<template> | ||
<div class="carousel__dots"> | ||
<button | ||
v-for="(snap, index) in scrollSnaps" | ||
:key="index" | ||
class="carousel__dot" | ||
:class="{ 'carousel__dot--active': index === selectedIndex }" | ||
aria-label="'Go to slide ' + (index + 1)" | ||
@click="scrollTo(index)" | ||
></button> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.carousel__dots { | ||
display: flex; | ||
gap: 8px; | ||
} | ||
.carousel__dot { | ||
width: 10px; | ||
height: 10px; | ||
background-color: #f1f3f7; | ||
border: none; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
.carousel__dot--active { | ||
background-color: #42566e; | ||
} | ||
</style> |
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