generated from icrdr/omoolab-project
feat: restructure wiki and notes, enhance Viewer component
- Removed obsolete theme index and documentation files. - Deleted unused images and canvas files. - Added new images for notes and updated canvas files. - Enhanced Viewer component with improved zoom and fullscreen functionalities. - Updated wiki configuration with new navigation and sidebar structure. - Created new index pages for notes and wiki with categorized content. - Updated links and references in markdown files to reflect new structure.
This commit is contained in:
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule ".obsidian/plugins/vitepress-exporter"]
|
||||
path = .obsidian/plugins/vitepress-exporter
|
||||
url = https://git.omoolab.xyz/icrdr/vitepress-exporter.git
|
||||
[submodule ".obsidian/plugins/odox"]
|
||||
path = .obsidian/plugins/odox
|
||||
url = https://git.omoolab.xyz/icrdr/odox.git
|
||||
1
.obsidian/plugins/odox
vendored
Submodule
1
.obsidian/plugins/odox
vendored
Submodule
Submodule .obsidian/plugins/odox added at 0e051b7293
1
.obsidian/plugins/vitepress-exporter
vendored
1
.obsidian/plugins/vitepress-exporter
vendored
Submodule .obsidian/plugins/vitepress-exporter deleted from e5e7d724c6
@@ -9,7 +9,7 @@
|
||||
- 使用的依赖越少越好
|
||||
- 选用简单直接的方式实现
|
||||
- 代码、执行方式改变,调整已有的文档、计划,而非新建
|
||||
|
||||
- Markdown 中不使用`---`分割器
|
||||
|
||||
本地运行 action
|
||||
```bash
|
||||
|
||||
28
deploy.sh
28
deploy.sh
@@ -1,18 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 检查 wiki 目录是否有变更
|
||||
CHANGED_FILES=$(git diff --name-only wiki && git ls-files --others --exclude-standard wiki)
|
||||
|
||||
if [ -n "$CHANGED_FILES" ]; then
|
||||
echo "检测到 wiki 目录有变更,正在提交..."
|
||||
git add wiki
|
||||
git commit -m "Update wiki"
|
||||
else
|
||||
echo "wiki 目录没有变更,跳过提交"
|
||||
fi
|
||||
|
||||
# 自动获取当前 Git 分支名
|
||||
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
# 获取仓库名称
|
||||
REMOTE_URL=$(git remote get-url origin)
|
||||
REPO_NAME=$(basename -s .git "$REMOTE_URL")
|
||||
|
||||
# 拼接 Tag 名称:wiki-分支名
|
||||
TAG_NAME="wiki-$BRANCH_NAME"
|
||||
|
||||
echo "当前分支:$BRANCH_NAME"
|
||||
echo "即将创建 Tag:$TAG_NAME"
|
||||
|
||||
# 创建本地 Tag
|
||||
git tag "$TAG_NAME"
|
||||
git tag -f "$TAG_NAME"
|
||||
|
||||
# 推送到远程仓库
|
||||
git push origin "$TAG_NAME"
|
||||
|
||||
echo -e "\n✅ Tag 创建并推送成功:$TAG_NAME"
|
||||
if git push origin -f "$TAG_NAME"; then
|
||||
echo -e "\n✅ $BRANCH_NAME 创建并推送成功,等待部署完毕"
|
||||
echo -e "\n🌍 部署地址:https://wiki.omoolab.com/$REPO_NAME/$BRANCH_NAME/"
|
||||
else
|
||||
echo -e "\n❌ $BRANCH_NAME 推送失败!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,8 +0,0 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
title: "OmooLab",
|
||||
description: "An OmooLab Project",
|
||||
base: '/', // Replace with your repository name if deploying to GitHub Pages
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import Viewer from './components/Viewer.vue'
|
||||
|
||||
/** @type {import('vitepress').Theme} */
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
enhanceApp({ app }) {
|
||||
app.component('Viewer', Viewer)
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
# OmooLab Wiki
|
||||
@@ -1,7 +0,0 @@
|
||||
# 测试笔记 - Canvas 导出
|
||||
|
||||
这是一个用于测试 Canvas 导出功能的笔记。
|
||||
|
||||
<Viewer src="/Untitled.png" />
|
||||
|
||||
<Viewer src="/canvas.png" />
|
||||
BIN
docs/public/Untitled.png
LFS
BIN
docs/public/Untitled.png
LFS
Binary file not shown.
BIN
docs/public/canvas.png
LFS
BIN
docs/public/canvas.png
LFS
Binary file not shown.
BIN
notes/assets/20260421-074743.png
LFS
Normal file
BIN
notes/assets/20260421-074743.png
LFS
Normal file
Binary file not shown.
BIN
notes/assets/Untitled.png
LFS
Normal file
BIN
notes/assets/Untitled.png
LFS
Normal file
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"nodes":[
|
||||
{"id":"860c29754b1b08bf","type":"text","text":"sdfasdf\nasdfasdfasdf\n# fsadfs fasdf asdf asdf ","x":8640,"y":-4480,"width":496,"height":293},
|
||||
{"id":"ad3484c9e0322d05","type":"text","text":"发色粉撒而非","x":5200,"y":-1840,"width":1920,"height":4946}
|
||||
],
|
||||
"edges":[]
|
||||
}
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
这是一个用于测试 Canvas 导出功能的笔记。
|
||||
|
||||

|
||||

|
||||
|
||||
![[canvas.canvas]]
|
||||
![[测试画板-1.canvas]]
|
||||
|
||||
14
notes/测试画板-1.canvas
Normal file
14
notes/测试画板-1.canvas
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"nodes":[
|
||||
{"id":"b42845a8ff7d51dc","x":6380,"y":-3440,"width":1330,"height":1418,"color":"3","type":"group","label":"Untitled group"},
|
||||
{"id":"2780851064da9bdb","type":"file","file":"notes/assets/Untitled.png","x":6580,"y":-3160,"width":460,"height":460},
|
||||
{"id":"596415dba7899135","type":"text","text":"发生的方式方式大幅\n\n撒地方士大夫三大发生的f\n\n的萨芬阿斯蒂芬撒地方\n\n\n撒地方撒地方啊色粉啊色粉\n\n啊色粉啊色粉啊色粉","x":7744,"y":-2649,"width":376,"height":313},
|
||||
{"id":"860c29754b1b08bf","type":"text","text":"sdfasdf\nasdfasdfasdf\n# fsadfs fasdf asdf asdf ","x":6810,"y":-3310,"width":496,"height":300},
|
||||
{"id":"ad3484c9e0322d05","type":"text","text":"发色粉撒而非","x":6360,"y":-2740,"width":500,"height":280},
|
||||
{"id":"c494f34282f42d91","type":"file","file":"notes/assets/20260421-074743.png","x":7306,"y":-2938,"width":198,"height":198}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"a7a9eb1b8977f036","fromNode":"ad3484c9e0322d05","fromSide":"right","toNode":"c494f34282f42d91","toSide":"left"},
|
||||
{"id":"fdb0bd6d9376876f","fromNode":"c494f34282f42d91","fromSide":"right","toNode":"596415dba7899135","toSide":"left"}
|
||||
]
|
||||
}
|
||||
@@ -5,4 +5,49 @@ export default defineConfig({
|
||||
title: "OmooLab",
|
||||
description: "An OmooLab Project",
|
||||
base: '/', // Replace with your repository name if deploying to GitHub Pages
|
||||
themeConfig: {
|
||||
logo: '/logo.png',
|
||||
siteTitle: false,
|
||||
nav: [
|
||||
{ text: '首页', link: '/' },
|
||||
{ text: '记录', link: '/notes/' },
|
||||
{ text: '我们', link: 'https://www.omoolab.xyz' }
|
||||
],
|
||||
sidebar: {
|
||||
'/': [
|
||||
{
|
||||
text: '导航',
|
||||
items: [
|
||||
{ text: '首页', link: '/' },
|
||||
{ text: '笔记列表', link: '/notes/' },
|
||||
{ text: '测试笔记', link: '/notes/测试导出/' }
|
||||
]
|
||||
}
|
||||
],
|
||||
'/notes/': [
|
||||
{
|
||||
text: '笔记',
|
||||
items: [
|
||||
{ text: '所有笔记', link: '/notes/' },
|
||||
{ text: '测试笔记', link: '/notes/测试导出/' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '画板',
|
||||
items: [
|
||||
{ text: '测试画板 1', link: '/notes/测试画板-1.canvas/' },
|
||||
{ text: '测试画板 2', link: '/notes/测试画板-2.canvas/' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
footer: {
|
||||
message: '<a href="https://beian.miit.gov.cn/" target="_blank">浙ICP备2025208399号-1</a>',
|
||||
copyright: 'Copyright © 2025-present OmooLab'
|
||||
},
|
||||
search: {
|
||||
provider: 'local'
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
@@ -1,10 +1,56 @@
|
||||
<template>
|
||||
<div class="viewer-wrapper">
|
||||
<!-- 正常模式 -->
|
||||
<!-- 正常模式 -->
|
||||
<div
|
||||
v-show="!isFullscreen"
|
||||
class="zoom-container"
|
||||
ref="containerRef"
|
||||
v-bind="attrs"
|
||||
@wheel.prevent="handleWheel"
|
||||
@mousedown="handleMouseDown"
|
||||
@touchstart="handleTouchStart"
|
||||
@touchmove="handleTouchMove"
|
||||
@touchend="handleTouchEnd"
|
||||
>
|
||||
<canvas
|
||||
ref="canvasRef"
|
||||
class="zoom-canvas"
|
||||
></canvas>
|
||||
|
||||
<div class="loading-indicator" v-if="isLoading">
|
||||
加载中...
|
||||
</div>
|
||||
|
||||
<!-- 小地图 -->
|
||||
<div
|
||||
v-show="!isFullscreen"
|
||||
class="zoom-container"
|
||||
ref="containerRef"
|
||||
class="minimap"
|
||||
ref="minimapRef"
|
||||
@mousedown="handleMinimapMouseDown"
|
||||
@wheel.stop
|
||||
:style="minimapStyle"
|
||||
>
|
||||
<canvas
|
||||
ref="minimapCanvasRef"
|
||||
class="minimap-canvas"
|
||||
></canvas>
|
||||
<div
|
||||
class="minimap-viewport"
|
||||
:style="minimapViewportStyle"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<div class="zoom-controls" @wheel.stop @mousedown.stop>
|
||||
<button @click="zoomIn" title="放大">+</button>
|
||||
<button @click="zoomOut" title="缩小">-</button>
|
||||
<button @click="resetZoom" title="重置">↺</button>
|
||||
<button @click="toggleFullscreen" title="全屏">⛶</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 全屏模式 -->
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="isFullscreen"
|
||||
class="fullscreen-overlay"
|
||||
@wheel.prevent="handleWheel"
|
||||
@mousedown="handleMouseDown"
|
||||
@touchstart="handleTouchStart"
|
||||
@@ -12,24 +58,20 @@
|
||||
@touchend="handleTouchEnd"
|
||||
>
|
||||
<canvas
|
||||
ref="canvasRef"
|
||||
ref="fullscreenCanvasRef"
|
||||
class="zoom-canvas"
|
||||
></canvas>
|
||||
|
||||
<div class="loading-indicator" v-if="isLoading">
|
||||
加载中...
|
||||
</div>
|
||||
|
||||
<!-- 小地图 -->
|
||||
<div
|
||||
class="minimap"
|
||||
ref="minimapRef"
|
||||
ref="fullscreenMinimapRef"
|
||||
@mousedown="handleMinimapMouseDown"
|
||||
@wheel.stop
|
||||
:style="minimapStyle"
|
||||
>
|
||||
<canvas
|
||||
ref="minimapCanvasRef"
|
||||
ref="fullscreenMinimapCanvasRef"
|
||||
class="minimap-canvas"
|
||||
></canvas>
|
||||
<div
|
||||
@@ -42,59 +84,23 @@
|
||||
<button @click="zoomIn" title="放大">+</button>
|
||||
<button @click="zoomOut" title="缩小">-</button>
|
||||
<button @click="resetZoom" title="重置">↺</button>
|
||||
<button @click="toggleFullscreen" title="全屏">⛶</button>
|
||||
<button @click="toggleFullscreen" title="退出全屏">⛶</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 全屏模式 -->
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="isFullscreen"
|
||||
class="fullscreen-overlay"
|
||||
@wheel.prevent="handleWheel"
|
||||
@mousedown="handleMouseDown"
|
||||
@touchstart="handleTouchStart"
|
||||
@touchmove="handleTouchMove"
|
||||
@touchend="handleTouchEnd"
|
||||
>
|
||||
<canvas
|
||||
ref="fullscreenCanvasRef"
|
||||
class="zoom-canvas"
|
||||
></canvas>
|
||||
|
||||
<!-- 小地图 -->
|
||||
<div
|
||||
class="minimap"
|
||||
ref="fullscreenMinimapRef"
|
||||
@mousedown="handleMinimapMouseDown"
|
||||
@wheel.stop
|
||||
:style="minimapStyle"
|
||||
>
|
||||
<canvas
|
||||
ref="fullscreenMinimapCanvasRef"
|
||||
class="minimap-canvas"
|
||||
></canvas>
|
||||
<div
|
||||
class="minimap-viewport"
|
||||
:style="minimapViewportStyle"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<div class="zoom-controls" @wheel.stop @mousedown.stop>
|
||||
<button @click="zoomIn" title="放大">+</button>
|
||||
<button @click="zoomOut" title="缩小">-</button>
|
||||
<button @click="resetZoom" title="重置">↺</button>
|
||||
<button @click="toggleFullscreen" title="退出全屏">⛶</button>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick, useAttrs } from 'vue'
|
||||
import { withBase } from 'vitepress'
|
||||
|
||||
// 禁用自动属性继承,手动控制 style 应用
|
||||
defineOptions({
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const attrs = useAttrs()
|
||||
|
||||
const props = defineProps({
|
||||
src: {
|
||||
type: String,
|
||||
@@ -297,6 +303,14 @@ const updateMinimapSize = () => {
|
||||
width: `${width}px`,
|
||||
height: `${height}px`
|
||||
}
|
||||
|
||||
// 等待 DOM 更新后重新初始化小地图 canvas
|
||||
nextTick(() => {
|
||||
initMinimapCanvas(minimapCanvasRef.value, minimapRef.value, minimapCtx)
|
||||
if (isFullscreen.value) {
|
||||
initMinimapCanvas(fullscreenMinimapCanvasRef.value, fullscreenMinimapRef.value, fullscreenMinimapCtx)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前应该使用的图片
|
||||
@@ -340,6 +354,24 @@ const loadImage = () => {
|
||||
img.src = withBase(props.src)
|
||||
}
|
||||
|
||||
// 初始化小地图 canvas 的尺寸和 context
|
||||
const initMinimapCanvas = (canvas, minimap, context) => {
|
||||
if (!canvas || !minimap || !context) return
|
||||
|
||||
const dpr = window.devicePixelRatio || 1
|
||||
const rect = minimap.getBoundingClientRect()
|
||||
|
||||
// 重置变换矩阵
|
||||
context.setTransform(1, 0, 0, 1, 0, 0)
|
||||
|
||||
// 设置 canvas 实际分辨率
|
||||
canvas.width = rect.width * dpr
|
||||
canvas.height = rect.height * dpr
|
||||
|
||||
// 应用设备像素比缩放
|
||||
context.scale(dpr, dpr)
|
||||
}
|
||||
|
||||
// 调整Canvas尺寸
|
||||
const resizeCanvas = () => {
|
||||
if (!canvasRef.value || !containerRef.value) return
|
||||
@@ -581,14 +613,10 @@ const renderMinimap = () => {
|
||||
|
||||
minimapAnimationFrameId = requestAnimationFrame(() => {
|
||||
const dpr = window.devicePixelRatio || 1
|
||||
|
||||
// 设置小地图canvas尺寸
|
||||
const rect = minimap.getBoundingClientRect()
|
||||
canvas.width = rect.width * dpr
|
||||
canvas.height = rect.height * dpr
|
||||
|
||||
// 清空小地图
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
||||
// 清空小地图(注意:canvas 已经在 initMinimapCanvas 中设置了正确的尺寸和 scale)
|
||||
ctx.clearRect(0, 0, rect.width, rect.height)
|
||||
|
||||
// 计算小地图中图片的显示尺寸(保持宽高比)
|
||||
const imgAspectRatio = currentImage.width / currentImage.height
|
||||
@@ -613,10 +641,10 @@ const renderMinimap = () => {
|
||||
0,
|
||||
currentImage.width,
|
||||
currentImage.height,
|
||||
offsetX * dpr,
|
||||
offsetY * dpr,
|
||||
minimapImgWidth * dpr,
|
||||
minimapImgHeight * dpr
|
||||
offsetX,
|
||||
offsetY,
|
||||
minimapImgWidth,
|
||||
minimapImgHeight
|
||||
)
|
||||
})
|
||||
}
|
||||
@@ -915,9 +943,10 @@ const toggleFullscreen = () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化全屏小地图 canvas
|
||||
if (fullscreenMinimapCanvasRef.value) {
|
||||
// 初始化全屏小地图 canvas 和 context
|
||||
if (fullscreenMinimapCanvasRef.value && fullscreenMinimapRef.value) {
|
||||
fullscreenMinimapCtx = fullscreenMinimapCanvasRef.value.getContext('2d')
|
||||
initMinimapCanvas(fullscreenMinimapCanvasRef.value, fullscreenMinimapRef.value, fullscreenMinimapCtx)
|
||||
}
|
||||
|
||||
document.body.style.overflow = 'hidden'
|
||||
@@ -951,8 +980,9 @@ onMounted(() => {
|
||||
loadImage()
|
||||
window.addEventListener('resize', handleResize)
|
||||
|
||||
// 初始化小地图
|
||||
// 初始化小地图 canvas
|
||||
nextTick(() => {
|
||||
initMinimapCanvas(minimapCanvasRef.value, minimapRef.value, minimapCtx)
|
||||
renderMinimap()
|
||||
})
|
||||
})
|
||||
@@ -994,16 +1024,10 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.viewer-wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.zoom-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 200px;
|
||||
height: 400px;
|
||||
overflow: hidden;
|
||||
background: var(--vp-c-bg-soft);
|
||||
border: 1px solid var(--vp-c-border);
|
||||
|
||||
@@ -1 +1,26 @@
|
||||
# OmooLab Wiki
|
||||
# 风风风
|
||||
|
||||
## 📚 最新内容
|
||||
|
||||
### 测试笔记
|
||||
测试 Canvas 导出功能和图片查看器组件
|
||||
|
||||
[查看笔记 →](/notes/测试导出/)
|
||||
|
||||
|
||||
|
||||
## 🗂️ 内容分类
|
||||
|
||||
### 笔记 & 文档
|
||||
- [测试笔记](/notes/测试导出/) - Canvas 导出功能测试
|
||||
|
||||
### 画板
|
||||
- [测试画板 1](/notes/测试画板-1.canvas/)
|
||||
- [测试画板 2](/notes/测试画板-2.canvas/)
|
||||
|
||||
|
||||
|
||||
## 🔗 快速链接
|
||||
|
||||
- [关于我们](https://www.omoolab.xyz) - 了解更多关于 OmooLab 的信息
|
||||
- [备案信息](https://beian.miit.gov.cn/) - 浙ICP备2025208399号-1
|
||||
17
wiki/notes/index.md
Normal file
17
wiki/notes/index.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 📝 笔记记录
|
||||
|
||||
这里收录了我们的学习和工作笔记。
|
||||
|
||||
## 📂 笔记列表
|
||||
|
||||
### 测试笔记
|
||||
- [测试笔记 - Canvas 导出](./测试导出/) - 测试 Canvas 导出功能和图片查看器组件
|
||||
|
||||
## 🎨 画板
|
||||
|
||||
- [测试画板 1](./测试画板-1.canvas/) - 第一个测试画板
|
||||
- [测试画板 2](./测试画板-2.canvas/) - 第二个测试画板
|
||||
|
||||
---
|
||||
|
||||
> 💡 **提示**:使用上方搜索框可以快速查找你需要的内容。
|
||||
@@ -1 +1 @@
|
||||
<Viewer src="/测试画板-1.canvas.png" />
|
||||

|
||||
BIN
wiki/public/logo.png
LFS
Normal file
BIN
wiki/public/logo.png
LFS
Normal file
Binary file not shown.
BIN
wiki/public/测试画板-1.canvas.png
LFS
BIN
wiki/public/测试画板-1.canvas.png
LFS
Binary file not shown.
BIN
wiki/public/测试画板-2.canvas.png
LFS
BIN
wiki/public/测试画板-2.canvas.png
LFS
Binary file not shown.
Reference in New Issue
Block a user