|
@@ -2,19 +2,20 @@
|
2
|
2
|
<div class="page pg-bg bk-pg2">
|
3
|
3
|
<div class="content">
|
4
|
4
|
<div class="header-img">
|
5
|
|
- <img src="/images/bk1/pg2/header.png" alt="">
|
|
5
|
+ <img src="/images/bk1/pg2/header.png" alt />
|
6
|
6
|
<div ref="flowerRef" class="flower" />
|
7
|
7
|
</div>
|
8
|
|
- <br>
|
9
|
|
- <img class="badge-img" src="/images/bk1/pg2/badge.png" alt="">
|
|
8
|
+ <br />
|
|
9
|
+ <img class="badge-img" src="/images/bk1/pg2/badge.png" alt />
|
10
|
10
|
|
11
|
11
|
<p class="txt animate__animated animate__fadeIn">
|
12
|
|
- 2014年,<br>
|
13
|
|
- 南京广电集团以“紫金草”为原型,<br>
|
14
|
|
- 制作紫金草徽章发放给市民。<br>
|
15
|
|
- 9年来,20万人加入“紫金草行动”,<br>
|
16
|
|
- 把紫金草徽章佩戴在离心脏最近的地方。<br>
|
17
|
|
- 在2亿人心中,和平的愿景被播撒。<br>
|
|
12
|
+ 2014年,
|
|
13
|
+ <br />南京广电集团以“紫金草”为原型,
|
|
14
|
+ <br />制作紫金草徽章发放给市民。
|
|
15
|
+ <br />9年来,20万人加入“紫金草行动”,
|
|
16
|
+ <br />把紫金草徽章佩戴在离心脏最近的地方。
|
|
17
|
+ <br />在2亿人心中,和平的愿景被播撒。
|
|
18
|
+ <br />
|
18
|
19
|
</p>
|
19
|
20
|
</div>
|
20
|
21
|
|
|
@@ -24,35 +25,34 @@
|
24
|
25
|
</template>
|
25
|
26
|
|
26
|
27
|
<script setup>
|
27
|
|
- import { computed, onMounted, ref } from 'vue';
|
28
|
|
- import Dot from './Dot.vue';
|
29
|
|
- import FlipIcon from './FlipIcon.vue';
|
30
|
|
- import useSerial from './useSerial';
|
|
28
|
+import { computed, onMounted, ref } from 'vue'
|
|
29
|
+import Dot from './Dot.vue'
|
|
30
|
+import FlipIcon from './FlipIcon.vue'
|
|
31
|
+import useSerial from './useSerial'
|
31
|
32
|
|
32
|
|
- const props = defineProps({
|
33
|
|
- active: Boolean,
|
34
|
|
- });
|
|
33
|
+const props = defineProps({
|
|
34
|
+ active: Boolean
|
|
35
|
+})
|
35
|
36
|
|
36
|
|
- const flowerRef = ref();
|
37
|
|
- const ready = computed(() => props.active);
|
|
37
|
+const flowerRef = ref()
|
|
38
|
+const ready = computed(() => props.active)
|
38
|
39
|
|
39
|
|
- console.log('-----<>', ready);
|
40
|
|
-
|
41
|
|
- useSerial((t) => {
|
42
|
|
- const maxHeight = 11200;
|
43
|
|
- const rawHeight = 700;
|
44
|
|
- const flower = flowerRef.value;
|
45
|
|
- const height = flower.offsetHeight;
|
46
|
|
- const pos = t * rawHeight;
|
|
40
|
+console.log('-----<>', ready)
|
47
|
41
|
|
48
|
|
- const backgroundPosition = `0 -${pos * height / rawHeight}px`;
|
49
|
|
- flower.style.backgroundPosition = backgroundPosition;
|
|
42
|
+useSerial((t) => {
|
|
43
|
+ const maxHeight = 11200
|
|
44
|
+ const rawHeight = 700
|
|
45
|
+ const flower = flowerRef.value
|
|
46
|
+ const height = flower.offsetHeight
|
|
47
|
+ const pos = t * rawHeight
|
50
|
48
|
|
51
|
|
- if (pos >= (maxHeight - rawHeight)) {
|
52
|
|
- return true;
|
53
|
|
- }
|
54
|
|
- }, ready);
|
|
49
|
+ const backgroundPosition = `0 -${(pos * height) / rawHeight}px`
|
|
50
|
+ flower.style.backgroundPosition = backgroundPosition
|
55
|
51
|
|
|
52
|
+ if (pos >= maxHeight - rawHeight) {
|
|
53
|
+ return true
|
|
54
|
+ }
|
|
55
|
+}, ready)
|
56
|
56
|
</script>
|
57
|
57
|
|
58
|
58
|
<style lang="less" scoped>
|
|
@@ -77,7 +77,7 @@
|
77
|
77
|
left: calc(50% - 20vw);
|
78
|
78
|
top: 0;
|
79
|
79
|
background-image: url(/images/bk1/flower.png);
|
80
|
|
- background-repeat:no-repeat;
|
|
80
|
+ background-repeat: no-repeat;
|
81
|
81
|
background-position: 0 0;
|
82
|
82
|
background-size: 100% auto;
|
83
|
83
|
}
|