喜马拉雅项目调整

文章目录

1 频道部分

下标旋转

python 复制代码
.x-header-nav .nav-item:hover .icon-down {
  transform: rotate(-180deg);
}

频道列表平移

python 复制代码
.channel-layer {
  position: absolute;
  top: 60px;
  left: 50%;
  z-index: -2;
  width: 1080px;
  height: 120px;
  padding: 10px;
  margin-left: -540px;
  color: #72727b;
  background-color: #f5f5f5;
  border: 1px solid #e4e4e4;
  border-top: none;
  transition: all 0.5s;
  transform: translateY(-120px);
}

/* TODO 2. 弹窗频道 */
.x-header-nav .nav-item:hover .channel-layer {
  transform: translateY(0);
}
  • transform: translateY(-120px); 将元素向上移动 120 像素。
  • transform: translateY(0); 将元素移动回到原始位置。

2 渐变按钮

搜索放大镜

python 复制代码
/* TODO 3. 渐变按钮 */
.x-header-search form .btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #f86442;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
  background-image: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.3),
    #f86442
  );
}

登录按钮

python 复制代码
/* TODO 7. 渐变按钮 */
.card .card-info .login {
  padding: 3px 34px;
  color: #fff;
  background-color: #ff7251;
  border-radius: 30px;
  box-shadow: 0 4px 8px 0 rgb(252 88 50 / 50%);
  background-image: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.2),
    #ff7251
  );
}

径向渐变

python 复制代码
/* TODO 8. 径向渐变 */
.download .dl .dl-btn {
  width: 68px;
  height: 34px;
  line-height: 34px;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  background-image: radial-gradient(
    50px at 10px 10px,
    rgba(255, 255, 255, 0.5),
    transparent
  );
}

3 左右图片缩小

左边

python 复制代码
/* TODO 4. 摆放图片 */
.banner .banner-list .banner-item.left {
  z-index: 0;
  transform: translate(-160px) scale(0.8);
  transform-origin: left center;
}

右边

python 复制代码
.banner .banner-list .banner-item.right {
  z-index: 0;
  transform: translate(160px) scale(0.8);
  transform-origin: right center;
}

4 猜你喜欢区域

播放按钮和遮罩

python 复制代码
/* TODO 5. 播放按钮和遮罩 */
.album-item .album-item-box::after {
  position: absolute;
  left: 0;
  top: 0;
  /*伪元素搭配使用*/
  content: '';
  width: 100%;
  height: 100%;
  /*既有背景图又有阴影*/
  background: rgba(0,0,0,.5) url(../assets/play.png) no-repeat center / 20px;
  opacity: 0;
  transition: all .5s;
}

.album-item .album-item-box:hover::after {
  opacity: 1;
  /*把背景图方法到50px*/
  background-size: 50px;
}

图片缩放

python 复制代码
/* TODO 6. 图片缩放 */
.album-item .album-item-box:hover img {
  transform: scale(1.1);
}
相关推荐
敏编程4 分钟前
一天一个Python库:soupsieve - CSS 选择器在 Beautiful Soup 中的力量
开发语言·css·python
树獭非懒5 分钟前
Google A2UI:让 AI 智能体「开口说界面」
前端·人工智能·后端
Wect9 分钟前
LeetCode 4. 寻找两个正序数组的中位数:二分优化思路详解
前端·算法·typescript
李剑一9 分钟前
纯干货,前端字体极致优化!谷歌、阿里、字节、腾讯都在用的终极解决方案,Vue3 + Vite 直接抄,页面提速不妥协!
前端·vue.js·面试
memeflyfly12 分钟前
Vercel 自动部署完全指南:从配置到问题排查
前端·前端工程化
星辰徐哥17 分钟前
C语言Web开发:CGI、FastCGI、Nginx深度解析
c语言·前端·nginx
暗不需求24 分钟前
JavaScript 面向对象探秘:从构造函数到原型链的优雅继承
前端·javascript
圣光SG27 分钟前
奶茶店网页(纯HTML和CSS)
前端·css·html
kyriewen27 分钟前
你还在给每个图片父元素加类名?CSS :has() 让选择器“逆天改命”
前端·css·面试
漫天黄叶远飞30 分钟前
async/await 到底怎么工作的?
前端