Skip to content

Commit

Permalink
Fix testimonials (#2633)
Browse files Browse the repository at this point in the history
* Fix testimonials

* Update and use parallelowow Houdini script
  • Loading branch information
scriptex authored Nov 6, 2023
1 parent b63b467 commit 8a27c69
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/houdini/parallelowow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ registerPaint(
`--${paintNameParallelOwOw}-tile-width`,
`--${paintNameParallelOwOw}-base-colors`,
`--${paintNameParallelOwOw}-probability`,
`--${paintNameParallelOwOw}-stroke-color`,
`--${paintNameParallelOwOw}-stroke-weight`
];
}
Expand All @@ -21,6 +22,7 @@ registerPaint(
): void {
const tileWidth = parseInt(props.get(`--${paintNameParallelOwOw}-tile-width`)!, 10);
const probability = parseFloat(props.get(`--${paintNameParallelOwOw}-probability`)!);
const strokeColor = props.get(`--${paintNameParallelOwOw}-stroke-color`);
const strokeWeight = parseFloat(props.get(`--${paintNameParallelOwOw}-stroke-weight`)!);

const baseColors: string[] = props
Expand Down Expand Up @@ -81,6 +83,7 @@ registerPaint(
ctx.fill();

if (strokeWeight > 0) {
ctx.strokeStyle = strokeColor ?? 'black';
ctx.stroke();
}

Expand Down
1 change: 0 additions & 1 deletion src/pages/testimonials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const List: FC<ListProps> = ({ data, swiper }) => (
autoplay={{ delay: 10000 }}
keyboard
className="c-testimonials__list"
autoHeight
>
{data.map(item => {
const date = new Date(item.date);
Expand Down
36 changes: 36 additions & 0 deletions src/styles/testimonials.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
.c-testimonial {
--parallelowow-tile-width: 64px;
--parallelowow-probability: 0.9;
--parallelowow-base-colors: var(--color-primary);
--parallelowow-stroke-color: var(--color-secondary);
--parallelowow-stroke-weight: 2;

height: 100%;
position: relative;
padding: 1rem;
border: 1px solid;
background-color: var(--color-secondary);
border-radius: 2.5rem;

&::before {
content: '';
width: 100%;
height: 100%;
display: block;
opacity: 0.05;
position: absolute;
top: 0;
left: 0;
z-index: 1;
background-image: paint(parallelowow);
border-radius: 2.5rem;
}
}

.c-testimonial__head {
color: currentcolor;
text-decoration: none;
display: block;
position: relative;
z-index: 2;
padding-left: 6rem;

& img {
Expand Down Expand Up @@ -40,6 +63,8 @@
}

.c-testimonial__body {
position: relative;
z-index: 2;
padding: 1rem 0;
border-top: 1px solid var(--color-action);
margin-top: 1rem;
Expand All @@ -65,6 +90,11 @@
border-radius: 50%;
}
}

& .swiper-slide {
height: auto;
box-sizing: border-box;
}
}

.c-testimonials__list {
Expand Down Expand Up @@ -122,4 +152,10 @@
justify-content: flex-start;
}
}

.c-section--testimonials {
& .c-section__animation {
margin: -1rem 0 1.5rem;
}
}
}

1 comment on commit 8a27c69

@vercel
Copy link

@vercel vercel bot commented on 8a27c69 Nov 6, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.