css 列表划过缩放动画

javascript 复制代码
<template>
  <div>
    <div class="item" v-for="(item,index) in list" :key="index">
      <img src="../../../../aa.png" alt="">
      <div class="num">{{(index+1) < 10 ? '0'+(index+1) : index+1 }}</div>
      <div class="title">{{item}}</div>
      <div class="go"></div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头'
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.item {
  display: flex;
  align-items: center;
  background: #ffffff;
  box-shadow: 0px 2px 4px 0px rgba(0, 70, 139, 0.04);
  border-radius: 4px;
  transition: all 0.5s;
  padding: 20px;
  box-sizing: border-box;
  margin-top: 20px;
  position: relative;
  img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
  }
  .num {
    margin: 0 20px;
  }
  .go {
    position: absolute;
    right: 20px;
    top: 50%;
    background: url('../../static/images/icon1.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    width: 36px;
    height: 36px;
    transform: translate(0, -50%);
  }
  cursor: pointer;
  &:hover {
    transform: scale(1.02);
    box-shadow: 0px 2px 8px 4px rgba(0, 70, 139, 0.04);
    color: #004ca1;
    .go {
      background: url('../../static/images/icon1-hover.png');
      background-repeat: no-repeat;
      background-position: center center;
      background-size: 100% 100%;
      width: 36px;
      height: 36px;
      position: absolute;
      top: 50%;
      right: 20px;
      transform: translate(0, -50%);
    }
  }
}
</style>
相关推荐
小心我捶你啊8 小时前
数据采集和Web解锁不是一回事,从用途到规则区分
前端·爬虫·网络协议
hunterandroid9 小时前
[鸿蒙从零到一] ArkUI 基础组件实战:Text、Image、Button 与 TextInput
前端
fsssb9 小时前
Chromium 源码学习笔记(五):一次点击,在进入 JS 之前先经历了什么?
前端
hunterandroid9 小时前
WorkManager 可靠性实战:唯一任务、重试与幂等设计
android·前端
鹿目9 小时前
使用 Vant CLI 搭建 UI 组件库:从 H5 到小程序跨平台
前端·javascript
默_笙9 小时前
😭 我花了两小时找了一个数据结构 bug,才把"迷你 Cursor"跑起来,绝望(bushi)
前端·javascript
竹林8189 小时前
wagmi v2 监听合约事件踩坑记:从 `useContractEvent` 到 `watchContractEvent`,我重构了三版才搞定实时数据流
前端·javascript
天若有情67310 小时前
纯HTML+Tailwind单页作品集网站——零框架静态前端完整源码
前端·html
WebGirl10 小时前
H5唤起app前端实现方案
前端