Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: adjust font sizes for mobile

thecodrrb4c777d1e5b6
diff --git a/apps/web/src/components/editor/titlebox.js b/apps/web/src/components/editor/titlebox.js
index fe3898e04..b7059f587 100644
--- a/apps/web/src/components/editor/titlebox.js
+++ b/apps/web/src/components/editor/titlebox.js
@@ -6,14 +6,14 @@ var changeTimeout;
function TitleBox(props) {
const { title, setTitle, changeInterval, shouldFocus } = props;
- const [height, setHeight] = useState(60);
+ const [height, setHeight] = useState(0);
const inputRef = useRef();
const resize = useCallback(() => {
const textarea = document.querySelector(".editorTitle");
const dummy = document.querySelector(".dummyEditorTitle");
dummy.innerHTML = textarea.value;
- setHeight(dummy.scrollHeight > 60 ? dummy.scrollHeight : 60);
+ setHeight(dummy.scrollHeight);
}, []);
useEffect(() => {
@@ -21,7 +21,7 @@ function TitleBox(props) {
const myObserver = new ResizeObserver((entries) => {
window.requestAnimationFrame(() => {
const newHeight = entries[0].contentRect.height;
- setHeight(newHeight > 60 ? newHeight : 60);
+ setHeight(newHeight);
});
});
myObserver.observe(document.querySelector(".dummyEditorTitle"));
@@ -47,7 +47,8 @@ function TitleBox(props) {
as="pre"
className="dummyEditorTitle"
variant="heading"
- fontSize="2.625em"
+ minHeight={[30, 30, 60]}
+ fontSize={["1.625em", "1.625em", "2.625em"]}
sx={{ whiteSpace: "pre-wrap", position: "absolute", zIndex: -1 }}
></Text>
<Input
@@ -58,12 +59,13 @@ function TitleBox(props) {
placeholder="Untitled"
as="textarea"
width="100%"
+ minHeight={[30, 30, 60]}
p={0}
sx={{
height,
overflowY: "hidden",
fontFamily: "heading",
- fontSize: "2.625em",
+ fontSize: ["1.625em", "1.625em", "2.625em"],
fontWeight: "heading",
border: "none",
resize: "none",
@@ -82,27 +84,6 @@ function TitleBox(props) {
}}
/>
</Flex>
- // <TextArea
- // ref={inputRef}
- // autoFocus={shouldFocus}
- // className="editorTitle"
- // data-test-id="editor-title"
- // placeholder="Untitled"
- // maxLength={240}
- // style={{
- // backgroundColor: "transparent",
- // fontFamily: theme.fonts["heading"],
- // fontSize: "2.625em",
- // fontWeight: theme.fontWeights["heading"],
- // resize: "none",
- // paddingRight: theme.space[2],
- // paddingLeft: theme.space[2],
- // border: "none",
- // color: theme.colors["text"],
- // width: "100%",
- // }}
-
- // />
);
}
diff --git a/apps/web/src/views/splash.js b/apps/web/src/views/splash.js
index bc8b0b4e1..016af2cc0 100644
--- a/apps/web/src/views/splash.js
+++ b/apps/web/src/views/splash.js
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
-import { Flex, Text } from "rebass";
+import { Box, Flex, Text } from "rebass";
import ThemeProvider from "../components/theme-provider";
import Animated from "../components/animated";
import { db } from "../common";
@@ -47,33 +47,39 @@ function Splash(props) {
alignItems="center"
overflow="hidden"
>
- <Flex
- sx={{
- fontSize: 62,
- color: "primary",
- fontWeight: "bold",
- fontFamily: "body",
- }}
- >
- <Animated.Text backgroundColor="bgPrimary" overflow={"hidden"} x={0}>
- Notes
- </Animated.Text>
- <Animated.Flex backgroundColor="" overflow={"hidden"}>
+ <Box>
+ <Flex
+ sx={{
+ fontSize: [42, 42, 52],
+ color: "primary",
+ fontWeight: "bold",
+ fontFamily: "body",
+ }}
+ >
<Animated.Text
- initial={{ x: -100 * 1.2 }}
- animate={{ x: 0 }}
- transition={{ ease: "easeOut", duration: 1 }}
+ backgroundColor="bgPrimary"
+ overflow={"hidden"}
+ x={0}
>
- nook
+ Notes
</Animated.Text>
- </Animated.Flex>
- </Flex>
- <ProgressBar
- progress={100}
- width={300}
- onLoadingEnd={() => setAnimationEnded(true)}
- />
- <Text color="text" mt={2}>
+ <Animated.Flex backgroundColor="" overflow={"hidden"}>
+ <Animated.Text
+ initial={{ x: -100 * 1.2 }}
+ animate={{ x: 0 }}
+ transition={{ ease: "easeOut", duration: 1 }}
+ >
+ nook
+ </Animated.Text>
+ </Animated.Flex>
+ </Flex>
+ <ProgressBar
+ progress={100}
+ width={"100%"}
+ onLoadingEnd={() => setAnimationEnded(true)}
+ />
+ </Box>
+ <Text color="text" fontSize="title" mt={2}>
{loadingLines[getRandom(0, loadingLines.length)]}
</Text>
</Flex>