You've already forked SmartisanNote.Remake
Merge pull request 'future' (#16) from future into main
Reviewed-on: yuantao/SmartisanNote.Remake#16
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no" />
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
<!-- 透明 -->
|
<!-- 透明 -->
|
||||||
@@ -93,12 +93,13 @@
|
|||||||
--confirmBg: rgba(0, 0, 0, 0.15);
|
--confirmBg: rgba(0, 0, 0, 0.15);
|
||||||
--confirmBtnColor: #000000cc;
|
--confirmBtnColor: #000000cc;
|
||||||
}
|
}
|
||||||
|
html {
|
||||||
|
background-color: var(--note-title);
|
||||||
|
}
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
background-color: white;
|
|
||||||
background: url('/assets/icons/drawable-xxhdpi/note_setting_bg.png');
|
background: url('/assets/icons/drawable-xxhdpi/note_setting_bg.png');
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
/* 适配iPhone X及更新机型的刘海屏 */
|
/* 适配iPhone X及更新机型的刘海屏 */
|
||||||
|
|||||||
16
src/App.vue
16
src/App.vue
@@ -114,6 +114,12 @@ onUnmounted(() => {
|
|||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #f5f5f5; // 设置默认背景色,防止闪烁
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 网络状态指示器
|
// 网络状态指示器
|
||||||
@@ -131,17 +137,17 @@ onUnmounted(() => {
|
|||||||
.offline-indicator {
|
.offline-indicator {
|
||||||
|
|
||||||
background-color: #ff6b6b;
|
background-color: #ff6b6b;
|
||||||
padding: 8px 16px;
|
|
||||||
border-radius: 0 0 4px 4px;
|
color: white;
|
||||||
font-size: 14px;
|
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
|
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
border-radius: 0 0 0.25rem 0.25rem;
|
||||||
|
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-right: 8px;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
|
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
|
||||||
|
|||||||
@@ -4,11 +4,23 @@
|
|||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
html {
|
html {
|
||||||
font-size: 16px;
|
font-size: 18px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-user-drag: none;
|
-webkit-user-drag: none;
|
||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
touch-action: none;
|
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 {
|
body {
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ const handleTitlePress = () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
position: relative;
|
position: relative;
|
||||||
box-shadow: 0 0 30px 5px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 0 1.875rem 0.3125rem rgba(0, 0, 0, 0.2);
|
||||||
.inner {
|
.inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -246,8 +246,8 @@ defineExpose({ show })
|
|||||||
font-size: var(--confirmFontSize, 1rem);
|
font-size: var(--confirmFontSize, 1rem);
|
||||||
max-width: 75vw;
|
max-width: 75vw;
|
||||||
min-width: 20em;
|
min-width: 20em;
|
||||||
box-shadow: 0px 35px 35px -10px rgba(0, 0, 0, 0.33);
|
box-shadow: 0rem 2.1875rem 2.1875rem -0.625rem rgba(0, 0, 0, 0.33);
|
||||||
border-radius: 10px;
|
|
||||||
border-radius: 0.625rem;
|
border-radius: 0.625rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
white-space: break-spaces;
|
white-space: break-spaces;
|
||||||
@@ -288,13 +288,13 @@ defineExpose({ show })
|
|||||||
.pd-input {
|
.pd-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.8em;
|
padding: 0.8em;
|
||||||
border: 1px solid var(--confirmBtnBorder, #f1f1f1);
|
font-size: 1em;
|
||||||
border-radius: 4px;
|
border: 0.0625rem solid var(--confirmBtnBorder, #f1f1f1);
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: var(--confirmTheme, #fff);
|
background: var(--confirmTheme, #fff);
|
||||||
box-shadow: 0px 0px 4px inset rgba(0, 0, 0, 0.12);
|
color: var(--confirmColor, #636363);
|
||||||
box-shadow: 0rem 0rem 0.25rem inset rgba(0, 0, 0, 0.12);
|
box-shadow: 0rem 0rem 0.25rem inset rgba(0, 0, 0, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,10 @@
|
|||||||
<img class="image_27 pos_18" :src="isSliding ? '/assets/icons/drawable-xxhdpi/note_item_clip_up.png' : '/assets/icons/drawable-xxhdpi/note_item_clip_normal.png'" />
|
<img class="image_27 pos_18" :src="isSliding ? '/assets/icons/drawable-xxhdpi/note_item_clip_up.png' : '/assets/icons/drawable-xxhdpi/note_item_clip_normal.png'" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
import { getRootFontSize } from '@/utils/sizeUtils'
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
content: {
|
content: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -71,7 +69,6 @@ const props = defineProps({
|
|||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// 滑动相关状态
|
// 滑动相关状态
|
||||||
const slideOffset = ref(0)
|
const slideOffset = ref(0)
|
||||||
const startX = ref(0)
|
const startX = ref(0)
|
||||||
@@ -79,13 +76,11 @@ const startY = ref(0) // 记录起始Y坐标
|
|||||||
const isSliding = ref(false)
|
const isSliding = ref(false)
|
||||||
const isSlided = ref(false) // 是否已经滑动到阈值
|
const isSlided = ref(false) // 是否已经滑动到阈值
|
||||||
const isScrolling = ref(false) // 是否正在滚动
|
const isScrolling = ref(false) // 是否正在滚动
|
||||||
|
|
||||||
const formattedDate = computed(() => {
|
const formattedDate = computed(() => {
|
||||||
// 直接返回已经格式化的日期字符串
|
// 直接返回已经格式化的日期字符串
|
||||||
// 日期格式化已在父组件中完成
|
// 日期格式化已在父组件中完成
|
||||||
return props.date
|
return props.date
|
||||||
})
|
})
|
||||||
|
|
||||||
// 处理显示内容,过滤HTML标签并只显示第一行
|
// 处理显示内容,过滤HTML标签并只显示第一行
|
||||||
// 用于在便签列表中显示便签的预览内容
|
// 用于在便签列表中显示便签的预览内容
|
||||||
const displayContent = computed(() => {
|
const displayContent = computed(() => {
|
||||||
@@ -93,14 +88,11 @@ const displayContent = computed(() => {
|
|||||||
let text = props.content.replace(/<[^>]*>/g, '')
|
let text = props.content.replace(/<[^>]*>/g, '')
|
||||||
// 处理换行符,统一为\n
|
// 处理换行符,统一为\n
|
||||||
text = text.replace(/\\n/g, '\n')
|
text = text.replace(/\\n/g, '\n')
|
||||||
|
|
||||||
// 按换行符分割并获取第一行
|
// 按换行符分割并获取第一行
|
||||||
const lines = text.split('\n')
|
const lines = text.split('\n')
|
||||||
|
|
||||||
// 返回第一行内容,如果为空则显示默认文本
|
// 返回第一行内容,如果为空则显示默认文本
|
||||||
return lines[0]?.trim() || '无内容'
|
return lines[0]?.trim() || '无内容'
|
||||||
})
|
})
|
||||||
|
|
||||||
// 计算删除按钮的样式
|
// 计算删除按钮的样式
|
||||||
const deleteButtonStyle = computed(() => {
|
const deleteButtonStyle = computed(() => {
|
||||||
return {
|
return {
|
||||||
@@ -108,10 +100,10 @@ const deleteButtonStyle = computed(() => {
|
|||||||
pointerEvents: isSlided.value ? 'auto' : 'none',
|
pointerEvents: isSlided.value ? 'auto' : 'none',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 滑动阈值(删除按钮宽度)
|
// 滑动阈值(删除按钮宽度)
|
||||||
// 当滑动距离超过此值时,显示删除按钮
|
// 当滑动距离超过此值时,显示删除按钮
|
||||||
const SLIDE_THRESHOLD = 64 // 4rem 转换为 px
|
const scaleNum = getRootFontSize() / 16
|
||||||
|
const SLIDE_THRESHOLD = 64 * scaleNum
|
||||||
|
|
||||||
// 容器触摸事件处理函数
|
// 容器触摸事件处理函数
|
||||||
const handleContainerTouchStart = e => {
|
const handleContainerTouchStart = e => {
|
||||||
@@ -120,21 +112,18 @@ const handleContainerTouchStart = e => {
|
|||||||
// 阻止父级滚动容器的滚动行为
|
// 阻止父级滚动容器的滚动行为
|
||||||
e.stopImmediatePropagation()
|
e.stopImmediatePropagation()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleContainerTouchMove = e => {
|
const handleContainerTouchMove = e => {
|
||||||
// 阻止事件冒泡到父组件
|
// 阻止事件冒泡到父组件
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
// 阻止父级滚动容器的滚动行为
|
// 阻止父级滚动容器的滚动行为
|
||||||
e.stopImmediatePropagation()
|
e.stopImmediatePropagation()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleContainerTouchEnd = e => {
|
const handleContainerTouchEnd = e => {
|
||||||
// 阻止事件冒泡到父组件
|
// 阻止事件冒泡到父组件
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
// 阻止父级滚动容器的滚动行为
|
// 阻止父级滚动容器的滚动行为
|
||||||
e.stopImmediatePropagation()
|
e.stopImmediatePropagation()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理便签点击事件
|
// 处理便签点击事件
|
||||||
// 只有在未滑动状态下才触发点击事件,避免与滑动操作冲突
|
// 只有在未滑动状态下才触发点击事件,避免与滑动操作冲突
|
||||||
const handlePress = () => {
|
const handlePress = () => {
|
||||||
@@ -146,7 +135,6 @@ const handlePress = () => {
|
|||||||
resetSlideState()
|
resetSlideState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理星标切换事件
|
// 处理星标切换事件
|
||||||
// 点击星标图标时调用父组件传递的回调函数
|
// 点击星标图标时调用父组件传递的回调函数
|
||||||
const handleStarToggle = () => {
|
const handleStarToggle = () => {
|
||||||
@@ -154,7 +142,6 @@ const handleStarToggle = () => {
|
|||||||
props.onStarToggle()
|
props.onStarToggle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理置顶切换事件
|
// 处理置顶切换事件
|
||||||
// 点击置顶图标时调用父组件传递的回调函数
|
// 点击置顶图标时调用父组件传递的回调函数
|
||||||
const handleTopToggle = () => {
|
const handleTopToggle = () => {
|
||||||
@@ -162,7 +149,6 @@ const handleTopToggle = () => {
|
|||||||
props.onTopToggle()
|
props.onTopToggle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理删除事件
|
// 处理删除事件
|
||||||
// 点击删除按钮时调用父组件传递的回调函数
|
// 点击删除按钮时调用父组件传递的回调函数
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
@@ -173,22 +159,18 @@ const handleDelete = () => {
|
|||||||
isSliding.value = false
|
isSliding.value = false
|
||||||
isSlided.value = false
|
isSlided.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置滑动状态
|
// 重置滑动状态
|
||||||
const resetSlideState = () => {
|
const resetSlideState = () => {
|
||||||
slideOffset.value = 0
|
slideOffset.value = 0
|
||||||
isSliding.value = false
|
isSliding.value = false
|
||||||
isSlided.value = false
|
isSlided.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取滑动状态
|
// 获取滑动状态
|
||||||
const getSlideState = () => {
|
const getSlideState = () => {
|
||||||
return isSlided.value
|
return isSlided.value
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暴露方法给父组件
|
// 暴露方法给父组件
|
||||||
defineExpose({ resetSlideState, getSlideState })
|
defineExpose({ resetSlideState, getSlideState })
|
||||||
|
|
||||||
// 触摸开始事件处理函数
|
// 触摸开始事件处理函数
|
||||||
// 记录触摸开始时的X坐标,用于计算滑动距离
|
// 记录触摸开始时的X坐标,用于计算滑动距离
|
||||||
const handleTouchStart = e => {
|
const handleTouchStart = e => {
|
||||||
@@ -203,24 +185,20 @@ const handleTouchStart = e => {
|
|||||||
isSlided.value = false
|
isSlided.value = false
|
||||||
isScrolling.value = false // 重置滚动状态
|
isScrolling.value = false // 重置滚动状态
|
||||||
}
|
}
|
||||||
|
|
||||||
// 触摸移动事件处理函数
|
// 触摸移动事件处理函数
|
||||||
// 根据手指移动距离计算便签条的水平偏移量
|
// 根据手指移动距离计算便签条的水平偏移量
|
||||||
const handleTouchMove = e => {
|
const handleTouchMove = e => {
|
||||||
if (!startX.value || !startY.value) return
|
if (!startX.value || !startY.value) return
|
||||||
|
|
||||||
const currentX = e.touches[0].clientX
|
const currentX = e.touches[0].clientX
|
||||||
const currentY = e.touches[0].clientY
|
const currentY = e.touches[0].clientY
|
||||||
const diffX = currentX - startX.value
|
const diffX = currentX - startX.value
|
||||||
const diffY = currentY - startY.value
|
const diffY = currentY - startY.value
|
||||||
|
|
||||||
// 如果已经确定是滚动,则不再处理
|
// 如果已经确定是滚动,则不再处理
|
||||||
if (isScrolling.value) {
|
if (isScrolling.value) {
|
||||||
// 阻止事件冒泡到父组件,防止页面滚动时触发便签滑动
|
// 阻止事件冒泡到父组件,防止页面滚动时触发便签滑动
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是滚动还是滑动操作
|
// 判断是滚动还是滑动操作
|
||||||
// 如果Y轴移动距离大于X轴移动距离,则认为是滚动
|
// 如果Y轴移动距离大于X轴移动距离,则认为是滚动
|
||||||
if (Math.abs(diffY) > Math.abs(diffX)) {
|
if (Math.abs(diffY) > Math.abs(diffX)) {
|
||||||
@@ -229,22 +207,18 @@ const handleTouchMove = e => {
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 只处理右滑动(正值)
|
// 只处理右滑动(正值)
|
||||||
if (diffX > 0) {
|
if (diffX > 0) {
|
||||||
// 阻止事件冒泡到父组件,防止页面滚动时触发便签滑动
|
// 阻止事件冒泡到父组件,防止页面滚动时触发便签滑动
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
// 阻止父级滚动容器的滚动行为
|
// 阻止父级滚动容器的滚动行为
|
||||||
e.stopImmediatePropagation()
|
e.stopImmediatePropagation()
|
||||||
|
|
||||||
// 只有当滑动达到一定距离时才阻止页面滚动
|
// 只有当滑动达到一定距离时才阻止页面滚动
|
||||||
if (diffX > 5) {
|
if (diffX > 5) {
|
||||||
e.preventDefault() // 防止页面滚动
|
e.preventDefault() // 防止页面滚动
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置滑动状态
|
// 设置滑动状态
|
||||||
isSliding.value = true
|
isSliding.value = true
|
||||||
|
|
||||||
// 应用阻尼效果,使超过阈值后的滑动更加困难
|
// 应用阻尼效果,使超过阈值后的滑动更加困难
|
||||||
let offset = 0
|
let offset = 0
|
||||||
if (diffX <= SLIDE_THRESHOLD) {
|
if (diffX <= SLIDE_THRESHOLD) {
|
||||||
@@ -255,7 +229,6 @@ const handleTouchMove = e => {
|
|||||||
const excess = diffX - SLIDE_THRESHOLD
|
const excess = diffX - SLIDE_THRESHOLD
|
||||||
offset = SLIDE_THRESHOLD + excess * 0.03 // 0.03 为阻尼系数
|
offset = SLIDE_THRESHOLD + excess * 0.03 // 0.03 为阻尼系数
|
||||||
}
|
}
|
||||||
|
|
||||||
slideOffset.value = offset
|
slideOffset.value = offset
|
||||||
isSlided.value = offset >= SLIDE_THRESHOLD
|
isSlided.value = offset >= SLIDE_THRESHOLD
|
||||||
} else if (diffX < 0) {
|
} else if (diffX < 0) {
|
||||||
@@ -263,22 +236,18 @@ const handleTouchMove = e => {
|
|||||||
const offset = Math.max(0, slideOffset.value + diffX)
|
const offset = Math.max(0, slideOffset.value + diffX)
|
||||||
slideOffset.value = offset
|
slideOffset.value = offset
|
||||||
isSlided.value = offset >= SLIDE_THRESHOLD
|
isSlided.value = offset >= SLIDE_THRESHOLD
|
||||||
|
|
||||||
// 更新 startX 以确保连续滑动的正确性
|
// 更新 startX 以确保连续滑动的正确性
|
||||||
startX.value = currentX
|
startX.value = currentX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 触摸结束事件处理函数
|
// 触摸结束事件处理函数
|
||||||
// 根据滑动距离决定便签条的最终位置
|
// 根据滑动距离决定便签条的最终位置
|
||||||
const handleTouchEnd = e => {
|
const handleTouchEnd = e => {
|
||||||
if (!startX.value) return
|
if (!startX.value) return
|
||||||
|
|
||||||
// 阻止事件冒泡到父组件,防止页面滚动时触发便签滑动
|
// 阻止事件冒泡到父组件,防止页面滚动时触发便签滑动
|
||||||
e?.stopPropagation()
|
e?.stopPropagation()
|
||||||
// 阻止父级滚动容器的滚动行为
|
// 阻止父级滚动容器的滚动行为
|
||||||
e?.stopImmediatePropagation()
|
e?.stopImmediatePropagation()
|
||||||
|
|
||||||
// 如果滑动超过阈值,保持滑出状态;否则回弹
|
// 如果滑动超过阈值,保持滑出状态;否则回弹
|
||||||
if (slideOffset.value >= SLIDE_THRESHOLD) {
|
if (slideOffset.value >= SLIDE_THRESHOLD) {
|
||||||
// 保持滑出状态,显示删除按钮
|
// 保持滑出状态,显示删除按钮
|
||||||
@@ -290,14 +259,12 @@ const handleTouchEnd = e => {
|
|||||||
isSliding.value = false
|
isSliding.value = false
|
||||||
isSlided.value = false
|
isSlided.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置起始位置和滚动状态
|
// 重置起始位置和滚动状态
|
||||||
startX.value = 0
|
startX.value = 0
|
||||||
startY.value = 0
|
startY.value = 0
|
||||||
isScrolling.value = false
|
isScrolling.value = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.mt-17-5 {
|
.mt-17-5 {
|
||||||
margin-top: -1rem;
|
margin-top: -1rem;
|
||||||
@@ -334,9 +301,9 @@ const handleTouchEnd = e => {
|
|||||||
background: linear-gradient(to bottom, #fffdf6, #f3eee4);
|
background: linear-gradient(to bottom, #fffdf6, #f3eee4);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
padding: 0.44rem 0.69rem 0.88rem 2.09rem;
|
padding: 0.44rem 0.69rem 0.88rem 2.09rem;
|
||||||
box-shadow: 0 2px 2px 1px rgb(0 0 0 / 15%);
|
box-shadow: 0 0.125rem 0.125rem 0.0625rem rgb(0 0 0 / 15%);
|
||||||
transition: transform 0.2s ease-out;
|
transition: transform 0.2s ease-out;
|
||||||
border-radius: 3px;
|
border-radius: 0.1875rem;
|
||||||
&:before {
|
&:before {
|
||||||
content: '';
|
content: '';
|
||||||
width: 1.5rem;
|
width: 1.5rem;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@ defineExpose({
|
|||||||
padding: 0.25rem 0.5rem;
|
padding: 0.25rem 0.5rem;
|
||||||
border-radius: 2rem;
|
border-radius: 2rem;
|
||||||
background: #f6f9fa;
|
background: #f6f9fa;
|
||||||
border: 1px solid #ccb8a3;
|
border: 0.0625rem solid #ccb8a3;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ defineProps({
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border: 1px solid var(--divider);
|
border: 1px solid var(--divider);
|
||||||
box-shadow: 0 1.25rem 3.125rem 0px rgb(0 0 0 / 5%);
|
box-shadow: 0 1.25rem 3.125rem 0rem rgb(0 0 0 / 5%);
|
||||||
/* 确保不会阻止事件传播 */
|
/* 确保不会阻止事件传播 */
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ const setSearchQuery = value => {
|
|||||||
.folder-page-container {
|
.folder-page-container {
|
||||||
padding: 0.625rem;
|
padding: 0.625rem;
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
|
touch-action: pan-y;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-container {
|
.search-container {
|
||||||
|
|||||||
@@ -438,9 +438,12 @@ onBeforeUnmount(async () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
|
overflow: hidden;
|
||||||
section {
|
section {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.offline-banner {
|
.offline-banner {
|
||||||
@@ -451,24 +454,31 @@ onBeforeUnmount(async () => {
|
|||||||
|
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
||||||
padding: 8px 16px;
|
right: 0;
|
||||||
|
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
z-index: 10000;
|
||||||
|
|
||||||
background-color: #ff6b6b;
|
background-color: #ff6b6b;
|
||||||
|
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
font-size: 14px;
|
padding: 0.5rem 1rem;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
margin-right: 8px;
|
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
overflow-y: scroll;
|
.offline-content {
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
font-size: 0.875rem;
|
||||||
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
|
|||||||
@@ -395,21 +395,21 @@ const notes = computed(() => store.notes)
|
|||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
background-color: #ff6b6b;
|
background-color: #ff6b6b;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 8px 16px;
|
padding: 0.5rem 1rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.offline-content {
|
.offline-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 14px;
|
font-size: 0.875rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.offline-icon {
|
.offline-icon {
|
||||||
margin-right: 8px;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-list {
|
.folder-list {
|
||||||
@@ -421,7 +421,7 @@ const notes = computed(() => store.notes)
|
|||||||
background-color: var(--background-card);
|
background-color: var(--background-card);
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
box-shadow: 0 0.125rem 0.25rem var(--shadow);
|
box-shadow: 0 0.125rem 0.25rem var(--shadow);
|
||||||
border: 1px solid #f0ece7;
|
border: 0.0625rem solid #f0ece7;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,6 +447,8 @@ const notes = computed(() => store.notes)
|
|||||||
.notes-container {
|
.notes-container {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
touch-action: pan-y;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes-list {
|
.notes-list {
|
||||||
@@ -466,7 +468,7 @@ const notes = computed(() => store.notes)
|
|||||||
|
|
||||||
.note-list-leave-to {
|
.note-list-leave-to {
|
||||||
|
|
||||||
transform: translateX(-30px);
|
opacity: 0;
|
||||||
|
|
||||||
transform: translateX(-1.875rem);
|
transform: translateX(-1.875rem);
|
||||||
|
|
||||||
@@ -486,7 +488,7 @@ const notes = computed(() => store.notes)
|
|||||||
.folder-slide-leave-active {
|
.folder-slide-leave-active {
|
||||||
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
||||||
}
|
}
|
||||||
transform: scale(0.8) translateY(-20px);
|
|
||||||
.folder-slide-enter-from {
|
.folder-slide-enter-from {
|
||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -501,6 +503,6 @@ const notes = computed(() => store.notes)
|
|||||||
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
transform: scale(0.8) translateY(-20px);
|
transform: scale(1) translateY(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,16 +115,8 @@ const settings = computed(() => store.settings)
|
|||||||
background: url('/assets/icons/drawable-xxhdpi/note_setting_bg.png');
|
background: url('/assets/icons/drawable-xxhdpi/note_setting_bg.png');
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow-y: scroll;
|
overflow-y: auto;
|
||||||
|
touch-action: pan-y;
|
||||||
.item-text-primary {
|
-webkit-overflow-scrolling: touch;
|
||||||
font-size: 1rem;
|
|
||||||
color: #8e8e8e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-text-tertiary {
|
|
||||||
font-size: 0.9375rem;
|
|
||||||
color: #b4b4b4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
29
src/utils/sizeUtils.js
Normal file
29
src/utils/sizeUtils.js
Normal file
@@ -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`;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user