-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b917c1
commit 69b3e24
Showing
11 changed files
with
165 additions
and
311 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,52 @@ | ||
.content-wrapper { | ||
width: 100%; | ||
display: grid; | ||
grid-template-columns: repeat(12, 1fr); | ||
gap: 10px; | ||
scroll-snap-type: y mandatory; | ||
|
||
@include sp { | ||
grid-template-columns: repeat(6, 1fr); | ||
} | ||
} | ||
|
||
.cards-view { | ||
display: flex; | ||
width: 100%; | ||
overflow: auto; | ||
scroll-snap-type: x mandatory; | ||
-ms-overflow-style: none; | ||
scrollbar-width: none; | ||
.films-view { | ||
display: grid; | ||
grid-template-columns: subgrid; | ||
grid-column: span 12; | ||
gap: 10px; | ||
align-content: center; | ||
align-items: center; | ||
height: 100dvh; | ||
|
||
&::-webkit-scrollbar { | ||
display: none; | ||
@include sp { | ||
grid-column: span 6; | ||
} | ||
|
||
@include sp { | ||
flex-direction: column; | ||
scroll-snap-type: y mandatory; | ||
height: 100vh; | ||
height: 100dvh; | ||
> .rank-title { | ||
grid-column: 3 / 11; | ||
padding: 20px 0; | ||
overflow: hidden; | ||
border: 1px solid #fff2; | ||
border-radius: 20px; | ||
|
||
@include sp { | ||
grid-column: 2 / 6; | ||
} | ||
} | ||
|
||
> .cards { | ||
display: flex; | ||
scroll-snap-type: x mandatory; | ||
grid-column: 3 / 11; | ||
max-width: 100%; | ||
height: min(500px, 70dvh); | ||
overflow-x: scroll; | ||
border-radius: 20px; | ||
|
||
@include sp { | ||
flex-direction: column; | ||
scroll-snap-type: y mandatory; | ||
grid-column: 2 / 6; | ||
} | ||
} | ||
} |
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
8 changes: 4 additions & 4 deletions
8
...ges/portfolio/pageTitle/index.module.scss → ...ts/common/scrollingText/index.module.scss
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,43 @@ | ||
'use client'; | ||
|
||
import { useRef } from 'react'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
type Props = { | ||
/** | ||
* Text to scroll | ||
*/ | ||
text: string; | ||
/** | ||
* Font size in rem | ||
* @default 12 | ||
*/ | ||
size?: number; | ||
/** | ||
* HTML tag to render | ||
* @default 'h2' | ||
*/ | ||
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; | ||
}; | ||
|
||
export const ScrollingText = ({ text, size = 12, as = 'h2' }: Props) => { | ||
const As = as; | ||
const titleRef = useRef<HTMLHeadingElement>(null); | ||
|
||
const handleScroll = () => | ||
titleRef.current?.appendChild(titleRef.current?.firstElementChild as Node); | ||
|
||
titleRef.current?.addEventListener('animationiteration', handleScroll); | ||
|
||
return ( | ||
<As | ||
className={styles['scrolling-text']} | ||
ref={titleRef} | ||
style={{ fontSize: `${size}rem` }} | ||
> | ||
<span>{text}</span> | ||
<span>{text}</span> | ||
</As> | ||
); | ||
}; |
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
Oops, something went wrong.