change background loading method

This commit is contained in:
Annie Huang committed 2024-08-01 19:29:01 +08:00
1 parent dd67bcb1bd
commit 60641ba0ad
2 files changed
+64 -62

No files matched your search

+61 -62
View File
@@ -161,71 +161,70 @@ const edgeStyle = computed(() => {
<template> <template>
<div class="relative bg-black w-full h-full flex"> <div class="relative bg-black w-full h-full flex">
<img <div
src="../img/catelogbg.svg" class="flex place-content-center w-full bg-catelogbg bg-cover bg-scroll"
alt="bg"
class="p-2 stroke-2 scale-y-120 justify-center items-center"
/>
<h1
class="p-10 absolute w-fit z-2 font-mono flex flax-wrap text-xl"
style="width: 30%; height: 6%; font-size: 3vh; color: #00ff00"
> >
踏上你的Linux冒險之旅吧! <h1
</h1> class="p-10 absolute w-fit z-2 font-mono flex flax-wrap text-xl"
<svg style="width: 30%; height: 6%; font-size: 3vh; color: #00ff00"
:width="svgWidth" >
:height="svgHeight" 踏上你的Linux冒險之旅吧!
class="absolute" </h1>
@mousedown="startDrag" <svg
@mousemove="drag" :width="svgWidth"
@mouseup="endDrag" :height="svgHeight"
@mouseleave="endDrag" class="absolute"
> @mousedown="startDrag"
<g :transform="`translate(${offsetX}, ${offsetY})`"> @mousemove="drag"
<g @mouseup="endDrag"
v-for="edge in graphData.edges" @mouseleave="endDrag"
:key="`${edge.source.id}-${edge.target.id}`" >
> <g :transform="`translate(${offsetX}, ${offsetY})`">
<path <g
:d="curvedPath(edge.source, edge.target)" v-for="edge in graphData.edges"
:class="['edge', edgeStyle(edge)]" :key="`${edge.source.id}-${edge.target.id}`"
/>
</g>
<g
v-for="node in graphData.nodes"
:key="node.id"
@click="handleNodeClick(node)"
>
<rect
:x="node.x - nodeWidth / 2"
:y="node.y - nodeHeight / 2"
:width="nodeWidth"
:height="nodeHeight"
rx="10"
ry="10"
:class="['node', nodeStyle(node)]"
/>
<text
:x="node.x"
:y="node.y"
text-anchor="middle"
alignment-baseline="middle"
:class="['node-text', nodeStyle(node)]"
font-size="18"
> >
{{ node.title }} <path
</text> :d="curvedPath(edge.source, edge.target)"
:class="['edge', edgeStyle(edge)]"
/>
</g>
<g
v-for="node in graphData.nodes"
:key="node.id"
@click="handleNodeClick(node)"
>
<rect
:x="node.x - nodeWidth / 2"
:y="node.y - nodeHeight / 2"
:width="nodeWidth"
:height="nodeHeight"
rx="10"
ry="10"
:class="['node', nodeStyle(node)]"
/>
<text
:x="node.x"
:y="node.y"
text-anchor="middle"
alignment-baseline="middle"
:class="['node-text', nodeStyle(node)]"
font-size="18"
>
{{ node.title }}
</text>
</g>
</g> </g>
</g> </svg>
</svg> <QuestIntro
<QuestIntro :questTitle="opened.title"
:questTitle="opened.title" :questId="opened.id"
:questId="opened.id" :questCompleted="opened.completed"
:questCompleted="opened.completed" :questUnlocked="opened.unlocked"
:questUnlocked="opened.unlocked" v-if="opened.id !== ''"
v-if="opened.id !== ''" @close-intro="closeIntro"
@close-intro="closeIntro" />
/> </div>
</div> </div>
</template> </template>
+3
View File
@@ -24,6 +24,9 @@ export default {
DEFAULT: '#FF0000', DEFAULT: '#FF0000',
}, },
}, },
backgroundImage: {
catelogbg: "url('src/img/catelogbg.svg')",
},
}, },
}, },
plugins: [], plugins: [],