+
@@ -34,10 +41,12 @@
name: "welcome",
data() {
return {
+ showContent: false,
newDateTime: '',
getWeekday: {0: '星期日', 1: '星期一', 2: '星期二', 3: '星期三',4: '星期四', 5: '星期五', 6: '星期六'},
user: {},
- menuList: []
+ menuList: [],
+ activeId: '',
}
},
created() {
@@ -54,6 +63,12 @@
let menu = this.$store.state.permission.sidebarRouters;
this.menuHandle(menu);
},
+ mounted() {
+ // 页面加载后自动触发动画
+ setTimeout(() => {
+ this.showContent = true;
+ }, 300);
+ },
methods: {
// 处理菜单
menuHandle(menu) {
@@ -84,7 +99,10 @@
this.$router.push({
path: menuLink.pageRoute
});
- }
+ },
+ tranformType(val) {
+ this.activeId = val.id;
+ },
}
}
@@ -96,45 +114,49 @@
/*overflow: auto;*/
display: flex;
flex-direction: column;
- padding: 20px;
+ /*padding: 20px;*/
margin-bottom: 20px;
}
/* 标题区域 */
.header-section {
- margin-bottom: 30px;
+ margin-bottom: 6%;
}
.main-title {
- font-size: 2.5rem;
- color: #BFBF00;
+ font-size: 1.3rem;
+ color: #fff;
font-weight: 600;
margin-bottom: 15px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
.welcome-text {
- font-size: 1.5rem;
- color: #666;
+ font-size: 1.2rem;
+ }
+ .contentPad {
+ padding: 0 20%;
}
-
/* 菜单区域 */
.menu-container {
display: flex;
flex-wrap: wrap;
justify-content: flex-start; /* 改为左对齐 */
- gap: 20px;
+ gap: 40px 20px;
/*max-width: 1200px;*/
margin: 0 auto;
}
.menu-item {
/*flex: 1 1 200px;*/
- flex: 0 0 calc(20% - 16px); /* 固定宽度,确保每行显示5个 */
- min-width: 200px;
- height: 70px;
+ flex: 0 0 calc(25% - 16px); /* 固定宽度,确保每行显示5个 */
+ /*min-width: 150px;*/
+ height: 100px;
cursor: pointer;
- transition: all 0.3s ease;
+ transition: none;
}
.menu-item-content {
@@ -143,27 +165,27 @@
display: flex;
justify-content: center;
align-items: center;
- background: linear-gradient(135deg, #02a7f099 0%, #0280c099 100%);
- color: #fff;
+ /*background: linear-gradient(135deg, #02a7f099 0%, #0280c099 100%);*/
+ color: #000;
border-radius: 10px;
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
- transition: all 0.3s ease;
+ /*box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);*/
padding: 10px;
text-align: center;
font-size: 1.1rem;
font-weight: 500;
+ transition: none;
}
.menu-item:hover .menu-item-content {
- transform: translateY(-5px);
- box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
- background: linear-gradient(135deg, #0280c099 0%, #026aa099 100%);
+ /*transform: translateY(-5px);*/
+ /*box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);*/
+ /*background: linear-gradient(135deg, #0280c099 0%, #026aa099 100%);*/
}
/* 响应式设计 - 媒体查询 */
@media (max-width: 1200px) {
.main-title {
- font-size: 2.2rem;
+ font-size: 1.2rem;
}
.welcome-text {
@@ -182,12 +204,8 @@
min-height: 100vh;
}
- .pt50 {
- padding-top: 30px;
- }
-
.main-title {
- font-size: 1.8rem;
+ font-size: 1.2rem;
}
.welcome-text {
@@ -195,11 +213,11 @@
}
.menu-container {
- gap: 15px;
+ gap: 35px 15px;
}
.menu-item {
- flex: 0 0 calc(33.333% - 10px); /* 平板每行3个 */
+ flex: 0 0 calc(25% - 12px); /* 平板每行4个 */
height: 60px;
}
@@ -213,20 +231,23 @@
padding: 10px;
}
- .pt50 {
- padding-top: 20px;
+ .contentPad {
+ padding: 0 10%;
}
.main-title {
- font-size: 1.5rem;
+ font-size: 1.2rem;
}
.welcome-text {
font-size: 1rem;
}
+ .animated-text {
+ width: 100%!important;
+ }
.menu-container {
- gap: 10px;
+ gap: 20px 10px;
justify-content: center; /* 小屏幕居中对齐 */
}
@@ -258,4 +279,28 @@
flex: 0 0 calc(16.666% - 17px); /* 大屏每行6个 */
}
}
+
+ /* 动画*/
+ .animated-text {
+ width: 550px;
+ position: relative;
+ }
+ /* 方法2: CSS类绑定样式 */
+ .class-method {
+ transform: translateX(-100%);
+ opacity: 0;
+ transition: all var(--animation-duration) linear;
+ }
+ .class-method.slide-in {
+ transform: translateX(0);
+ opacity: 1;
+ }
+ .activeTranFormRotate:hover {
+ transform: rotateY(180deg);
+ transition: transform 2s ease-in-out;
+ }
+ .textTranFormRotate:hover {
+ transform: rotateY(-180deg);
+ transition: transform 2s ease-in-out;
+ }