当前位置: 首页 > wzjs >正文

网站定制建设哪里好自媒体怎么赚钱

网站定制建设哪里好,自媒体怎么赚钱,广州小程序开发公司哪家好,wordpress建立视频网站书接上回 上一次在文章中,我们讲解了Vue前端的容器搭建,在本文中,我们将继续细化设计,逐步完成一个较为完善的导航栏。 组件引用 组件引用是为了在较大规模开发时避免代码塞在一个文件里边,增加可读性。 在引用的主…

书接上回

上一次在文章中,我们讲解了Vue前端的容器搭建,在本文中,我们将继续细化设计,逐步完成一个较为完善的导航栏。

组件引用

组件引用是为了在较大规模开发时避免代码塞在一个文件里边,增加可读性。

在引用的主文件里的 js部分import,然后直接在 tmplate部分调用即可,代码如下

<template><div><navigator></navigator></div>
</template><style scoped></style><script setup>
// 导入组件
import navigator from "@/page/navigator/navigator.vue"
</script>

在需要被调用的组件中,记得一定要有<script setup>部分

<template><div class="navigator"></div>
</template><style scoped></style><script setup></script>

 调试浏览器,发现调用成功

导航栏框架搭建

这里提供一个简单的导航栏框架设计,本文将详细讲解微调过程。

先展示初版效果

提几个要点:

  1. 导航栏可以做个下端阴影,这样就算全白也会有区分度,看起来比较舒服
  2. 搜索框的border可以粗一点弄成圆的,用的element-plus组件所以需要使用::deep贯穿

<template><div class="navigator"><div class="logo"><img src="../../asset/board/logo.png" style="height:400%;margin-top: -21%;margin-left: 15%;user-select: none;"></div><div class="search"><el-inputv-model="keyword"placeholder="请输入搜索内容"suffix-icon="Search"class="round-input"style="width:100%; height:60%; margin-top:3%"></el-input></div><div class="selectionSet"><el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-top: 3%;margin-left: 10%"><el-tab-pane label="首页" name="first">    </el-tab-pane><el-tab-pane label="资料库" name="second">  </el-tab-pane><el-tab-pane label="讨论区" name="third">   </el-tab-pane><el-tab-pane label="收藏夹" name="fourth">  </el-tab-pane></el-tabs><img src="../../asset/board/碳治郎1.png"style="height:90%;margin-left: 10%;margin-top: 0.5%"></div></div>
</template><style scoped>
.navigator {display: flex;align-items: center;/* background-color: #d5e4f4;*/background-color: #ffffff;height: 9%;/* 添加底部阴影效果 */box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}.logo {width: 30%;height: 100%;display: flex;padding-left: 3%;
}.search {display: flex;width: 30%;height: 100%;
}:deep(.round-input .el-input__wrapper) {border-radius: 20px !important;background-color: #FFFFFF;box-shadow: 0 0 0 1.5px rgb(210, 203, 241) !important;
}.selectionSet {display: flex;width: 40%;height: 100%;
}:deep(.el-tabs__item) {color: #000000;font-size: 25px;transition: color 0.3s ease;
}::v-deep .el-tabs__active-bar {background-color: #064fe1 !important;
}:deep(.el-tabs__nav-wrap::after) {position: static !important;
}
</style><script setup>
import { ref } from 'vue';const keyword = ref('');
const activeName = ref('first');const handleClick = (tab) => {console.log(' 当前选中标签:', tab.name);
};
</script>

图片文字取消点击光标闪烁

比如点击右上tab,发现光标是闪烁的,看的很不舒服,这里可以内联为元素设置一下

之后就不可选中了,图像貌似不可以这样解决,可以给图像设计一个点击跳转或点击放大,就不会出现光标闪烁了

user-select: none

输入框偏斜

如题所示,解决方案为在外边包的div上设置user-select:none ;这个偏斜实际上是选中了这个div

输入框悬停和聚焦流光动画

以下展示为全代码,方便CV

<template><div class="navigator"><div class="logo"><img src="../../asset/board/logo.png" style="height:100%;margin-left: 20%;"></div><div class="search"><el-inputv-model="keyword"placeholder="                                     biuuuu~ 灵 光 乍 现"suffix-icon="Search":class="{ 'round-input':true,'animated-placeholder': isSearchHover,'is-focused': isFocused  }"style="width:100%; height:60%; margin-top:3%"@focus="handleFocus"@blur="handleBlur"></el-input></div><div class="selectionSet"><el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-top: 3%;margin-left: 13%"><el-tab-pane label="首页" name="first">    </el-tab-pane><el-tab-pane label="资料库" name="second">  </el-tab-pane><el-tab-pane label="讨论区" name="third">   </el-tab-pane><el-tab-pane label="收藏夹" name="fourth">  </el-tab-pane></el-tabs><img src="../../asset/board/碳治郎1.png"style="height:90%;margin-left: 10%;margin-top: 0.5%;user-select: none;"></div></div>
</template><style scoped>
.navigator {display: flex;align-items: center;background-color: #ffffff;height: 9%;/* 添加底部阴影效果 */box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}.logo {width: 30%;height: 100%;display: flex;padding-left: 3%;
}.search {display: flex;width: 30%;height: 100%;user-select: none;
}:deep(.round-input .el-input__wrapper) {border-radius: 20px !important;background-color: #FFFFFF;box-shadow: 0 0 0 1.5px rgb(210, 203, 241) !important;
}.selectionSet {display: flex;width: 40%;height: 100%;
}:deep(.el-tabs__item) {color: #000000;font-size: 20px;transition: color 0.4s ease;user-select: none;
}::v-deep .el-tabs__active-bar {background-color: rgb(2, 90, 255) !important;
}:deep(.el-tabs__nav-wrap::after) {position: static !important;
}@keyframes placeholderSlide {0% { transform: translateX(0); opacity: 0.6 }100% { transform: translateX(-10px); opacity: 0.2 }
}:deep(.round-input .el-input__wrapper) {transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* 平滑过渡 */
}/* 悬停状态增强 */
:deep(.round-input:hover .el-input__wrapper) {box-shadow: 0 0 0 2px rgba(2, 90, 255, 0.3) !important;transform: scale(1.02);
}/* 聚焦状态动画 */
:deep(.round-input.is-focused  .el-input__wrapper) {box-shadow: 0 0 0 3px rgba(2, 90, 255, 0.2) !important;background-color: #f8f9fa;
}/* 动态placeholder动画 */
.animated-placeholder::placeholder {font-size: 14px;transition: all 0.3s ease;text-align: center;
}/* 悬停时placeholder动画 */
:deep(.round-input:hover) .animated-placeholder::placeholder {animation: placeholderSlide 0.8s infinite alternate;text-align: left;padding-left: 28px;
}/* 聚焦时placeholder消失动画 */
:deep(.round-input:focus-within) .animated-placeholder::placeholder {opacity: 0;transform: translateX(20px);transition: all 0.2s ease;
}
@keyframes streaming-light {0% { background-position: 0% 50%; }50% { background-position: 100% 50%; }100% { background-position: 0% 50%; }
}/* 流光容器 */
:deep(.round-input) .el-input__wrapper {position: relative;overflow: hidden;transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}/* 流光伪元素 */
:deep(.round-input) .el-input__wrapper::after {content: '';position: absolute;top: -2px;left: -2px;right: -2px;bottom: -2px;background: linear-gradient(45deg,rgba(2,90,255,0.1) 0%,rgba(255,255,255,0.8) 25%,rgba(2,90,255,0.3) 50%,rgba(255,255,255,0.8) 75%,rgba(2,90,255,0.1) 100%);background-size: 400% 400%;opacity: 0;z-index: 1;transition: opacity 0.8s ease;pointer-events: none;border-radius: 22px;
}/* 触发动画的条件 */
:deep(.round-input.is-focused)  .el-input__wrapper::after,
:deep(.round-input:hover) .el-input__wrapper::after {opacity: 1;animation: streaming-light 8s linear infinite;
}/* 输入框内容层提升层级 */
:deep(.el-input__inner) {position: relative;z-index: 2;background: transparent !important;
}
</style><script setup>
import { ref } from 'vue';let isSearchHover=ref(false);
let isFocus=ref(false);
const keyword = ref('');
const activeName = ref('first');const isFocused = ref(false);const handleFocus = () => {isFocused.value  = true;
};
const handleBlur = () =>
{isFocused.value  = false;
};
</script>

总结

本文中实现了一个前端代码比较完善的Nav开发,展示了各种可能遇到的问题,希望能对读者有所帮助

http://www.dtcms.com/wzjs/157680.html

相关文章:

  • 盘州网站建设深圳网络营销推广服务
  • 博海博海网站建设深圳快速seo排名优化
  • 新浪云主机上安装wordpress主题东莞百度seo在哪里
  • 网站维护费怎么做会计分录广告推送平台
  • 电子商务网站开发课程设计湖南好搜公司seo
  • 格瑞特网站建设店铺推广软文案例
  • 广州做网站的公司关键词排名优化公司
  • 如何建设网站脱颖而出seo网络优化培训
  • 直销网站有没有适合在家做的手工活直通车推广怎么收费
  • mcms怎么做网站常德seo
  • 网站空间在哪买好免费python在线网站
  • 东营组建网站互动营销策略
  • 一起做网店网站入驻收费成都seo学徒
  • python做的网站有哪些管理人员课程培训
  • 哪个网站做轴承外贸的人比较多如何做网站营销推广
  • 湖北省建设厅建筑资料官方网站淄博网站制作
  • 网站建设易网推广公司品牌
  • 做字幕模板下载网站有哪些seo是什么意思电商
  • 北湖建设局网站广州seo关键字推广
  • 德洲网站建设sem账户托管
  • 做网站能接到模具单吗百度快照怎么用
  • 益阳网站建设找相似图片 识别
  • flash 做网站一篇好的营销软文
  • 手机网站建设口碑好深圳最新政策消息
  • 网站上传源码后怎么弄微信社群营销
  • 福建省网站建设方案书网站建设软件
  • 网站构建是什么seo推广服务
  • 网站域名查询注册百度指数批量获取
  • 开源免费商用cms优化大师使用方法
  • 禁止 wordpress ajax江苏网站seo设计