-
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.
✨ feat(sound): update setting volume
- Loading branch information
1 parent
cc5e011
commit cb90e36
Showing
16 changed files
with
253 additions
and
32 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
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,36 @@ | ||
import styled from "styled-components"; | ||
|
||
export const OverlayWrapper = styled.div` | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
export const ContentWrapper = styled.div` | ||
width: 50%; | ||
height: 50%; | ||
background-color: #ffffff; | ||
border-radius: 12px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
export const Content = styled.div` | ||
width: 80%; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
`; | ||
|
||
export const StyledText = styled.div` | ||
font-size: 24px; | ||
`; | ||
|
||
export const StyledInputRange = styled.input` | ||
width: 55%; | ||
`; |
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,40 @@ | ||
import { | ||
Content, | ||
ContentWrapper, | ||
OverlayWrapper, | ||
StyledInputRange, | ||
StyledText | ||
} from "./settingOverlay.style"; | ||
|
||
export const SettingOverlay = ({ | ||
onClose, | ||
volume, | ||
setVolume | ||
}: { | ||
onClose: () => void; | ||
volume: number; | ||
setVolume: (value: number) => void; | ||
}) => { | ||
return ( | ||
<OverlayWrapper onClick={onClose}> | ||
<ContentWrapper | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
}} | ||
> | ||
<Content> | ||
<StyledText>사운드</StyledText> | ||
<StyledInputRange | ||
type="range" | ||
min={0} | ||
max={100} | ||
defaultValue={volume * 100} | ||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||
setVolume(Number(e.target.value) / 100); | ||
}} | ||
/> | ||
</Content> | ||
</ContentWrapper> | ||
</OverlayWrapper> | ||
); | ||
}; |
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,5 +1,21 @@ | ||
import { PlayFunction } from "use-sound/dist/types"; | ||
|
||
import { GachaHomeTemplate } from "components/templates"; | ||
|
||
export const GachaHome = () => { | ||
return <GachaHomeTemplate />; | ||
export const GachaHome = ({ | ||
clickButton, | ||
volume, | ||
setVolume | ||
}: { | ||
clickButton?: PlayFunction; | ||
volume: number; | ||
setVolume: (value: number) => void; | ||
}) => { | ||
return ( | ||
<GachaHomeTemplate | ||
clickButton={clickButton} | ||
volume={volume} | ||
setVolume={setVolume} | ||
/> | ||
); | ||
}; |
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,5 +1,11 @@ | ||
import { PlayFunction } from "use-sound/dist/types"; | ||
|
||
import { HomeTemplate } from "components/templates"; | ||
|
||
export const HomePage = (): JSX.Element => { | ||
return <HomeTemplate />; | ||
export const HomePage = ({ | ||
clickButton | ||
}: { | ||
clickButton?: PlayFunction; | ||
}): JSX.Element => { | ||
return <HomeTemplate clickButton={clickButton} />; | ||
}; |
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,10 +1,21 @@ | ||
import { PlayFunction } from "use-sound/dist/types"; | ||
|
||
import { MyGomemListTemplate } from "components/templates"; | ||
|
||
export const MyGomemPage = () => { | ||
export const MyGomemPage = ({ | ||
clickButton | ||
}: { | ||
clickButton?: PlayFunction; | ||
}) => { | ||
// 객체 배열이므로 두번 parse 해 주어야 배열안에 객체들이 string 에서 객체로 잘 변환되어 나옴 | ||
const userHaveGomemList = JSON.parse( | ||
`[${JSON.parse(window.localStorage.getItem("userHaveGomemList")) || ``}]` | ||
); | ||
|
||
return <MyGomemListTemplate userHaveGomemList={userHaveGomemList} />; | ||
return ( | ||
<MyGomemListTemplate | ||
userHaveGomemList={userHaveGomemList} | ||
clickButton={clickButton} | ||
/> | ||
); | ||
}; |
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.