hookehuyr

✨ feat(首页入口背景): 测试动画效果

...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" /> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
6 <title></title> 6 <title></title>
7 + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.compat.css" />
7 </head> 8 </head>
8 <body> 9 <body>
9 <div id="app"></div> 10 <div id="app"></div>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
8 "name": "tjws", 8 "name": "tjws",
9 "version": "1.0.0", 9 "version": "1.0.0",
10 "dependencies": { 10 "dependencies": {
11 + "animate.css": "^4.1.1",
11 "html2canvas": "^1.4.1", 12 "html2canvas": "^1.4.1",
12 "jquery": "^3.6.0", 13 "jquery": "^3.6.0",
13 "js-cookie": "^3.0.1", 14 "js-cookie": "^3.0.1",
...@@ -286,6 +287,11 @@ ...@@ -286,6 +287,11 @@
286 "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==", 287 "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==",
287 "license": "MIT" 288 "license": "MIT"
288 }, 289 },
290 + "node_modules/animate.css": {
291 + "version": "4.1.1",
292 + "resolved": "https://registry.npmjs.org/animate.css/-/animate.css-4.1.1.tgz",
293 + "integrity": "sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ=="
294 + },
289 "node_modules/ansi-styles": { 295 "node_modules/ansi-styles": {
290 "version": "3.2.1", 296 "version": "3.2.1",
291 "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 297 "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
...@@ -1933,6 +1939,11 @@ ...@@ -1933,6 +1939,11 @@
1933 "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz", 1939 "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz",
1934 "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==" 1940 "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ=="
1935 }, 1941 },
1942 + "animate.css": {
1943 + "version": "4.1.1",
1944 + "resolved": "https://registry.npmjs.org/animate.css/-/animate.css-4.1.1.tgz",
1945 + "integrity": "sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ=="
1946 + },
1936 "ansi-styles": { 1947 "ansi-styles": {
1937 "version": "3.2.1", 1948 "version": "3.2.1",
1938 "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 1949 "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
14 "publish": "npm run build && npm run rm && npm run mv && npm run git && npm run update" 14 "publish": "npm run build && npm run rm && npm run mv && npm run git && npm run update"
15 }, 15 },
16 "dependencies": { 16 "dependencies": {
17 + "animate.css": "^4.1.1",
17 "html2canvas": "^1.4.1", 18 "html2canvas": "^1.4.1",
18 "jquery": "^3.6.0", 19 "jquery": "^3.6.0",
19 "js-cookie": "^3.0.1", 20 "js-cookie": "^3.0.1",
......
1 <template> 1 <template>
2 <div class="client-index-page"> 2 <div class="client-index-page">
3 <div class="cloud-bg"></div> 3 <div class="cloud-bg"></div>
4 + <!-- TAG: animate 动画 -->
5 + <!-- <transition name="fade" enter-active-class="animated animate__swing" leave-active-class="animated animate__swing">
6 + <van-icon v-if="show" :name="icon_subscribed" size="5rem" style="position: absolute; top: 50%;" />
7 + </transition> -->
4 </div> 8 </div>
5 -
6 <div class="entry-wrapper"> 9 <div class="entry-wrapper">
7 - <p style="color: #B8B8B8; margin: 1rem; margin-bottom: 0;">请选择您的身份</p> 10 + <p class="text">请选择您的身份</p>
8 <div class="control"> 11 <div class="control">
9 <div class="plain"> 12 <div class="plain">
10 <my-button type="custom" :custom-style="styleObject1" @on-click="goVisit">访客</my-button> 13 <my-button type="custom" :custom-style="styleObject1" @on-click="goVisit">访客</my-button>
...@@ -18,13 +21,15 @@ ...@@ -18,13 +21,15 @@
18 21
19 <script setup> 22 <script setup>
20 import Cookies from 'js-cookie' 23 import Cookies from 'js-cookie'
24 +import 'animate.css';
25 +import icon_subscribed from '@images/icon-dingyue01@2x.png'
21 26
22 import MyButton from '@/components/MyButton/index.vue' 27 import MyButton from '@/components/MyButton/index.vue'
23 28
24 import $ from 'jquery'; 29 import $ from 'jquery';
25 -import { useRoute, useRouter } from 'vue-router' 30 +import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'
26 import { Toast } from 'vant'; 31 import { Toast } from 'vant';
27 -import { nextTick, onMounted, reactive } from 'vue' 32 +import { nextTick, onMounted, reactive, ref } from 'vue'
28 const $route = useRoute(); 33 const $route = useRoute();
29 const $router = useRouter(); 34 const $router = useRouter();
30 35
...@@ -57,6 +62,15 @@ onMounted (() => { ...@@ -57,6 +62,15 @@ onMounted (() => {
57 // 背景颜色全屏 62 // 背景颜色全屏
58 $('.client-index-page').height($(document).height()); 63 $('.client-index-page').height($(document).height());
59 }) 64 })
65 +
66 +// TEMP:临时测试动画效果
67 +// const show = ref(true);
68 +// const interval = setInterval(() => { // 图标动画效果
69 +// show.value = !show.value
70 +// }, 1000);
71 +// onBeforeRouteLeave(() => {
72 +// clearInterval(interval); // 清除调用
73 +// })
60 </script> 74 </script>
61 75
62 <script> 76 <script>
...@@ -91,6 +105,11 @@ export default { ...@@ -91,6 +105,11 @@ export default {
91 position: absolute; 105 position: absolute;
92 bottom: 0; 106 bottom: 0;
93 width: 100%; 107 width: 100%;
108 + .text {
109 + color: #B8B8B8;
110 + margin: 1rem;
111 + margin-bottom: 0;
112 + }
94 .control { 113 .control {
95 margin: 1rem; 114 margin: 1rem;
96 margin-top: 0.5rem; 115 margin-top: 0.5rem;
......
...@@ -175,6 +175,11 @@ ...@@ -175,6 +175,11 @@
175 "resolved" "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz" 175 "resolved" "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz"
176 "version" "3.2.31" 176 "version" "3.2.31"
177 177
178 +"animate.css@^4.1.1":
179 + "integrity" "sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ=="
180 + "resolved" "https://registry.npmjs.org/animate.css/-/animate.css-4.1.1.tgz"
181 + "version" "4.1.1"
182 +
178 "ansi-styles@^3.2.1": 183 "ansi-styles@^3.2.1":
179 "integrity" "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==" 184 "integrity" "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="
180 "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" 185 "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz"
......