-
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.
* chore: svgr library * feat: update version 1.1.0 * chore: 이미지 복사 * chore: build formats 수정 * chore: add start scripts * chore: yarn cache clean 추가 * chore: exclude playground * chore: npmignore 수정 * feat: gitignore 수정 * feat: index.html 추가
- Loading branch information
Showing
27 changed files
with
716 additions
and
83 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 |
---|---|---|
|
@@ -21,5 +21,4 @@ dist-ssr | |
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
index.html | ||
*.sw? |
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 |
---|---|---|
|
@@ -6,4 +6,7 @@ vite.config.ts | |
yarn.lock | ||
node_modules | ||
.gitignore | ||
*.tgz | ||
*.tgz | ||
playground | ||
.github | ||
.yarn-error.log |
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 |
---|---|---|
|
@@ -21,5 +21,4 @@ dist-ssr | |
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
index.html | ||
*.sw? |
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,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>React iPhone Layout</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
:root { | ||
--ril-control-bg: #313a46; | ||
--ril-control-basic: #b3b9c4; | ||
--ril-control-hover: #bccee4; | ||
--ril-control-focus: #fff; | ||
} | ||
|
||
.ril-control-box { | ||
padding: 16px 12px; | ||
|
||
width: 40px; | ||
|
||
background-color: var(--ril-control-bg); | ||
border-radius: 8px; | ||
} | ||
|
||
.ril-control-box .ril-control-list { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
} | ||
|
||
.ril-control-list .ril-control-item { | ||
width: 40px; | ||
height: 40px; | ||
|
||
border: 1px solid var(--ril-control-basic); | ||
border-radius: 50%; | ||
|
||
cursor: pointer; | ||
} | ||
|
||
.iPhone_focus_mode path, | ||
.iphone-icon:hover path { | ||
fill: var(--ril-control-focus); | ||
} | ||
|
||
.laptop-icon:hover rect { | ||
fill: var(--ril-control-focus); | ||
} | ||
|
||
.plus-icon:hover rect, | ||
.plus-icon:hover line, | ||
.minus-icon:hover rect, | ||
.minus-icon:hover line { | ||
stroke: var(--ril-control-focus); | ||
} | ||
|
||
.ril-control-list, | ||
.ril-control-item { | ||
list-style-type: none; | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
} |
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,77 @@ | ||
import IPhoneIcon from "./assets/iPhone.svg?react"; | ||
import LaptopIcon from "./assets/laptop.svg?react"; | ||
import PlusIcon from "./assets/plus.svg?react"; | ||
import MinusIcon from "./assets/minus.svg?react"; | ||
|
||
import "./ControlBox.css"; | ||
import "./Position.css"; | ||
import { useResize } from "./hooks/useResize"; | ||
|
||
interface ControlBoxProps { | ||
position: "top" | "right" | "bottom" | "left"; | ||
mode: "iPhone" | "laptop"; | ||
iPhoneLayoutRef: React.RefObject<HTMLDivElement>; | ||
iPhoneSizeRef: React.MutableRefObject<number>; | ||
minSize: number; | ||
maxSize: number; | ||
handleChangeMode: (newMode: "iPhone" | "laptop") => void; | ||
} | ||
|
||
export const ControlBox: React.FC<ControlBoxProps> = ({ | ||
position, | ||
mode, | ||
iPhoneLayoutRef, | ||
iPhoneSizeRef, | ||
minSize, | ||
maxSize, | ||
handleChangeMode, | ||
}) => { | ||
const { handleSizeUp, handleSizeDown } = useResize( | ||
iPhoneLayoutRef, | ||
iPhoneSizeRef, | ||
minSize, | ||
maxSize | ||
); | ||
|
||
if (mode === "laptop") { | ||
return ( | ||
<div className="laptop__mode"> | ||
<button | ||
className="iPhone-active-btn" | ||
onClick={() => handleChangeMode("iPhone")} | ||
> | ||
<IPhoneIcon className="iphone-icon" width="64" height="64" /> | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<aside className={`ril-control-box position__${position}`}> | ||
<ul className="ril-control-list"> | ||
<li | ||
className="ril-control-item" | ||
onClick={() => handleChangeMode("iPhone")} | ||
> | ||
<IPhoneIcon | ||
className={`iphone-icon ${ | ||
mode === "iPhone" ? "iPhone_focus_mode" : "" | ||
}`} | ||
/> | ||
</li> | ||
<li | ||
className="ril-control-item" | ||
onClick={() => handleChangeMode("laptop")} | ||
> | ||
<LaptopIcon className="laptop-icon" /> | ||
</li> | ||
<li className="ril-control-item" onClick={handleSizeUp}> | ||
<PlusIcon className="plus-icon" /> | ||
</li> | ||
<li className="ril-control-item" onClick={handleSizeDown}> | ||
<MinusIcon className="minus-icon" /> | ||
</li> | ||
</ul> | ||
</aside> | ||
); | ||
}; |
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,58 @@ | ||
.position__top { | ||
position: absolute; | ||
top: 20px; | ||
left: 50%; | ||
|
||
transform: translate(-50%, -40%) rotate(270deg); | ||
|
||
& svg { | ||
transform: rotate(90deg); | ||
} | ||
} | ||
|
||
.position__bottom { | ||
position: absolute; | ||
bottom: 20px; | ||
left: 50%; | ||
|
||
transform: translate(-50%, 40%) rotate(270deg); | ||
|
||
& svg { | ||
transform: rotate(90deg); | ||
} | ||
} | ||
|
||
.position__left { | ||
position: absolute; | ||
top: 50%; | ||
left: 20px; | ||
|
||
transform: translateY(-50%); | ||
} | ||
|
||
.position__right { | ||
position: absolute; | ||
top: 50%; | ||
right: 20px; | ||
|
||
transform: translateY(-50%); | ||
} | ||
|
||
.laptop__mode { | ||
position: absolute; | ||
left: 8px; | ||
bottom: 8px; | ||
} | ||
|
||
.laptop__mode .iPhone-active-btn { | ||
background: var(--ril-control-bg); | ||
padding: 0; | ||
margin: 0; | ||
|
||
width: 64px; | ||
height: 64px; | ||
border-radius: 50%; | ||
border: 0; | ||
|
||
cursor: pointer; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
export { ControlBox } from "./ControlBox"; |
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.