Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
#11 all swiper-slide same height
Browse files Browse the repository at this point in the history
  • Loading branch information
chraebsli authored Feb 17, 2024
1 parent cb1c649 commit b9220ce
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 36 deletions.
26 changes: 4 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"react-router-dom": "^6.4.0",
"react-scripts": "^5.0.1",
"sass": "^1.54.9",
"swiper": "^8.4.2",
"swiper": "^11.0.6",
"typescript": "^4.9.5"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/components/projects/ProjectsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default function ProjectsList() {
return (
<Swiper>
{projects?.map(project => (
<SwiperSlide key={project.id}>
<Grid item key={project.title} xs={12} sm={9} md={6}>
<Card sx={{p: "1rem"}}>
<SwiperSlide key={project.id} style={{padding: ".1rem", maxWidth: "28rem", height: "auto"}}>
<Grid item key={project.title} xs={12} sm={9} md={6} height="100%">
<Card sx={{p: "1rem", height: "100%", display: "flex", flexDirection: "column"}}>
<Image
src={`/media/project/${project.id}.webp`}
alt={`${t("project.imageAlt")} ${project.title}`}
Expand Down
8 changes: 4 additions & 4 deletions src/components/services/ServicesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export default function ServicesList() {
return (
<Swiper>
{services.map(service => (
<SwiperSlide key={service.id}>
<Grid item key={service.title} xs={12} sm={9} md={6}>
<Card sx={{p: "1rem", backgroundColor: "background.default"}}>
<SwiperSlide key={service.id} style={{padding: ".1rem", maxWidth: "28rem", height: "auto"}}>
<Grid item key={service.title} xs={12} sm={9} md={6} height="100%">
<Card sx={{p: "1rem", height: "100%", display: "flex", flexDirection: "column"}}>
<Image
src={`/media/service/${service.id}.webp`}
alt={`${t("service.imageAlt")} ${service.title}`}
Expand All @@ -41,7 +41,7 @@ export default function ServicesList() {
))}
</ul>
</CardContent>
<CardActions>
<CardActions sx={{marginTop: "auto"}}>
<Button fullWidth variant={"outlined"} href={service.href}>
{t("service.learnMore")}
</Button>
Expand Down
3 changes: 1 addition & 2 deletions src/components/swiper/Swiper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Autoplay, Mousewheel, Navigation, Pagination } from "swiper";
import { Autoplay, Mousewheel, Navigation, Pagination } from "swiper/modules";
import { Swiper as ReactSwiper } from "swiper/react";

type Props = {
Expand All @@ -16,7 +16,6 @@ export default function Swiper({children}: Props) {
mousewheel={true}
autoplay={{delay: 10000, disableOnInteraction: false}}
modules={[Mousewheel, Autoplay, Pagination, Navigation]}
className="services-carousel"
>
{children}
</ReactSwiper>
Expand Down
4 changes: 0 additions & 4 deletions src/styles/main.sass
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ main
padding-left: .5rem
padding-right: .5rem

/* ********************************************* swiper ********************************************* */
.swiper-slide
max-width: 25rem

/* ********************************************* footer ********************************************* */
footer
a
Expand Down

0 comments on commit b9220ce

Please sign in to comment.