Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Save the mute state/preferences for the user just like theme. #33

Open
rajneesh069 opened this issue Jan 1, 2024 · 0 comments
Assignees

Comments

@rajneesh069
Copy link
Contributor

rajneesh069 commented Jan 1, 2024

In the previous code, there was no feature to save the previous mute preferences for the user, i.e., each time the website loaded, the sounds were un-muted, but after this feature, the mute state/preference will be saved in the local storage, and will be retrieved same as the initial theme properties(props).
Code changes: -
Had to create a new initialMuteState.js file. After that, I created another isMuted variable to get the initial state of the mute preferences inside the getInitialProps.js file, to know if the website is muted already or not. And then created initialMuteState.js file to add respective class to the volume button in each case and added this script using the defer attribute inside the head tag. I had to remove the initial volume-fa-up class from the tag of the volume icon.

Screenshots:-
image

image

image

image

Video to demonstrate the changes :-

Notes.app.-.Google.Chrome.2024-01-01.12-30-42.mp4

I'd like to work on the issue if it gets approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant