-
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.
* rename: iPhone.svg to iphone.svg * feat: ์คํ ์์ * feat: update v1.2.0 * rename: iPhone.svg to iphone.svg * feat: ์ ๋ฐ์ดํธ ๊ธฐ๋ฅ ๋ฌธ์ ๋ฐ์
- Loading branch information
Showing
18 changed files
with
132 additions
and
52 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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "react-iphone-layout", | ||
"private": false, | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"type": "module", | ||
"description": "React iPhone layout in web browser", | ||
"author": "bangdori <[email protected]>", | ||
|
File renamed without changes
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
This file was deleted.
Oops, something went wrong.
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { useResize } from "./useResize"; | ||
export { useRotate } from "./useRotate"; |
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,35 @@ | ||
import { useEffect, useRef } from "react"; | ||
|
||
const IPHONE_PORTRAIT_MODE = 0; // ์ธ๋ก ๋ชจ๋ | ||
const IPHONE_LANDSCAPE_MODE = -90; // ๊ฐ๋ก ๋ชจ๋ | ||
|
||
export const useRotate = () => { | ||
const iPhoneModeRef = useRef(IPHONE_PORTRAIT_MODE); | ||
|
||
useEffect(() => { | ||
document.documentElement.style.setProperty( | ||
"--iphone-mode", | ||
`${IPHONE_PORTRAIT_MODE}deg` | ||
); | ||
}, []); | ||
|
||
const handleRotate = () => { | ||
if (iPhoneModeRef.current === IPHONE_PORTRAIT_MODE) { | ||
// ๊ฐ๋ก ๋ชจ๋๋ก ๋ณ๊ฒฝ | ||
iPhoneModeRef.current = IPHONE_LANDSCAPE_MODE; | ||
document.documentElement.style.setProperty( | ||
"--iphone-mode", | ||
`${IPHONE_LANDSCAPE_MODE}deg` | ||
); | ||
} else { | ||
// ์ธ๋ก ๋ชจ๋๋ก ๋ณ๊ฒฝ | ||
iPhoneModeRef.current = IPHONE_PORTRAIT_MODE; | ||
document.documentElement.style.setProperty( | ||
"--iphone-mode", | ||
`${IPHONE_PORTRAIT_MODE}deg` | ||
); | ||
} | ||
}; | ||
|
||
return { handleRotate }; | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
.../ui/iPhone-layout/hooks/useLaoyutMode.tsx โ .../ui/iPhone-layout/hooks/useLayoutMode.tsx
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