Skip to content

Commit c439f46

Browse files
committed
[FEAT]: 데스크톱 환경만 허용하도록 변경
1 parent ffcfefa commit c439f46

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed

client/src/App.css

+98
Original file line numberDiff line numberDiff line change
@@ -985,3 +985,101 @@ ul {
985985
color: rgba(255, 255, 255, 0.8) !important;
986986
opacity: 1;
987987
}
988+
989+
.screen-size-warning {
990+
position: fixed;
991+
top: 0;
992+
left: 0;
993+
width: 100%;
994+
height: 100%;
995+
background-color: var(--popup-background-color);
996+
display: flex;
997+
align-items: center;
998+
justify-content: center;
999+
z-index: 1000;
1000+
}
1001+
1002+
.warning-content {
1003+
background-color: var(--popup-inner-contents-background-color);
1004+
padding: 2rem;
1005+
border-radius: 11px;
1006+
text-align: center;
1007+
box-shadow: rgba(0, 0, 0, 0.2) 0px 20px 30px;
1008+
max-width: 400px;
1009+
}
1010+
1011+
.warning-content h2 {
1012+
color: var(--popup-inner-contents-font-color);
1013+
font-size: 1.5rem;
1014+
margin-bottom: 1rem;
1015+
}
1016+
1017+
.warning-content p {
1018+
color: var(--popup-inner-contents-font-color);
1019+
font-size: 1rem;
1020+
line-height: 1.5;
1021+
}
1022+
1023+
/* 기존 CSS 파일에 추가 */
1024+
.screen-size-warning {
1025+
position: fixed;
1026+
top: 0;
1027+
left: 0;
1028+
width: 100%;
1029+
height: 100%;
1030+
background-color: var(--popup-background-color);
1031+
display: flex;
1032+
align-items: center;
1033+
justify-content: center;
1034+
z-index: 1000;
1035+
backdrop-filter: blur(5px); /* 배경 블러 효과 */
1036+
}
1037+
1038+
.warning-content {
1039+
background-color: var(--popup-inner-contents-background-color);
1040+
padding: 2rem;
1041+
border-radius: 16px;
1042+
text-align: center;
1043+
box-shadow: rgba(0, 0, 0, 0.2) 0px 20px 30px;
1044+
max-width: 400px;
1045+
animation: fade-in 0.5s ease-in-out; /* 페이드 인 애니메이션 */
1046+
}
1047+
1048+
.warning-icon {
1049+
font-size: 3rem;
1050+
margin-bottom: 1rem;
1051+
color: var(--cursor-color);
1052+
}
1053+
1054+
.warning-content h2 {
1055+
color: var(--popup-inner-contents-font-color);
1056+
font-size: 1.5rem;
1057+
margin-bottom: 1rem;
1058+
font-weight: 600;
1059+
}
1060+
1061+
.english-text {
1062+
color: var(--popup-inner-contents-font-color);
1063+
font-size: 1rem;
1064+
line-height: 1.5;
1065+
margin-bottom: 0.5rem;
1066+
}
1067+
1068+
.korean-text {
1069+
color: var(--popup-inner-contents-font-color);
1070+
font-size: 0.875rem;
1071+
line-height: 1.5;
1072+
opacity: 0.8; /* 한국어 텍스트를 더 연하게 표시 */
1073+
}
1074+
1075+
/* 페이드 인 애니메이션 */
1076+
@keyframes fade-in {
1077+
0% {
1078+
opacity: 0;
1079+
transform: translateY(-20px);
1080+
}
1081+
100% {
1082+
opacity: 1;
1083+
transform: translateY(0);
1084+
}
1085+
}

client/src/App.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "./App.css";
22
import Editor from "./components/Editor";
3+
import ScreenSizeWarning from "./components/ScreenSizeWarning";
34
import Sidebar from "./components/Sidebar";
45
import SidebarButton from "./components/SidebarButton";
56
import Topbar from "./components/Topbar";
@@ -80,6 +81,8 @@ function App() {
8081

8182
return (
8283
<Provider store={store}>
84+
<ScreenSizeWarning />
85+
8386
<div
8487
style={{
8588
margin: "0 10px 0 0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import React, { useState, useEffect } from "react";
2+
3+
const ScreenSizeWarning = () => {
4+
const [isVisible, setIsVisible] = useState(false);
5+
6+
// 모바일 또는 태블릿 기기인지 확인하는 함수
7+
const isMobileDevice = () => {
8+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
9+
navigator.userAgent
10+
);
11+
};
12+
13+
useEffect(() => {
14+
const handleResize = () => {
15+
if (
16+
window.innerWidth < 768 ||
17+
window.innerHeight < 470 ||
18+
isMobileDevice()
19+
) {
20+
setIsVisible(true);
21+
} else {
22+
setIsVisible(false);
23+
}
24+
};
25+
26+
window.addEventListener("resize", handleResize);
27+
handleResize(); // 초기 로드 시에도 체크
28+
29+
return () => window.removeEventListener("resize", handleResize);
30+
}, []);
31+
32+
if (!isVisible) return null;
33+
34+
return (
35+
<div className="screen-size-warning">
36+
<div className="warning-content">
37+
<div className="warning-icon">🖥️</div>
38+
<h2>Please Check Your Screen Size</h2>
39+
<p className="english-text">
40+
This application is optimized for desktop environments. Please use a
41+
computer or enlarge your screen.
42+
</p>
43+
<p className="korean-text">
44+
이 애플리케이션은 데스크톱 환경에 최적화되어 있습니다. 컴퓨터를
45+
사용하거나 화면을 확대해주세요.
46+
</p>
47+
</div>
48+
</div>
49+
);
50+
};
51+
52+
export default ScreenSizeWarning;

0 commit comments

Comments
 (0)