Skip to content

Commit b251dcf

Browse files
authored
feat: resolve image loading and overall style issues (#6)
1 parent 1c52242 commit b251dcf

File tree

6 files changed

+44
-30
lines changed

6 files changed

+44
-30
lines changed

.vitepress/theme/Home.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,34 @@
4545
4646
const homeList = [
4747
{
48-
icon: '/images/tiny-vue-logo-active.svg',
48+
icon: 'images/tiny-vue-logo-active.svg',
4949
title: 'TinyVue',
5050
titleTip: 'vue组件库',
51-
imgUrl: '/images/banner1.svg',
52-
link: '/playground/vue-playground',
51+
imgUrl: 'images/banner1.svg',
52+
link: 'vue-playground',
5353
desc: 'OpenTiny NEXT-SDKs 是一套前端智能应用开发工具包,旨在简化 WebAgent 的集成与使用,支持多种编程语言和前端框架,帮助开发者快速实现智能化功能。'
5454
},
5555
{
56-
icon: '/images/tiny-engine-logo-active.svg',
56+
icon: 'images/tiny-engine-logo-active.svg',
5757
title: 'TinyEngine',
5858
titleTip: '低代码引擎',
59-
imgUrl: '/images/banner2.svg',
60-
link: '/playground/tiny-engine#/tiny-engine-editor',
59+
imgUrl: 'images/banner2.svg',
60+
link: 'tiny-engine#/tiny-engine-editor',
6161
desc: 'OpenTiny NEXT-SDKs 是一套前端智能应用开发工具包,旨在简化 WebAgent 的集成与使用,支持多种编程语言和前端框架,帮助开发者快速实现智能化功能。'
6262
},
6363
{
64-
icon: '/images/next-sdk-logo-active.svg',
64+
icon: 'images/next-sdk-logo-active.svg',
6565
title: 'NEXT-SDKs',
6666
titleTip: '智能应用开发工具包',
67-
imgUrl: '/images/banner3.svg',
67+
imgUrl: 'images/banner3.svg',
6868
link: '',
6969
desc: 'OpenTiny NEXT-SDKs 是一套前端智能应用开发工具包,旨在简化 WebAgent 的集成与使用,支持多种编程语言和前端框架,帮助开发者快速实现智能化功能。'
7070
},
7171
{
72-
icon: '/images/tiny-robot-logo-active.svg',
72+
icon: 'images/tiny-robot-logo-active.svg',
7373
title: 'TinyRobot',
7474
titleTip: 'AI智能助手',
75-
imgUrl: '/images/banner4.svg',
75+
imgUrl: 'images/banner4.svg',
7676
link: '',
7777
desc: 'OpenTiny NEXT-SDKs 是一套前端智能应用开发工具包,旨在简化 WebAgent 的集成与使用,支持多种编程语言和前端框架,帮助开发者快速实现智能化功能。'
7878
},

.vitepress/theme/components/CustomHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ watch(
242242
top: 0;
243243
z-index: 50;
244244
width: 100%;
245-
background-image: url('./images/bg-playground-home');
245+
background-image: url('./images/bg-playground-home.png');
246246
background-size: cover;
247247
backdrop-filter: blur(12px);
248248
-webkit-backdrop-filter: blur(12px);

.vitepress/theme/components/customContent.vue

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class="icon-wrapper"
1313
@mouseenter="showTip(idx)"
1414
@mouseleave="hideTip"
15+
@click="changeIcon(idx)"
1516
style="position: relative"
1617
>
1718
<a :href="iconList.link" rel="noopener noreferrer">
@@ -27,7 +28,7 @@
2728
</div>
2829
</div>
2930
<div class="sidebar-mb" @click="showModal = true">
30-
<img src="/images/menu.svg" class="menu-mb" />
31+
<img src="./images/menu.svg" class="menu-mb" />
3132
</div>
3233
<div class="main-content">
3334
<label class="iframe-loader">
@@ -54,7 +55,7 @@
5455
<div class="home-logo-mb">
5556
<a href="/" class="logo-link">
5657
<img
57-
:src="isDark ? '/images/logo2.svg' : '/images/logo2.svg'"
58+
:src="isDark ? 'images/logo2.svg' : 'images/logo2.svg'"
5859
alt="OpenTiny NEXT"
5960
class="logo-icon"
6061
/>
@@ -124,7 +125,7 @@
124125
class="home-link home-link-mb"
125126
>
126127
<img
127-
:src="'/images/logo.svg'"
128+
:src="'images/logo.svg'"
128129
alt="OpenTiny NEXT"
129130
class="logo-icon"
130131
/>
@@ -150,46 +151,46 @@
150151
</div>
151152
</template>
152153
<script setup lang="ts">
153-
import { ref, watch } from "vue";
154+
import { reactive, ref, watch } from "vue";
154155
import { useRoute } from "vitepress";
155156
const route = useRoute();
156157
157158
const showModal = ref(false);
158159
159-
const iconLists = [
160+
const iconLists = reactive([
160161
{
161-
src: "/images/tiny-vue-logo.svg",
162-
srcActive: "/images/tiny-vue-logo-active.svg",
162+
src: "images/tiny-vue-logo.svg",
163+
srcActive: "images/tiny-vue-logo-active.svg",
163164
isActive: true,
164165
title: "TinyVue",
165166
titleTip: "vue组件库",
166-
link: "/playground/vue-playground",
167+
link: "vue-playground",
167168
},
168169
{
169-
src: "/images/tiny-engine-logo.svg",
170-
srcActive: "/images/tiny-engine-logo-active.svg",
170+
src: "images/tiny-engine-logo.svg",
171+
srcActive: "images/tiny-engine-logo-active.svg",
171172
isActive: false,
172173
title: "TinyEngine",
173174
titleTip: "低代码引擎",
174-
link: "/playground/tiny-engine#/tiny-engine-editor",
175+
link: "tiny-engine#/tiny-engine-editor",
175176
},
176177
{
177-
src: "/images/next-sdk-logo.svg",
178-
srcActive: "/images/next-sdk-logo-active.svg",
178+
src: "images/next-sdk-logo.svg",
179+
srcActive: "images/next-sdk-logo-active.svg",
179180
isActive: false,
180181
title: "NEXT-SDKs",
181182
link: "",
182183
titleTip: "智能应用工具包",
183184
},
184185
{
185-
src: "/images/tiny-robot-logo.svg",
186-
srcActive: "/images/tiny-robot-logo-active.svg",
186+
src: "images/tiny-robot-logo.svg",
187+
srcActive: "images/tiny-robot-logo-active.svg",
187188
isActive: false,
188189
title: "TinyRobot",
189190
link: "",
190191
titleTip: "AI智能助手",
191192
},
192-
];
193+
]);
193194
194195
const tipIdx = ref(null);
195196
const linkUrl = ref("https://opentiny.design/vue-playground");
@@ -199,6 +200,11 @@ function showTip(idx) {
199200
const hideTip = () => {
200201
tipIdx.value = null;
201202
};
203+
const changeIcon = (idx) => {
204+
iconLists.forEach((icon, index) => {
205+
icon.isActive = index === idx;
206+
});
207+
};
202208
203209
interface TabItem {
204210
key: string;
@@ -327,7 +333,6 @@ watch(
327333
.main-content {
328334
flex: 1;
329335
min-width: 0;
330-
height: 100vh;
331336
}
332337
.iframe-loader {
333338
display: block;

.vitepress/theme/style.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.opentiny-playground-layout {
2-
background-image: url('./images/bg-playground-home');
2+
background-image: url('./images/bg-playground-home.png');
3+
background-color: #f5f5f5;
34
}
45

56
.opentiny-playground-layout .is-home {
6-
background-image: url('./images/bg-playground-home');
7+
height: 800px;
78
}
89

910
.VPNav .container {
@@ -14,6 +15,14 @@
1415
max-width: 100%;
1516
}
1617

18+
.VPHome {
19+
margin-bottom: 0 !important;
20+
}
21+
22+
.Layout {
23+
min-height: calc(100vh - 64px) !important;
24+
}
25+
1726
/* ===== VitePress 导航覆盖 ===== */
1827
.VPNav .container {
1928
width: unset;
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)