diff --git a/index.html b/index.html index 26d14dc..b543b90 100644 --- a/index.html +++ b/index.html @@ -1,126 +1,127 @@ - - - - - - - - - - - 锤子便签 - - - -
- - - + + + + + + + + + + + 锤子便签 + + + +
+ + + diff --git a/src/App.vue b/src/App.vue index d7f932d..b507c52 100644 --- a/src/App.vue +++ b/src/App.vue @@ -114,6 +114,12 @@ onUnmounted(() => { position: relative; overflow: hidden; background-color: #f5f5f5; // 设置默认背景色,防止闪烁 + touch-action: pan-y; + -webkit-touch-callout: none; + -webkit-user-select: none; + -ms-touch-action: none; + -ms-user-select: none; + user-select: none; } // 网络状态指示器 @@ -128,20 +134,20 @@ onUnmounted(() => { pointer-events: none; } -.offline-indicator { - background-color: #ff6b6b; - color: white; - padding: 8px 16px; - border-radius: 0 0 4px 4px; - font-size: 14px; - display: flex; - align-items: center; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - pointer-events: auto; -} - -.offline-icon { - margin-right: 8px; +.offline-indicator { + background-color: #ff6b6b; + color: white; + padding: 0.5rem 1rem; + border-radius: 0 0 0.25rem 0.25rem; + font-size: 0.875rem; + display: flex; + align-items: center; + box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2); + pointer-events: auto; +} + +.offline-icon { + margin-right: 0.5rem; } .offline-text { diff --git a/src/common/base.css b/src/common/base.css index 2354854..e5bdd08 100644 --- a/src/common/base.css +++ b/src/common/base.css @@ -1,544 +1,556 @@ -/************************************************************ -** 请将全局样式拷贝到项目的全局 CSS 文件或者当前页面的顶部 ** -** 否则页面将无法正常显示 ** -************************************************************/ - -html { - font-size: 16px; - user-select: none; - -webkit-user-drag: none; - -webkit-tap-highlight-color: transparent; - touch-action: none; -} - -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -img { - user-select: none; - -webkit-tap-highlight-color: transparent; - outline-color: transparent; - lighting-color: transparent; -} -::selection { - background-color: #d3b9a7; /* 选中时的背景颜色 */ - color: #ffffff; /* 选中时的文字颜色 */ -} -img::selection { - background-color: transparent; /* 选中时的背景颜色 */ - color: #ffffff; /* 选中时的文字颜色 */ -} -button { - border: none; -} - -#app { - width: 100vw; - height: 100vh; -} - -.code-fun-flex-row { - display: flex; - flex-direction: row; -} - -.code-fun-flex-col { - display: flex; - flex-direction: column; -} - -.code-fun-justify-start { - justify-content: flex-start; -} - -.code-fun-justify-end { - justify-content: flex-end; -} - -.code-fun-justify-center { - justify-content: center; -} - -.code-fun-justify-between { - justify-content: space-between; -} - -.code-fun-justify-around { - justify-content: space-around; -} - -.code-fun-justify-evenly { - justify-content: space-evenly; -} - -.code-fun-items-start { - align-items: flex-start; -} - -.code-fun-items-end { - align-items: flex-end; -} - -.code-fun-items-center { - align-items: center; -} - -.code-fun-items-baseline { - align-items: baseline; -} - -.code-fun-items-stretch { - align-items: stretch; -} - -.code-fun-self-start { - align-self: flex-start; -} - -.code-fun-self-end { - align-self: flex-end; -} - -.code-fun-self-center { - align-self: center; -} - -.code-fun-self-baseline { - align-self: baseline; -} - -.code-fun-self-stretch { - align-self: stretch; -} - -.code-fun-flex-1 { - flex: 1 1 0%; -} - -.code-fun-flex-auto { - flex: 1 1 auto; -} - -.code-fun-grow { - flex-grow: 1; -} - -.code-fun-grow-0 { - flex-grow: 0; -} - -.code-fun-shrink { - flex-shrink: 1; -} - -.code-fun-shrink-0 { - flex-shrink: 0; -} - -.code-fun-relative { - position: relative; -} - -.code-fun-ml-2 { - margin-left: 0.13rem; -} - -.code-fun-mt-2 { - margin-top: 0.13rem; -} - -.code-fun-ml-4 { - margin-left: 0.25rem; -} - -.code-fun-mt-4 { - margin-top: 0.25rem; -} - -.code-fun-ml-6 { - margin-left: 0.38rem; -} - -.code-fun-mt-6 { - margin-top: 0.38rem; -} - -.code-fun-ml-8 { - margin-left: 0.5rem; -} - -.code-fun-mt-8 { - margin-top: 0.5rem; -} - -.code-fun-ml-10 { - margin-left: 0.63rem; -} - -.code-fun-mt-10 { - margin-top: 0.63rem; -} - -.code-fun-ml-12 { - margin-left: 0.75rem; -} - -.code-fun-mt-12 { - margin-top: 0.75rem; -} - -.code-fun-ml-14 { - margin-left: 0.88rem; -} - -.code-fun-mt-14 { - margin-top: 0.88rem; -} - -.code-fun-ml-16 { - margin-left: 1rem; -} - -.code-fun-mt-16 { - margin-top: 1rem; -} - -.code-fun-ml-18 { - margin-left: 1.13rem; -} - -.code-fun-mt-18 { - margin-top: 1.13rem; -} - -.code-fun-ml-20 { - margin-left: 1.25rem; -} - -.code-fun-mt-20 { - margin-top: 1.25rem; -} - -.code-fun-ml-22 { - margin-left: 1.38rem; -} - -.code-fun-mt-22 { - margin-top: 1.38rem; -} - -.code-fun-ml-24 { - margin-left: 1.5rem; -} - -.code-fun-mt-24 { - margin-top: 1.5rem; -} - -.code-fun-ml-26 { - margin-left: 1.63rem; -} - -.code-fun-mt-26 { - margin-top: 1.63rem; -} - -.code-fun-ml-28 { - margin-left: 1.75rem; -} - -.code-fun-mt-28 { - margin-top: 1.75rem; -} - -.code-fun-ml-30 { - margin-left: 1.88rem; -} - -.code-fun-mt-30 { - margin-top: 1.88rem; -} - -.code-fun-ml-32 { - margin-left: 2rem; -} - -.code-fun-mt-32 { - margin-top: 2rem; -} - -.code-fun-ml-34 { - margin-left: 2.13rem; -} - -.code-fun-mt-34 { - margin-top: 2.13rem; -} - -.code-fun-ml-36 { - margin-left: 2.25rem; -} - -.code-fun-mt-36 { - margin-top: 2.25rem; -} - -.code-fun-ml-38 { - margin-left: 2.38rem; -} - -.code-fun-mt-38 { - margin-top: 2.38rem; -} - -.code-fun-ml-40 { - margin-left: 2.5rem; -} - -.code-fun-mt-40 { - margin-top: 2.5rem; -} - -.code-fun-ml-42 { - margin-left: 2.63rem; -} - -.code-fun-mt-42 { - margin-top: 2.63rem; -} - -.code-fun-ml-44 { - margin-left: 2.75rem; -} - -.code-fun-mt-44 { - margin-top: 2.75rem; -} - -.code-fun-ml-46 { - margin-left: 2.88rem; -} - -.code-fun-mt-46 { - margin-top: 2.88rem; -} - -.code-fun-ml-48 { - margin-left: 3rem; -} - -.code-fun-mt-48 { - margin-top: 3rem; -} - -.code-fun-ml-50 { - margin-left: 3.13rem; -} - -.code-fun-mt-50 { - margin-top: 3.13rem; -} - -.code-fun-ml-52 { - margin-left: 3.25rem; -} - -.code-fun-mt-52 { - margin-top: 3.25rem; -} - -.code-fun-ml-54 { - margin-left: 3.38rem; -} - -.code-fun-mt-54 { - margin-top: 3.38rem; -} - -.code-fun-ml-56 { - margin-left: 3.5rem; -} - -.code-fun-mt-56 { - margin-top: 3.5rem; -} - -.code-fun-ml-58 { - margin-left: 3.63rem; -} - -.code-fun-mt-58 { - margin-top: 3.63rem; -} - -.code-fun-ml-60 { - margin-left: 3.75rem; -} - -.code-fun-mt-60 { - margin-top: 3.75rem; -} - -.code-fun-ml-62 { - margin-left: 3.88rem; -} - -.code-fun-mt-62 { - margin-top: 3.88rem; -} - -.code-fun-ml-64 { - margin-left: 4rem; -} - -.code-fun-mt-64 { - margin-top: 4rem; -} - -.code-fun-ml-66 { - margin-left: 4.13rem; -} - -.code-fun-mt-66 { - margin-top: 4.13rem; -} - -.code-fun-ml-68 { - margin-left: 4.25rem; -} - -.code-fun-mt-68 { - margin-top: 4.25rem; -} - -.code-fun-ml-70 { - margin-left: 4.38rem; -} - -.code-fun-mt-70 { - margin-top: 4.38rem; -} - -.code-fun-ml-72 { - margin-left: 4.5rem; -} - -.code-fun-mt-72 { - margin-top: 4.5rem; -} - -.code-fun-ml-74 { - margin-left: 4.63rem; -} - -.code-fun-mt-74 { - margin-top: 4.63rem; -} - -.code-fun-ml-76 { - margin-left: 4.75rem; -} - -.code-fun-mt-76 { - margin-top: 4.75rem; -} - -.code-fun-ml-78 { - margin-left: 4.88rem; -} - -.code-fun-mt-78 { - margin-top: 4.88rem; -} - -.code-fun-ml-80 { - margin-left: 5rem; -} - -.code-fun-mt-80 { - margin-top: 5rem; -} - -.code-fun-ml-82 { - margin-left: 5.13rem; -} - -.code-fun-mt-82 { - margin-top: 5.13rem; -} - -.code-fun-ml-84 { - margin-left: 5.25rem; -} - -.code-fun-mt-84 { - margin-top: 5.25rem; -} - -.code-fun-ml-86 { - margin-left: 5.38rem; -} - -.code-fun-mt-86 { - margin-top: 5.38rem; -} - -.code-fun-ml-88 { - margin-left: 5.5rem; -} - -.code-fun-mt-88 { - margin-top: 5.5rem; -} - -.code-fun-ml-90 { - margin-left: 5.63rem; -} - -.code-fun-mt-90 { - margin-top: 5.63rem; -} - -.code-fun-ml-92 { - margin-left: 5.75rem; -} - -.code-fun-mt-92 { - margin-top: 5.75rem; -} - -.code-fun-ml-94 { - margin-left: 5.88rem; -} - -.code-fun-mt-94 { - margin-top: 5.88rem; -} - -.code-fun-ml-96 { - margin-left: 6rem; -} - -.code-fun-mt-96 { - margin-top: 6rem; -} - -.code-fun-ml-98 { - margin-left: 6.13rem; -} - -.code-fun-mt-98 { - margin-top: 6.13rem; -} - -.code-fun-ml-100 { - margin-left: 6.25rem; -} - -.code-fun-mt-100 { - margin-top: 6.25rem; -} +/************************************************************ +** 请将全局样式拷贝到项目的全局 CSS 文件或者当前页面的顶部 ** +** 否则页面将无法正常显示 ** +************************************************************/ + +html { + font-size: 18px; + user-select: none; + -webkit-user-drag: none; + -webkit-tap-highlight-color: transparent; + touch-action: pan-y; + overflow: hidden; +} + +/* 禁止页面整体滚动 */ +body { + overflow: hidden; + position: fixed; + width: 100%; + height: 100%; + -webkit-overflow-scrolling: touch; + overscroll-behavior: none; + touch-action: pan-y; +} + +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +img { + user-select: none; + -webkit-tap-highlight-color: transparent; + outline-color: transparent; + lighting-color: transparent; +} +::selection { + background-color: #d3b9a7; /* 选中时的背景颜色 */ + color: #ffffff; /* 选中时的文字颜色 */ +} +img::selection { + background-color: transparent; /* 选中时的背景颜色 */ + color: #ffffff; /* 选中时的文字颜色 */ +} +button { + border: none; +} + +#app { + width: 100vw; + height: 100vh; +} + +.code-fun-flex-row { + display: flex; + flex-direction: row; +} + +.code-fun-flex-col { + display: flex; + flex-direction: column; +} + +.code-fun-justify-start { + justify-content: flex-start; +} + +.code-fun-justify-end { + justify-content: flex-end; +} + +.code-fun-justify-center { + justify-content: center; +} + +.code-fun-justify-between { + justify-content: space-between; +} + +.code-fun-justify-around { + justify-content: space-around; +} + +.code-fun-justify-evenly { + justify-content: space-evenly; +} + +.code-fun-items-start { + align-items: flex-start; +} + +.code-fun-items-end { + align-items: flex-end; +} + +.code-fun-items-center { + align-items: center; +} + +.code-fun-items-baseline { + align-items: baseline; +} + +.code-fun-items-stretch { + align-items: stretch; +} + +.code-fun-self-start { + align-self: flex-start; +} + +.code-fun-self-end { + align-self: flex-end; +} + +.code-fun-self-center { + align-self: center; +} + +.code-fun-self-baseline { + align-self: baseline; +} + +.code-fun-self-stretch { + align-self: stretch; +} + +.code-fun-flex-1 { + flex: 1 1 0%; +} + +.code-fun-flex-auto { + flex: 1 1 auto; +} + +.code-fun-grow { + flex-grow: 1; +} + +.code-fun-grow-0 { + flex-grow: 0; +} + +.code-fun-shrink { + flex-shrink: 1; +} + +.code-fun-shrink-0 { + flex-shrink: 0; +} + +.code-fun-relative { + position: relative; +} + +.code-fun-ml-2 { + margin-left: 0.13rem; +} + +.code-fun-mt-2 { + margin-top: 0.13rem; +} + +.code-fun-ml-4 { + margin-left: 0.25rem; +} + +.code-fun-mt-4 { + margin-top: 0.25rem; +} + +.code-fun-ml-6 { + margin-left: 0.38rem; +} + +.code-fun-mt-6 { + margin-top: 0.38rem; +} + +.code-fun-ml-8 { + margin-left: 0.5rem; +} + +.code-fun-mt-8 { + margin-top: 0.5rem; +} + +.code-fun-ml-10 { + margin-left: 0.63rem; +} + +.code-fun-mt-10 { + margin-top: 0.63rem; +} + +.code-fun-ml-12 { + margin-left: 0.75rem; +} + +.code-fun-mt-12 { + margin-top: 0.75rem; +} + +.code-fun-ml-14 { + margin-left: 0.88rem; +} + +.code-fun-mt-14 { + margin-top: 0.88rem; +} + +.code-fun-ml-16 { + margin-left: 1rem; +} + +.code-fun-mt-16 { + margin-top: 1rem; +} + +.code-fun-ml-18 { + margin-left: 1.13rem; +} + +.code-fun-mt-18 { + margin-top: 1.13rem; +} + +.code-fun-ml-20 { + margin-left: 1.25rem; +} + +.code-fun-mt-20 { + margin-top: 1.25rem; +} + +.code-fun-ml-22 { + margin-left: 1.38rem; +} + +.code-fun-mt-22 { + margin-top: 1.38rem; +} + +.code-fun-ml-24 { + margin-left: 1.5rem; +} + +.code-fun-mt-24 { + margin-top: 1.5rem; +} + +.code-fun-ml-26 { + margin-left: 1.63rem; +} + +.code-fun-mt-26 { + margin-top: 1.63rem; +} + +.code-fun-ml-28 { + margin-left: 1.75rem; +} + +.code-fun-mt-28 { + margin-top: 1.75rem; +} + +.code-fun-ml-30 { + margin-left: 1.88rem; +} + +.code-fun-mt-30 { + margin-top: 1.88rem; +} + +.code-fun-ml-32 { + margin-left: 2rem; +} + +.code-fun-mt-32 { + margin-top: 2rem; +} + +.code-fun-ml-34 { + margin-left: 2.13rem; +} + +.code-fun-mt-34 { + margin-top: 2.13rem; +} + +.code-fun-ml-36 { + margin-left: 2.25rem; +} + +.code-fun-mt-36 { + margin-top: 2.25rem; +} + +.code-fun-ml-38 { + margin-left: 2.38rem; +} + +.code-fun-mt-38 { + margin-top: 2.38rem; +} + +.code-fun-ml-40 { + margin-left: 2.5rem; +} + +.code-fun-mt-40 { + margin-top: 2.5rem; +} + +.code-fun-ml-42 { + margin-left: 2.63rem; +} + +.code-fun-mt-42 { + margin-top: 2.63rem; +} + +.code-fun-ml-44 { + margin-left: 2.75rem; +} + +.code-fun-mt-44 { + margin-top: 2.75rem; +} + +.code-fun-ml-46 { + margin-left: 2.88rem; +} + +.code-fun-mt-46 { + margin-top: 2.88rem; +} + +.code-fun-ml-48 { + margin-left: 3rem; +} + +.code-fun-mt-48 { + margin-top: 3rem; +} + +.code-fun-ml-50 { + margin-left: 3.13rem; +} + +.code-fun-mt-50 { + margin-top: 3.13rem; +} + +.code-fun-ml-52 { + margin-left: 3.25rem; +} + +.code-fun-mt-52 { + margin-top: 3.25rem; +} + +.code-fun-ml-54 { + margin-left: 3.38rem; +} + +.code-fun-mt-54 { + margin-top: 3.38rem; +} + +.code-fun-ml-56 { + margin-left: 3.5rem; +} + +.code-fun-mt-56 { + margin-top: 3.5rem; +} + +.code-fun-ml-58 { + margin-left: 3.63rem; +} + +.code-fun-mt-58 { + margin-top: 3.63rem; +} + +.code-fun-ml-60 { + margin-left: 3.75rem; +} + +.code-fun-mt-60 { + margin-top: 3.75rem; +} + +.code-fun-ml-62 { + margin-left: 3.88rem; +} + +.code-fun-mt-62 { + margin-top: 3.88rem; +} + +.code-fun-ml-64 { + margin-left: 4rem; +} + +.code-fun-mt-64 { + margin-top: 4rem; +} + +.code-fun-ml-66 { + margin-left: 4.13rem; +} + +.code-fun-mt-66 { + margin-top: 4.13rem; +} + +.code-fun-ml-68 { + margin-left: 4.25rem; +} + +.code-fun-mt-68 { + margin-top: 4.25rem; +} + +.code-fun-ml-70 { + margin-left: 4.38rem; +} + +.code-fun-mt-70 { + margin-top: 4.38rem; +} + +.code-fun-ml-72 { + margin-left: 4.5rem; +} + +.code-fun-mt-72 { + margin-top: 4.5rem; +} + +.code-fun-ml-74 { + margin-left: 4.63rem; +} + +.code-fun-mt-74 { + margin-top: 4.63rem; +} + +.code-fun-ml-76 { + margin-left: 4.75rem; +} + +.code-fun-mt-76 { + margin-top: 4.75rem; +} + +.code-fun-ml-78 { + margin-left: 4.88rem; +} + +.code-fun-mt-78 { + margin-top: 4.88rem; +} + +.code-fun-ml-80 { + margin-left: 5rem; +} + +.code-fun-mt-80 { + margin-top: 5rem; +} + +.code-fun-ml-82 { + margin-left: 5.13rem; +} + +.code-fun-mt-82 { + margin-top: 5.13rem; +} + +.code-fun-ml-84 { + margin-left: 5.25rem; +} + +.code-fun-mt-84 { + margin-top: 5.25rem; +} + +.code-fun-ml-86 { + margin-left: 5.38rem; +} + +.code-fun-mt-86 { + margin-top: 5.38rem; +} + +.code-fun-ml-88 { + margin-left: 5.5rem; +} + +.code-fun-mt-88 { + margin-top: 5.5rem; +} + +.code-fun-ml-90 { + margin-left: 5.63rem; +} + +.code-fun-mt-90 { + margin-top: 5.63rem; +} + +.code-fun-ml-92 { + margin-left: 5.75rem; +} + +.code-fun-mt-92 { + margin-top: 5.75rem; +} + +.code-fun-ml-94 { + margin-left: 5.88rem; +} + +.code-fun-mt-94 { + margin-top: 5.88rem; +} + +.code-fun-ml-96 { + margin-left: 6rem; +} + +.code-fun-mt-96 { + margin-top: 6rem; +} + +.code-fun-ml-98 { + margin-left: 6.13rem; +} + +.code-fun-mt-98 { + margin-top: 6.13rem; +} + +.code-fun-ml-100 { + margin-left: 6.25rem; +} + +.code-fun-mt-100 { + margin-top: 6.25rem; +} diff --git a/src/components/Header.vue b/src/components/Header.vue index 2015756..0f9b632 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -1,257 +1,257 @@ - - - - - + + + + + diff --git a/src/components/Modal.vue b/src/components/Modal.vue index 13fcb10..9d89656 100644 --- a/src/components/Modal.vue +++ b/src/components/Modal.vue @@ -246,8 +246,8 @@ defineExpose({ show }) font-size: var(--confirmFontSize, 1rem); max-width: 75vw; min-width: 20em; - box-shadow: 0px 35px 35px -10px rgba(0, 0, 0, 0.33); - border-radius: 10px; + box-shadow: 0rem 2.1875rem 2.1875rem -0.625rem rgba(0, 0, 0, 0.33); + border-radius: 0.625rem; position: relative; white-space: break-spaces; word-break: break-all; @@ -288,13 +288,13 @@ defineExpose({ show }) width: 100%; padding: 0.8em; font-size: 1em; - border: 1px solid var(--confirmBtnBorder, #f1f1f1); - border-radius: 4px; + border: 0.0625rem solid var(--confirmBtnBorder, #f1f1f1); + border-radius: 0.25rem; box-sizing: border-box; outline: none; background: var(--confirmTheme, #fff); color: var(--confirmColor, #636363); - box-shadow: 0px 0px 4px inset rgba(0, 0, 0, 0.12); + box-shadow: 0rem 0rem 0.25rem inset rgba(0, 0, 0, 0.12); } .pd-input::placeholder { diff --git a/src/components/NoteItem.vue b/src/components/NoteItem.vue index fec9c05..b023bc1 100644 --- a/src/components/NoteItem.vue +++ b/src/components/NoteItem.vue @@ -1,411 +1,378 @@ - - - - - + + + diff --git a/src/components/RichTextEditor.vue b/src/components/RichTextEditor.vue index 8a01f15..77e68f3 100644 --- a/src/components/RichTextEditor.vue +++ b/src/components/RichTextEditor.vue @@ -6,27 +6,22 @@ -
- - + + + + + diff --git a/src/components/SettingGroup.vue b/src/components/SettingGroup.vue index b4d5616..37dc8e4 100644 --- a/src/components/SettingGroup.vue +++ b/src/components/SettingGroup.vue @@ -1,75 +1,75 @@ - - - - - + + + + + diff --git a/src/pages/FolderPage.vue b/src/pages/FolderPage.vue index 4351efd..be7d0c3 100644 --- a/src/pages/FolderPage.vue +++ b/src/pages/FolderPage.vue @@ -1,152 +1,153 @@ - - - - - + + + + + diff --git a/src/pages/NoteEditorPage.vue b/src/pages/NoteEditorPage.vue index 9dac095..279768f 100644 --- a/src/pages/NoteEditorPage.vue +++ b/src/pages/NoteEditorPage.vue @@ -438,37 +438,47 @@ onBeforeUnmount(async () => { flex-direction: column; height: 100vh; background-color: var(--background); + overflow: hidden; section { width: 100%; height: 100%; + overflow-y: auto; + -webkit-overflow-scrolling: touch; } } -.offline-banner { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 10000; - background-color: #ff6b6b; - color: white; - padding: 8px 16px; - text-align: center; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); -} -.offline-content { - display: flex; - align-items: center; - justify-content: center; - font-size: 14px; - font-weight: 500; -} -.offline-icon { - margin-right: 8px; +.offline-banner { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 10000; + background-color: #ff6b6b; + color: white; + padding: 0.5rem 1rem; + text-align: center; + box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2); +} +.offline-content { + display: flex; + align-items: center; + justify-content: center; + font-size: 0.875rem; + font-weight: 500; +} +.offline-icon { + margin-right: 0.5rem; } .note-container { flex: 1; - overflow-y: scroll; + overflow-y: auto; background-color: var(--background); + touch-action: pan-y; + -webkit-overflow-scrolling: touch; +} + +.rich-text-editor { + min-height: 100%; + touch-action: pan-y; } .rich-text-editor { min-height: 100%; diff --git a/src/pages/NoteListPage.vue b/src/pages/NoteListPage.vue index 9108354..35217a1 100644 --- a/src/pages/NoteListPage.vue +++ b/src/pages/NoteListPage.vue @@ -67,440 +67,442 @@ - - - - + + + + diff --git a/src/pages/SettingsPage.vue b/src/pages/SettingsPage.vue index 96d9677..62acae6 100644 --- a/src/pages/SettingsPage.vue +++ b/src/pages/SettingsPage.vue @@ -115,16 +115,8 @@ const settings = computed(() => store.settings) background: url('/assets/icons/drawable-xxhdpi/note_setting_bg.png'); width: 100%; height: 100vh; - overflow-y: scroll; - - .item-text-primary { - font-size: 1rem; - color: #8e8e8e; - } - - .item-text-tertiary { - font-size: 0.9375rem; - color: #b4b4b4; - } + overflow-y: auto; + touch-action: pan-y; + -webkit-overflow-scrolling: touch; } diff --git a/src/utils/sizeUtils.js b/src/utils/sizeUtils.js new file mode 100644 index 0000000..9734c4f --- /dev/null +++ b/src/utils/sizeUtils.js @@ -0,0 +1,29 @@ +/** + * 获取根元素的字体大小(以像素为单位) + * @returns {number} 根元素的字体大小(像素) + */ +export function getRootFontSize() { + return parseFloat(getComputedStyle(document.documentElement).fontSize); +} + +/** + * 将像素值转换为rem值 + * @param {number} px - 像素值 + * @param {number} [rootFontSize] - 根字体大小,如果不提供则自动获取 + * @returns {number} rem值 + */ +export function pxToRem(px, rootFontSize = null) { + const fontSize = rootFontSize || getRootFontSize(); + return px / fontSize; +} + +/** + * 将像素值转换为rem字符串(带rem单位) + * @param {number} px - 像素值 + * @param {number} [rootFontSize] - 根字体大小,如果不提供则自动获取 + * @returns {string} rem字符串 + */ +export function pxToRemStr(px, rootFontSize = null) { + const remValue = pxToRem(px, rootFontSize); + return `${remValue}rem`; +} \ No newline at end of file