Skip to content

Commit 1356321

Browse files
authored
fix: Optimize tiny-engine official website UI (#79)
1 parent b77ac35 commit 1356321

File tree

7 files changed

+132
-34
lines changed

7 files changed

+132
-34
lines changed

packages/home/src/views/tiny-robot-home/FirstScreen.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ onUnmounted(() => {
131131
display: flex;
132132
justify-content: space-between;
133133
align-items: center;
134+
padding-top: 120px;
135+
padding-bottom: 130px;
134136
.first-screen-content {
135137
max-width: 682px;
136138
.first-screen-content-title {
@@ -212,8 +214,6 @@ onUnmounted(() => {
212214
}
213215
}
214216
.first-screen-image {
215-
margin-top: 120px;
216-
margin-bottom: 130px;
217217
animation: slideUpFadeIn 0.8s ease forwards;
218218
img {
219219
width: 100%;
@@ -228,6 +228,7 @@ onUnmounted(() => {
228228
background-image: url(@/assets/images/home/tinyrobot_top_mobile_banner.svg);
229229
.first-screen-wrap {
230230
flex-direction: column;
231+
padding: 0;
231232
.first-screen-content {
232233
margin-top: 50px;
233234
.first-screen-content-title {
Lines changed: 5 additions & 6 deletions
Loading
Lines changed: 84 additions & 14 deletions
Loading

packages/tiny-engine-portal/src/application/ApplicationVisit.vue

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
<template>
2-
<iframe class="tiny-engine-iframe" :src="tinyEngineUrl"></iframe>
2+
<div class="tiny-engine-app-visit">
3+
<div id="loading" class="tiny-engine-loading"></div>
4+
<iframe class="tiny-engine-iframe" :src="tinyEngineUrl"></iframe>
5+
</div>
36
</template>
47
<script>
58
import { TINY_ENGINE_DEFAULT_URL, TINY_ENGINE_DESIGNER_URL } from '../controller/utils'
69
import { useRoute } from 'vue-router'
7-
import { onMounted, onUnmounted } from 'vue'
10+
import { onMounted, onUnmounted, ref } from 'vue'
11+
import { Loading } from '@opentiny/vue'
812
913
export default {
1014
setup() {
1115
const route = useRoute()
1216
const tinyEngineUrl = route.name === 'applicationVisit' ? TINY_ENGINE_DEFAULT_URL : TINY_ENGINE_DESIGNER_URL
17+
18+
const loadingInstance = ref(null)
1319
//回调函数
14-
const openAppNewTab = ( event ) => {
15-
if(event.data.type === 'openNewTab') {
20+
const openAppNewTab = (event) => {
21+
if (event.data.type === 'openNewTab') {
1622
const href = window.location.href.split('?')[0]
1723
const searchParams = event.data.url.split('?')[1]
1824
window.open(`${href}?${searchParams}`)
1925
}
2026
}
21-
window.addEventListener("message", openAppNewTab, false)
27+
window.addEventListener('message', openAppNewTab, false)
2228
2329
onMounted(() => {
2430
const url = new URL(window.location.href)
@@ -27,6 +33,15 @@ export default {
2733
const iframe = document.querySelector('iframe')
2834
iframe.src = `${TINY_ENGINE_DESIGNER_URL}?${type}`
2935
}
36+
loadingInstance.value = Loading.service({
37+
text: '加载中...',
38+
target: document.getElementById('loading'),
39+
size: 'large'
40+
})
41+
document.querySelector('iframe').onload = function () {
42+
document.querySelector('iframe').style.display = 'block'
43+
document.getElementById('loading').style.display = 'none'
44+
}
3045
})
3146
3247
onUnmounted(() => {
@@ -39,9 +54,16 @@ export default {
3954
}
4055
</script>
4156
<style lang="less">
57+
.tiny-engine-app-visit{
58+
height: 100vh;
59+
}
4260
.tiny-engine-iframe {
4361
width: 100%;
4462
height: 99%;
4563
border: none;
4664
}
65+
.tiny-engine-loading {
66+
display: block;
67+
height: 100vh;
68+
}
4769
</style>

packages/tiny-engine-portal/src/help/home/Main.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<div class="video-overlay-play">
5858
<div class="video-overlay-title">{{ i.videoTitle }}</div>
5959
<div class="video-overlay-bottom-start">
60-
<img :src="`/img/help/playing${(index % 3) + 1}.svg`" alt="" />
60+
<img :src="`${state.imgPre}img/help/playing${(index % 3) + 1}.svg`" alt="" />
6161
</div>
6262
</div>
6363
</div>
@@ -312,6 +312,7 @@ export default {
312312
width: 450px;
313313
height: 280px;
314314
cursor: pointer;
315+
position: relative;
315316
background-repeat: no-repeat;
316317
background-size: cover;
317318
background-position: center center;
@@ -326,7 +327,6 @@ export default {
326327
}
327328
}
328329
.video-overlay {
329-
position: relative;
330330
border-radius: 16px;
331331
padding: 24px 32px;
332332
.video-overlay-type {
@@ -348,6 +348,10 @@ export default {
348348
}
349349
.video-overlay-bottom-start {
350350
display: none;
351+
position: absolute;
352+
top: 50%;
353+
left: 50%;
354+
transform: translate(-50%, -50%);
351355
width: 60px;
352356
height: 60px;
353357
backdrop-filter: blur(20px);
@@ -521,7 +525,6 @@ export default {
521525
border-radius: 12px;
522526
}
523527
.video-overlay {
524-
position: relative;
525528
border-radius: 16px;
526529
padding: 17px 22px;
527530
.video-overlay-play {
@@ -538,6 +541,9 @@ export default {
538541
width: 42px;
539542
height: 42px;
540543
display: block;
544+
img {
545+
animation: none;
546+
}
541547
}
542548
}
543549
}

packages/tiny-engine-portal/src/home/HomeCoreScenarios.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export default {
175175
right: -50%;
176176
top: 40%;
177177
width: 120px;
178-
height: 66px;
178+
height: 85px;
179179
}
180180
}
181181
}

packages/tiny-engine-portal/src/home/HomeTop.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export default {
104104
}
105105
.home-top-banner {
106106
width: 100%;
107-
padding-top: 80px;
108-
padding-bottom: 80px;
107+
padding-top: 100px;
108+
padding-bottom: 100px;
109109
box-sizing: border-box;
110110
margin: 0 auto;
111111
position: relative;
@@ -133,7 +133,7 @@ export default {
133133
}
134134
.description {
135135
margin-top: 28px;
136-
font-size: 20px;
136+
font-size: 18px;
137137
color: #808080;
138138
line-height: 32px;
139139
}

0 commit comments

Comments
 (0)