fangmingyue 2 年之前
父節點
當前提交
ab0c6d6bb9
共有 2 個文件被更改,包括 71 次插入41 次删除
  1. 33
    33
      src/pages/bk1/pg2.vue
  2. 38
    8
      src/pages/pg2-2/index.vue

+ 33
- 33
src/pages/bk1/pg2.vue 查看文件

@@ -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
       }

+ 38
- 8
src/pages/pg2-2/index.vue 查看文件

@@ -8,11 +8,12 @@
8 8
         85年前,
9 9
         <br />日本侵略者制造了惨绝人寰的南京大屠杀,
10 10
         <br />30多万生灵涂炭。
11
+        <br />战后的紫金山废墟下,片片紫色小花密密开放。
11 12
         <br />
12 13
       </p>
13 14
     </div>
14 15
     <div class="bk-pd content">
15
-      <img src="/images/pg2-2/废墟.png" />
16
+      <img class="ruins-img" src="/images/pg2-2/废墟.png" />
16 17
     </div>
17 18
     <div class="bk-pd content">
18 19
       <p class="txt">
@@ -21,6 +22,7 @@
21 22
         <br />并取名“紫金草”。
22 23
         <br />在他的眼中,当年的紫金山上,
23 24
         <br />每一朵花就是一个在战争中丧生的灵魂。
25
+        <br />
24 26
         <br />此后几十年,这名军医和家人
25 27
         <br />在各地播种紫金草悼念亡灵,
26 28
         <br />反对战争,呼吁和平。
@@ -28,7 +30,7 @@
28 30
       </p>
29 31
     </div>
30 32
     <div class="bk-pd content">
31
-      <img src="/images/pg2-2/色相饱和度2拷贝.png" />
33
+      <img class="cp1-img" src="/images/pg2-2/色相饱和度2拷贝.png" />
32 34
     </div>
33 35
     <div class="bk-pd content">
34 36
       <p class="txt">
@@ -37,6 +39,7 @@
37 39
         <br />蕴含着无穷的草根力量,
38 40
         <br />寄托了对战争的反省和对和平的祈愿。
39 41
         <br />“紫金草行动”由此而来。
42
+        <br />
40 43
         <br />小小紫金草,悠悠寄哀思。
41 44
         <br />让和平中长大的年轻人保持“痛”感,
42 45
         <br />让更多的人主动追问、不断提起那段历史,
@@ -46,7 +49,7 @@
46 49
       </p>
47 50
     </div>
48 51
     <div class="bk-pd content">
49
-      <img src="/images/pg2-2/Flag_mockup_拷贝.png" />
52
+      <img class="cp2-img" src="/images/pg2-2/Flag_mockup_拷贝.png" />
50 53
     </div>
51 54
     <div class="bk-pd content">
52 55
       <p class="txt">
@@ -61,19 +64,46 @@
61 64
       </p>
62 65
     </div>
63 66
     <div class="bk-pd content">
64
-      <img src="/images/pg2-2/紫金草徽章拷贝3.png" />
67
+      <img class="cp3-img" src="/images/pg2-2/紫金草徽章拷贝3.png" />
65 68
     </div>
66 69
   </div>
67 70
 </template>
68 71
 
69 72
 <style lang="less" scoped>
70
-.bk-pg {
73
+.pg2-2 {
71 74
   .content {
72 75
     text-align: center;
76
+    .head-img {
77
+      margin: 1em auto;
78
+      width: 74%;
79
+      display: inline-block;
80
+    }
73 81
   }
74
-  .head-img {
75
-    width: 24vw;
76
-    height: 24vw;
82
+  .content {
83
+    .ruins-img {
84
+      width: 84%;
85
+      display: inline-block;
86
+    }
87
+  }
88
+  .content {
89
+    .cp1-img {
90
+      width: 20%;
91
+      height: 50%;
92
+      display: inline-block;
93
+    }
94
+  }
95
+  .content {
96
+    .cp2-img {
97
+      width: 84%;
98
+      display: inline-block;
99
+    }
100
+  }
101
+  .content {
102
+    .cp3-img {
103
+      margin: 1em auto;
104
+      width: 38%;
105
+      display: inline-block;
106
+    }
77 107
   }
78 108
 }
79 109
 .txt {