|
@@ -14,7 +14,8 @@
|
14
|
14
|
播撒和平的种子。<br>
|
15
|
15
|
近20万枚紫金草徽章佩戴在了人们的心口。
|
16
|
16
|
</p>
|
17
|
|
- <div class="map-img" ref="mapRef" />
|
|
17
|
+ <!-- <div class="map-img" ref="mapRef" /> -->
|
|
18
|
+ <img class="map-img" src="/images/pg2/map.gif" alt="">
|
18
|
19
|
</div>
|
19
|
20
|
</div>
|
20
|
21
|
</Modal>
|
|
@@ -28,44 +29,44 @@
|
28
|
29
|
const loaded = ref(false);
|
29
|
30
|
const dep = ref(true);
|
30
|
31
|
|
31
|
|
- const callback = (t) => {
|
32
|
|
- const maxHeight = 27837
|
33
|
|
- const rawHeight = 489
|
34
|
|
- const img = mapRef.value
|
35
|
|
- const height = img.offsetHeight
|
36
|
|
- const pos = t * rawHeight
|
|
32
|
+ // const callback = (t) => {
|
|
33
|
+ // const maxHeight = 27837
|
|
34
|
+ // const rawHeight = 489
|
|
35
|
+ // const img = mapRef.value
|
|
36
|
+ // const height = img.offsetHeight
|
|
37
|
+ // const pos = t * rawHeight
|
37
|
38
|
|
38
|
|
- const backgroundPosition = `0 -${(pos * height) / rawHeight}px`
|
39
|
|
- img.style.backgroundPosition = backgroundPosition
|
|
39
|
+ // const backgroundPosition = `0 -${(pos * height) / rawHeight}px`
|
|
40
|
+ // img.style.backgroundPosition = backgroundPosition
|
40
|
41
|
|
41
|
|
- if (pos >= maxHeight - rawHeight) {
|
42
|
|
- return true
|
43
|
|
- }
|
44
|
|
- }
|
|
42
|
+ // if (pos >= maxHeight - rawHeight) {
|
|
43
|
+ // return true
|
|
44
|
+ // }
|
|
45
|
+ // }
|
45
|
46
|
|
46
|
47
|
onMounted(() => {
|
47
|
48
|
loaded.value = true;
|
48
|
49
|
});
|
49
|
50
|
|
50
|
|
- let times = 0;
|
51
|
|
- let execed = false;
|
52
|
|
- watch([loaded, dep], (values) => {
|
53
|
|
- console.log(values)
|
54
|
|
- if (execed) return;
|
|
51
|
+ // let times = 0;
|
|
52
|
+ // let execed = false;
|
|
53
|
+ // watch([loaded, dep], (values) => {
|
|
54
|
+ // console.log(values)
|
|
55
|
+ // if (execed) return;
|
55
|
56
|
|
56
|
|
- if (values[0] && values[1]) {
|
57
|
|
- execed = true;
|
|
57
|
+ // if (values[0] && values[1]) {
|
|
58
|
+ // execed = true;
|
58
|
59
|
|
59
|
|
- const i = setInterval(() => {
|
60
|
|
- const isOver = callback(times);
|
61
|
|
- times += 1;
|
|
60
|
+ // const i = setInterval(() => {
|
|
61
|
+ // const isOver = callback(times);
|
|
62
|
+ // times += 1;
|
62
|
63
|
|
63
|
|
- if (isOver) {
|
64
|
|
- clearInterval(i);
|
65
|
|
- }
|
66
|
|
- }, 2000 / 16);
|
67
|
|
- }
|
68
|
|
- });
|
|
64
|
+ // if (isOver) {
|
|
65
|
+ // clearInterval(i);
|
|
66
|
+ // }
|
|
67
|
+ // }, 2000 / 16);
|
|
68
|
+ // }
|
|
69
|
+ // });
|
69
|
70
|
</script>
|
70
|
71
|
|
71
|
72
|
<style lang="less" scoped>
|