Skip to content

Commit 22c18dc

Browse files
authored
Fix: DetailContent 컴포넌트 가로스크롤 이슈 수정 (#32)
* Add: medium size blur background image asset * Style: DetailContent 백그라운드 이미지 리사이징
1 parent 6fa9469 commit 22c18dc

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed
12.4 KB
Loading

src/components/DetailContent/DetailContent.module.scss

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
&__mainImage {
5858
position: relative;
5959
height: 37rem;
60-
left: 5rem;
60+
left: 5vw;
6161
z-index: 1;
6262

6363
@include tablet {
64-
left: 10rem;
64+
left: 15vw;
6565
height: 40rem;
6666
top: 5rem;
6767
}
@@ -75,7 +75,7 @@
7575

7676
&__textWrapper {
7777
@include tablet {
78-
margin-left: 55%;
78+
margin-left: 50vw;
7979
}
8080

8181
@include mobile {
@@ -128,19 +128,20 @@
128128
&__backgroundImage {
129129
position: absolute;
130130
margin-bottom: 10rem;
131-
left: 40vw;
131+
right: 30vw;
132132
width: 25rem;
133133
z-index: 0;
134+
overflow-x: hidden;
134135

135136
@include tablet {
136137
margin-bottom: 5rem;
137138
right: 0;
138139
}
139140

140141
@include mobile {
142+
width: 15rem;
141143
margin-bottom: 5rem;
142-
left: 45vw;
143-
width: 20rem;
144+
right: 0;
144145
}
145146
}
146147
}

src/components/DetailContent/DetailContent.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { RESPONSIVE_VARIABLE } from '@/constants/objects/responsive';
77
import mockupLgSrc from '../../../public/static/images/mockup-content-list-pc.webp';
88
import mockupMdSrc from '../../../public/static/images/mockup-content-list-md.webp';
99
import mockupSmSrc from '../../../public/static/images/mockup-content-list-sm.webp';
10-
import backImageSrc from '../../../public/static/images/blur-bg-image.webp';
10+
import blurBackImageLgSrc from '../../../public/static/images/blur-bg-image.webp';
11+
import blurBackImageSmSrc from '../../../public/static/images/blur-bg-image-sm.webp';
1112

1213
import Styles from './DetailContent.module.scss';
1314

@@ -21,6 +22,11 @@ export default function DetailContent(): JSX.Element {
2122
? mockupSmSrc
2223
: mockupMdSrc;
2324

25+
const blurBackImageSrc =
26+
width <= RESPONSIVE_VARIABLE['tablet']
27+
? blurBackImageSmSrc
28+
: blurBackImageLgSrc;
29+
2430
const TitleText = (): JSX.Element => {
2531
return width >= RESPONSIVE_VARIABLE['pc'] ? (
2632
<span>
@@ -67,7 +73,7 @@ export default function DetailContent(): JSX.Element {
6773
</div>
6874
<div className={Styles.DetailContent__backgroundImage}>
6975
<Image
70-
src={backImageSrc}
76+
src={blurBackImageSrc}
7177
alt="background blur image"
7278
style={{ width: '105%', height: 'auto' }}
7379
/>

src/styles/globals.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ html,
8080
body {
8181
max-width: 100vw;
8282
overflow-x: hidden;
83+
touch-action: none;
8384
}
8485

8586
body {

0 commit comments

Comments
 (0)