diff --git a/webclient/src/App.js b/webclient/src/App.js index be19b46..296a5ab 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -22,9 +22,7 @@ function App() { const [waitingWorker, setWaitingWorker] = useState(null); const [settingsOpen, setSettingsOpen] = useState(false); const defaultBodyFontSize = 1.0; - const defaultStoryFontSize = 1.2; const [bodyFontSize, setBodyFontSize] = useState(Number(localStorage.getItem('bodyFontSize')) || defaultBodyFontSize); - const [storyFontSize, setStoryFontSize] = useState(Number(localStorage.getItem('storyFontSize')) || defaultStoryFontSize); const updateCache = useCallback((key, value) => { cache.current[key] = value; @@ -52,14 +50,8 @@ function App() { const changeBodyFontSize = (amount) => { const newSize = bodyFontSize + amount; - setBodyFontSize(parseFloat(newSize.toFixed(1))); - localStorage.setItem('bodyFontSize', newSize.toFixed(1)); - }; - - const changeStoryFontSize = (amount) => { - const newSize = storyFontSize + amount; - setStoryFontSize(parseFloat(newSize.toFixed(1))); - localStorage.setItem('storyFontSize', newSize.toFixed(1)); + setBodyFontSize(parseFloat(newSize.toFixed(2))); + localStorage.setItem('bodyFontSize', newSize.toFixed(2)); }; const resetBodyFontSize = () => { @@ -67,13 +59,7 @@ function App() { localStorage.removeItem('bodyFontSize'); }; - const resetStoryFontSize = () => { - setStoryFontSize(defaultStoryFontSize); - localStorage.removeItem('storyFontSize'); - }; - const bodyFontSettingsChanged = bodyFontSize !== defaultBodyFontSize; - const storyFontSettingsChanged = storyFontSize !== defaultStoryFontSize; useEffect(() => { const onSWUpdate = e => { @@ -126,16 +112,6 @@ function App() { document.documentElement.style.fontSize = `${bodyFontSize}rem`; }, [bodyFontSize]); - useEffect(() => { - const styleId = 'story-font-size-style'; - let style = document.getElementById(styleId); - if (!style) { - style = document.createElement('style'); - style.id = styleId; - document.head.appendChild(style); - } - style.innerHTML = `.story-text { font-size: ${storyFontSize}em !important; }`; - }, [storyFontSize]); const fullScreenAvailable = document.fullscreenEnabled || document.mozFullscreenEnabled || @@ -156,19 +132,12 @@ function App() {