generated from zama-ai/fhevm-react-template
-
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() add options to enable/disable music
- Loading branch information
1 parent
9bd1ea2
commit c240e88
Showing
7 changed files
with
122 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.Options__account { | ||
text-overflow: ellipsis; | ||
max-width: 80%; | ||
overflow: hidden; | ||
} | ||
|
||
.Options__menu { | ||
margin: 15px 0; | ||
} | ||
|
||
.Options__link { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.Options__link a, | ||
.Options__link span { | ||
font-family: Bungee; | ||
font-size: 32px; | ||
color: #fff; | ||
text-shadow: -5px 5px 0 #000; | ||
text-decoration: none; | ||
cursor: pointer; | ||
} | ||
|
||
.Options__link a:hover, | ||
.Options__link span:hover { | ||
color: var(--primary-color); | ||
} | ||
|
||
.Options__link--disabled a, | ||
.Options__link--disabled span { | ||
color: #444 !important; | ||
pointer-events: none; | ||
} | ||
|
||
.Options__link--small { | ||
margin-top: 30px; | ||
} | ||
|
||
.Options__link--small a { | ||
color: var(--fifth-color); | ||
font-size: 1.4em; | ||
} |
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,37 @@ | ||
import classNames from 'classnames'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
import { demuteMusic, isMuted, muteMusic } from '../../../../utils/music'; | ||
import { Back, Title } from '../../../common-ui'; | ||
|
||
import './Options.css'; | ||
|
||
export const Options = () => { | ||
const [muted, setMuted] = useState(isMuted()); | ||
|
||
useEffect(() => { | ||
setMuted(isMuted()); | ||
}, []); | ||
|
||
const onMute = () => { | ||
if (!muted) { | ||
console.log('muted'); | ||
muteMusic(); | ||
} else { | ||
demuteMusic(); | ||
} | ||
setMuted(!muted); | ||
}; | ||
|
||
return ( | ||
<div className="Options"> | ||
<Back /> | ||
<Title>Options</Title> | ||
<div className="Options__menu"> | ||
<div className={classNames('Options__link Options__link')}> | ||
<span onClick={onMute}>Music: {muted ? 'OFF' : 'ON'}</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
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 * from './Options'; |
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,3 +1,4 @@ | ||
export * from './components/Home'; | ||
export * from './components/Options'; | ||
export * from './components/Rules'; | ||
export * from './components/About'; |
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