前端笔记-day13

news2024/9/25 11:21:35

文章目录

    • 01-体验vw和vh
    • 02-vw适配
      • 02-适配.html
      • demo.less
      • demo.css
    • 03-vw和vh不能混用
      • 03-vw和vh.html
      • demo.less
      • demo.css
    • 04-综合案例-酷我
      • demo.html
      • demo.less
      • base.less
      • demo.css
    • 酷我(标准版)
      • index.html
      • index.less
      • index.css

01-体验vw和vh

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        /* vw和vh是相对视口宽度计算结果,可以直接实现移动端适配效果(rem需要搭配js媒体查询使用) */
        .box{
            /* 
            width: 50vw;
            height: 30vw;
            background-color: pink; 
            */
            width: 50vh;
            height: 30vh;
            background-color: pink;

        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

02-vw适配

02-适配.html

像素转vw、vh:px单位尺寸/ 1/100视口的宽度和高度

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./demo.css">
</head>
<body>
    <div class="box">

    </div>
</body>
</html>

demo.less

.box{
    width: (68 / 3.75vw);
    height: (29 / 3.75vw);
    background-color: pink;
}
.box{
    width: (68 / 6.67vh);
    height: (29 / 6.67vh);
    background-color: pink;
}

demo.css

.box {
  width: 18.13333333vw;
  height: 7.73333333vw;
  background-color: pink;
}
.box {
  width: 10.19490255vh;
  height: 4.34782609vh;
  background-color: pink;
}

在这里插入图片描述
在这里插入图片描述

03-vw和vh不能混用

比例会改变

03-vw和vh.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./demo.css">
</head>
<body>
    <div class="box"></div>
</body>
</html>

demo.less

.box{
    width: (68 / 3.75vw);
    height: (29 / 6.67vh);
    background-color: pink;
}

demo.css

.box {
  width: 18.13333333vw;
  height: 4.34782609vh;
  background-color: pink;
}

在这里插入图片描述

在这里插入图片描述

04-综合案例-酷我

在这里插入图片描述

demo.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/demo.css">
    <link rel="stylesheet" href="./iconfont/iconfont.css">
</head>
<body>
    <!-- 顶部固定区域 -->
    <div class="top">
        <div class="left">
            <img src="./assets/logo.png" alt="">
            <h3>酷我音乐</h3>
            <p>打开APP收藏下载</p>
        </div>
        <div class="right">
            <a href="#">下载APP</a>
        </div>
    </div>
    <!-- 搜索区域 -->
    <div class="search">
       <div>
            <span class="iconfont icon-sousuo"></span>
            <p>搜索你想听的歌曲</p>
       </div>
    </div>
    <!-- 图片区域 -->
    <div class="pic">
        <ul>
            <li><a href="#"><img src="./assets/banner01.jpeg" alt=""></a></li>
            <!-- <li><a href="#"><img src="./assets/banner02.jpeg" alt=""></a></li> -->
            <!-- <li><a href="#"><img src="./assets/banner03.jpeg" alt=""></a></li> -->
            <!-- <li><a href="#"><img src="./assets/banner01.jpeg" alt=""></a></li> -->

        </ul>
    </div>
    <!-- 排行榜区域 -->
    <div class="rank">
        <div class="head">
            <h2>酷我排行版</h2>
            <a href="#">更多<span class="iconfont icon-right"></span></a>
        </div>
        <div class="body">
            <ul>
                <li>
                    <a href="#"><img src="./assets/icon_rank_hot.png" alt=""></a>
                    <dl>
                        <dt class="dt"><a href="#">酷我热歌榜 <span class="iconfont icon-right"></span></a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                    </dl>
                </li>
                <li>
                    <a href="#"><img src="./assets/icon_rank_new.png" alt=""></a>
                    <dl>
                        <dt class="dt"><a href="#">酷我热歌榜 <span class="iconfont icon-right"></span></a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                    </dl>
                </li>
                <li>
                    <a href="#"><img src="./assets/icon_rank_rise.png" alt=""></a>
                    <dl>
                        <dt class="dt"><a href="#">酷我热歌榜 <span class="iconfont icon-right"></span></a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                        <dt><a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a></dt>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <!-- 推荐歌单区域 -->
    <div class="recommend">
        <div class="head">
            <h2>推荐歌单</h2>
            <a href="#">更多<span class="iconfont icon-right"></span></a>
        </div>
        <div class="body">
            <ul>
                <li>
                    <div class="img">
                        <img src="./assets/song01.jpeg" alt="">
                        <div>18.2W</div>
                    </div>
                    <span>合适的变化不大的驾驶舱内的就</span>
                </li>
                <li>
                    <div class="img">
                        <img src="./assets/song01.jpeg" alt="">
                        <div>18.2W</div>
                    </div>
                    <span>合适的变化不大的驾驶舱内的就</span>
                </li>
                <li>
                    <div class="img">
                        <img src="./assets/song01.jpeg" alt="">
                        <div>18.2W</div>
                    </div>
                    <span>合适的变化不大的驾驶舱内的就</span>
                </li>
                <li>
                    <div class="img">
                        <img src="./assets/song01.jpeg" alt="">
                        <div>18.2W</div>
                    </div>
                    <span>合适的变化不大的驾驶舱内的就</span>
                </li>
                <li>
                    <div class="img">
                        <img src="./assets/song01.jpeg" alt="">
                        <div>18.2W</div>
                    </div>
                    <span>合适的变化不大的驾驶舱内的就</span>
                </li>
                <li>
                    <div class="img">
                        <img src="./assets/song01.jpeg" alt="">
                        <div>18.2W</div>
                    </div>
                    <span>合适的变化不大的驾驶舱内的就</span>
                </li>
            </ul>
        </div>
    </div>
    <!-- 底部固定区域 -->
    <div class="bottom">
        <a href="#">
            <img src="./assets/logo.png" alt="">
            <p>安装酷我音乐 发现更多好音乐</p>
            <span class="iconfont icon-right"></span>
        </a>
    </div>
</body>
</html>

demo.less

// out:../css/demo.css
@import "./base.less";
@key:3.75vw;
body{
    background-color: #f9fafb;
}
.top{
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    
    width: 100%;
    height: (50 / @key);
    background-color: #fff;

    padding: 0 (15 / @key);
    .left{
        display: flex;
        flex: 1;
        height: (50 / @key);
        justify-content: left;
        align-items: center;
        img{
            margin-left: (15 /@key);
            margin-right: (5 / @key);
            width: (30 / @key);
            height: (30 / @key); 
        }
        p{
            margin-left: (10 / @key);
            color: grey;
            font-size: (12 / @key);
        }
    }
    .right{
        // justify-content: right;
        display: flex;   
        align-items: center;   
        a{
            display: block;
            text-align: center;
            line-height: (30 / @key);
            width: (80 / @key);
            height: (30 / @key);
            background-color: #ffe31b;
            border-radius: 4vw;
            font-size: (14 / @key);
        }
    }
       
}

.search{
    margin-top: (50 / @key);
    width: 100%;
    height: (52 / @key);
    // background-color: pink;
    padding: (10 / @key) (10 / @key);
    
    div{
        display: flex;
        justify-content: center;
        align-items: center;
        width: (100%);
        height: 100%;
        background-color:#f2f4f5;
        border-radius: 4vw;
        color: #a1a4b3;
        font-size: (14 / @key);
        span{
            font-size: (16 / @key);
        }
    }
}

.pic{
    width: 100%;
    ul{
        width: 100%;    
        padding: 0 (15 / @key) 0 (15 / @key);
        display: flex;
        li{
            height: (108 / @key);
            img{
                width: (345 / @key);
                height: 100%;
                border-radius: 1vw;
            }
            margin-right:(15 / @key);
        }
        animation: move  1s steps(3) infinite;
    }
}
@keyframes move {
    from{
        background-position: 0 0;
    }
    to{
        background-position: (-(345 / @key)*3) 0;
    }  
}
.rank{
    width: 100%;
    height: (420 / @key);
    // background-color: pink;
    padding: 0 (15 / @key);
    .head{
        display: flex;
        width: 100%;
        height: (50 / @key);
        align-items: center;
        a{
            margin-left: auto;
            color: #a1a4b3;
        }
    }
    .body{
        li{
            display: flex;
            img{
                width: (105/@key);
                height: (105/@key);
                margin-right: (20 / @key);
                border-radius: 2vw;
            }
            dl{
                display: block;
                text-align: left;
                width: (215 / @key);
                height: (105 / @key);
                .dt{
                    height: (28/@key);
                    font-size: 3.5vw;
                    a{
                        color: black;
                    }
                }
                dt{
                    height: (21/@key);
                    font-size: 3.2vw;
                    a{
                        color: #a1a4b3;
                    }
                }
            }
        }
    }
}

.recommend{
    width: 100%;
    height: (360 / @key);
    // background-color: pink;
    padding: 0 (15 / @key);
    .head{
        display: flex;
        width: 100%;
        height: (50 / @key);
        align-items: center;
        a{
            margin-left: auto;
            color: #a1a4b3;;
        }
    }
    .body{
        ul{
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
    
            li{
                width: (105/@key);
                height: (145 / @key);
                font-size: 3.7vw;
                margin-bottom: (10 / @key);
                .img{
                    position: relative;
                    width: (105/@key);
                    height: (105/@key);   
                    img{
                        width: 100%;
                        height: 100%;
                        border-radius: 2vw;
                    }
                    div{
                        width: (70 / @key);
                        height: (28 /@key);
                        position: absolute;
                        bottom: 0;
                        left: 0;
                        color: #fff;
                        
                        background-color: rgba(0,0,0,0.8);
                        border-radius: 2vw;
                        text-align: center;
                        line-height:  (28 /@key);;
                    }
                }
            }
        }
    }
}

.bottom{
    position: fixed;
    bottom: (45 / @key);
    left: (15 / @key);
    a{
        width: (345 / @key);
        height: (45 / @key);
        background-color:#fff;
        display: flex;
        align-items: center;
       
        border-radius: 10vw;
        padding: (20 / @key);
        
        img{
           width: (36 / @key); 
           height: (36 / @key);
           margin-right: (10 / @key);
        }
        p{
            flex: 1;
            font-size: (14 / @key);
            // background-color: pink;
        }
        span{
            width: (32/@key);
            height: (32/@key);
            
            text-align: center;
            line-height: (32/@key);
            background-color: #f2f3f5;
            border-radius: 50%;
        }
    }
}

base.less

// out: false
*,
::after,
::before {
  box-sizing: border-box;
}

body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    PingFangSC-Regular,
    "PingFang SC",
    "Microsoft YaHei",
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  font-size: 14px;
  color: #333;
}

img {
  vertical-align: bottom;
}

ul {
  list-style-type: none;
}

a {
  color: #333;
  text-decoration: none;
  -webkit-tap-highlight-color: rgb(0 0 0 / 0%);
}

demo.css

*,
::after,
::before {
  box-sizing: border-box;
}
body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, PingFangSC-Regular, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
}
img {
  vertical-align: bottom;
}
ul {
  list-style-type: none;
}
a {
  color: #333;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
  background-color: #f9fafb;
}
.top {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  height: 13.33333333vw;
  background-color: #fff;
  padding: 0 4vw;
}
.top .left {
  display: flex;
  flex: 1;
  height: 13.33333333vw;
  justify-content: left;
  align-items: center;
}
.top .left img {
  margin-left: 4vw;
  margin-right: 1.33333333vw;
  width: 8vw;
  height: 8vw;
}
.top .left p {
  margin-left: 2.66666667vw;
  color: grey;
  font-size: 3.2vw;
}
.top .right {
  display: flex;
  align-items: center;
}
.top .right a {
  display: block;
  text-align: center;
  line-height: 8vw;
  width: 21.33333333vw;
  height: 8vw;
  background-color: #ffe31b;
  border-radius: 4vw;
  font-size: 3.73333333vw;
}
.search {
  margin-top: 13.33333333vw;
  width: 100%;
  height: 13.86666667vw;
  padding: 2.66666667vw 2.66666667vw;
}
.search div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: #f2f4f5;
  border-radius: 4vw;
  color: #a1a4b3;
  font-size: 3.73333333vw;
}
.search div span {
  font-size: 4.26666667vw;
}
.pic {
  width: 100%;
}
.pic ul {
  width: 100%;
  padding: 0 4vw 0 4vw;
  display: flex;
  animation: move 1s steps(3) infinite;
}
.pic ul li {
  height: 28.8vw;
  margin-right: 4vw;
}
.pic ul li img {
  width: 92vw;
  height: 100%;
  border-radius: 1vw;
}
@keyframes move {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -276vw 0;
  }
}
.rank {
  width: 100%;
  height: 112vw;
  padding: 0 4vw;
}
.rank .head {
  display: flex;
  width: 100%;
  height: 13.33333333vw;
  align-items: center;
}
.rank .head a {
  margin-left: auto;
  color: #a1a4b3;
}
.rank .body li {
  display: flex;
}
.rank .body li img {
  width: 28vw;
  height: 28vw;
  margin-right: 5.33333333vw;
  border-radius: 2vw;
}
.rank .body li dl {
  display: block;
  text-align: left;
  width: 57.33333333vw;
  height: 28vw;
}
.rank .body li dl .dt {
  height: 7.46666667vw;
  font-size: 3.5vw;
}
.rank .body li dl .dt a {
  color: black;
}
.rank .body li dl dt {
  height: 5.6vw;
  font-size: 3.2vw;
}
.rank .body li dl dt a {
  color: #a1a4b3;
}
.recommend {
  width: 100%;
  height: 96vw;
  padding: 0 4vw;
}
.recommend .head {
  display: flex;
  width: 100%;
  height: 13.33333333vw;
  align-items: center;
}
.recommend .head a {
  margin-left: auto;
  color: #a1a4b3;
}
.recommend .body ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.recommend .body ul li {
  width: 28vw;
  height: 38.66666667vw;
  font-size: 3.7vw;
  margin-bottom: 2.66666667vw;
}
.recommend .body ul li .img {
  position: relative;
  width: 28vw;
  height: 28vw;
}
.recommend .body ul li .img img {
  width: 100%;
  height: 100%;
  border-radius: 2vw;
}
.recommend .body ul li .img div {
  width: 18.66666667vw;
  height: 7.46666667vw;
  position: absolute;
  bottom: 0;
  left: 0;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 2vw;
  text-align: center;
  line-height: 7.46666667vw;
}
.bottom {
  position: fixed;
  bottom: 12vw;
  left: 4vw;
}
.bottom a {
  width: 92vw;
  height: 12vw;
  background-color: #fff;
  display: flex;
  align-items: center;
  border-radius: 10vw;
  padding: 5.33333333vw;
}
.bottom a img {
  width: 9.6vw;
  height: 9.6vw;
  margin-right: 2.66666667vw;
}
.bottom a p {
  flex: 1;
  font-size: 3.73333333vw;
}
.bottom a span {
  width: 8.53333333vw;
  height: 8.53333333vw;
  text-align: center;
  line-height: 8.53333333vw;
  background-color: #f2f3f5;
  border-radius: 50%;
}

在这里插入图片描述
在这里插入图片描述

酷我(标准版)

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>酷我音乐</title>
  <link rel="stylesheet" href="./iconfont/iconfont.css">
  <link rel="stylesheet" href="./css/index.css">
</head>
<body>
  <!-- 头部 -->
  <header>
    <div class="left"></div>
    <a href="#">下载APP</a>
  </header>

  <!-- 搜索 -->
  <div class="search">
    <div class="txt">
      <span class="iconfont icon-sousuo"></span>
      <span>搜索你想听的歌曲</span>
    </div>
  </div>

  <!-- banner -->
  <div class="banner">
    <ul>
      <li><a href="#"><img src="./assets/banner01.jpeg" alt=""></a></li>
    </ul>
  </div>

  <!-- 排行榜 -->
  <div class="list">
    <!-- 标题 -->
    <div class="title">
      <h4>酷我排行榜</h4>
      <a href="#">更多<span class="iconfont icon-right"></span></a>
    </div>
    <!-- 内容 -->
    <div class="content">
      <ul>
        <li>
          <div class="pic"><img src="./assets/icon_rank_hot.png" alt=""></div>
          <div class="txt">
            <a href="#" class="more">酷我热歌榜<span class="iconfont icon-right"></span></a>
            <a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a>
            <a href="#">2.就让这大雨全都落下 - 容祖儿</a>
            <a href="#">3.缺氧 - 轩姨(相信光)</a>
          </div>
        </li>
        <li>
          <div class="pic"><img src="./assets/icon_rank_new.png" alt=""></div>
          <div class="txt">
            <a href="#" class="more">酷我新歌榜<span class="iconfont icon-right"></span></a>
            <a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a>
            <a href="#">2.就让这大雨全都落下 - 容祖儿</a>
            <a href="#">3.缺氧 - 轩姨(相信光)</a>
          </div>
        </li>
        <li>
          <div class="pic"><img src="./assets/icon_rank_rise.png" alt=""></div>
          <div class="txt">
            <a href="#" class="more">酷我飙升榜<span class="iconfont icon-right"></span></a>
            <a href="#">1.樱花树下的约定(完整版) - 旺仔小乔</a>
            <a href="#">2.就让这大雨全都落下 - 容祖儿</a>
            <a href="#">3.缺氧 - 轩姨(相信光)</a>
          </div>
        </li>
      </ul>
    </div>
  </div>

  <!-- 推荐歌单 -->
  <div class="recommend">
    <!-- 标题 -->
    <div class="title">
      <h4>推荐歌单</h4>
      <a href="#">更多<span class="iconfont icon-right"></span></a>
    </div>
    <!-- 内容 -->
    <div class="content">
      <ul>
        <li>
          <div class="pic">
            <img src="./assets/song01.jpeg" alt="">
            <div class="cover">18.2W</div>
          </div>
          <div class="txt">抖音嗨爆DJ!劲爆旋律萦绕双耳</div>
        </li>
        <li>
          <div class="pic">
            <img src="./assets/song02.jpeg" alt="">
            <div class="cover">18.2W</div>
          </div>
          <div class="txt">抖音嗨爆DJ!劲爆旋律萦绕双耳</div>
        </li>
        <li>
          <div class="pic">
            <img src="./assets/song03.jpeg" alt="">
            <div class="cover">18.2W</div>
          </div>
          <div class="txt">抖音嗨爆DJ!劲爆旋律萦绕双耳</div>
        </li>
        <li>
          <div class="pic">
            <img src="./assets/song02.jpeg" alt="">
            <div class="cover">18.2W</div>
          </div>
          <div class="txt">抖音嗨爆DJ!劲爆旋律萦绕双耳</div>
        </li>
        <li>
          <div class="pic">
            <img src="./assets/song03.jpeg" alt="">
            <div class="cover">18.2W</div>
          </div>
          <div class="txt">抖音嗨爆DJ!劲爆旋律萦绕双耳</div>
        </li>
        <li>
          <div class="pic">
            <img src="./assets/song01.jpeg" alt="">
            <div class="cover">18.2W</div>
          </div>
          <div class="txt">抖音嗨爆DJ!劲爆旋律萦绕双耳</div>
        </li>
      </ul>
    </div>
  </div>

  <!-- 安装,下载 -->
  <div class="download">
    <img src="./assets/logo.png" alt="">
    <p>安装酷我音乐 发现更多好音乐</p>
    <span class="iconfont icon-right"></span>
  </div>
</body>
</html>

index.less

// out: ../css/

@import "./base";

body {
  background-color: #f9fafb;
}

@vw:3.75vw;

// 头部
header {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 (15 / @vw);
  // 固定定位的盒子,宽度靠内容撑开,希望宽度100%
  width: 100%;
  height: (50 / @vw);
  background-color: #fff;
  // 左边
  .left {
    width: (235 / @vw);
    height: (50 / @vw);
    background-image: url(../assets/head.png);
    background-size: contain;
    background-repeat: no-repeat;
  }
  a {
    width: (80 / @vw);
    height: (30 / @vw);
    background-color: #ffe31b;
    border-radius: (15 / @vw);
    text-align: center;
    line-height: (30 / @vw);
    font-size: (14 / @vw);
  }
}

// 搜索
.search {
  // 头部固定定位,脱标不占位,搜索去最顶了,加上外边距挤下来即可
  margin-top: (50 / @vw);
  padding: (10 / @vw) (15 / @vw);
  height: (52 / @vw);
  // background-color: pink;
  .txt {
    height: (32 / @vw);
    background-color: #f2f4f5;
    border-radius: (16 / @vw);
    text-align: center;
    line-height: (32 / @vw);
    color: #a1a4b3;
    font-size: (14 / @vw);
    .iconfont {
      font-size: (16 / @vw);
    }
  }
}

// banner
.banner {
  padding: 0 (15 / @vw);
  height: (108 / @vw);
  // background-color: pink;
  ul {
    li {
      width: (345 / @vw);
      height: (108 / @vw);
      img {
        width: 100%;
        height: 100%;
        // cover完全覆盖
        // 缩放img,图片比例跟父级盒子比例不同,避免图片挤压变形
        object-fit: cover;
        border-radius: (5 / @vw);
      }
    }
  }
}

// 排行榜
.list {
  margin-top: (20 / @vw);
  padding: 0 (15 / @vw);
  li {
    display: flex;
    margin-bottom: (16 / @vw);
    height: (105 / @vw);
    background-color: #fff;
    border-radius: (10 / @vw);
    .pic {
      margin-right: (20 / @vw);
      img {
        width: (105 / @vw);
        height: (105 / @vw);
        border-radius: (10 / @vw);
      }
    }
    .txt {
      a {
        display: block;
        font-size: (12 / @vw);
        color: #a1a4b3;
        line-height: 1.8;
      }

      .more {
        font-size: (14 / @vw);
        color: #333;
        .iconfont {
          font-size: (16 / @vw);
        }
      }
    }
  }
}

// 标题 → 公共样式
.title {
  display: flex;
  justify-content: space-between;
  margin-bottom: (16 / @vw);
  line-height: (25 / @vw);
  h4 {
    font-size: (20 / @vw);
  }
  a {
    font-size: (12 / @vw);
    color: #a1a4b3;
  }
}

// 推荐歌单
.recommend {
  padding: 0 (15 / @vw);
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    li {
      margin-bottom: (16 / @vw);
      width: (105 / @vw);
      height: (143 / @vw);
      // background-color: pink;
  // 图片
  .pic {
    position: relative;
    width: (105 / @vw);
    height: (105 / @vw);
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: (10 / @vw);
    }
    .cover {
      position: absolute;
      left: 0;
      bottom: 0;
      width: (70 / @vw);
      height: (28 / @vw);
      background-color: rgba(0,0,0,0.8);
      border-radius: 0 (10 / @vw) 0 (10 / @vw);
      text-align: center;
      line-height: (28 / @vw);
      color: #fff;
      font-size: (14 / @vw);
    }
      }
      // 文字
      .txt {
        font-size: (14 / @vw);
      }
    }
  }
}

// 下载
.download {
  position: fixed;
  left: (15 / @vw);
  bottom: (30 / @vw);

  display: flex;
  align-items: center;
  padding: 0 (10 / @vw) 0 (15 / @vw);
  width: (345 / @vw);
  height: (45 / @vw);
  background-color: #fff;
  border-radius: (22 / @vw);
  img {
    margin-right: (10 / @vw);
    width: (36 / @vw);
    height: (36 / @vw);
  }
  p {
    flex: 1;
    font-size: (14 / @vw);
  }
  span {
    width: (32 / @vw);
    height: (32 / @vw);
    background-color: #f2f3f5;
    border-radius: 50%;
    text-align: center;
    line-height: (32 / @vw);
    font-size: (16 / @vw);
  }
}

index.css

*,
::after,
::before {
  box-sizing: border-box;
}
body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, PingFangSC-Regular, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
}
img {
  vertical-align: bottom;
}
ul {
  list-style-type: none;
}
a {
  color: #333;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
  background-color: #f9fafb;
}
header {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4vw;
  width: 100%;
  height: 13.33333333vw;
  background-color: #fff;
}
header .left {
  width: 62.66666667vw;
  height: 13.33333333vw;
  background-image: url(../assets/head.png);
  background-size: contain;
  background-repeat: no-repeat;
}
header a {
  width: 21.33333333vw;
  height: 8vw;
  background-color: #ffe31b;
  border-radius: 4vw;
  text-align: center;
  line-height: 8vw;
  font-size: 3.73333333vw;
}
.search {
  margin-top: 13.33333333vw;
  padding: 2.66666667vw 4vw;
  height: 13.86666667vw;
}
.search .txt {
  height: 8.53333333vw;
  background-color: #f2f4f5;
  border-radius: 4.26666667vw;
  text-align: center;
  line-height: 8.53333333vw;
  color: #a1a4b3;
  font-size: 3.73333333vw;
}
.search .txt .iconfont {
  font-size: 4.26666667vw;
}
.banner {
  padding: 0 4vw;
  height: 28.8vw;
}
.banner ul li {
  width: 92vw;
  height: 28.8vw;
}
.banner ul li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.33333333vw;
}
.list {
  margin-top: 5.33333333vw;
  padding: 0 4vw;
}
.list li {
  display: flex;
  margin-bottom: 4.26666667vw;
  height: 28vw;
  background-color: #fff;
  border-radius: 2.66666667vw;
}
.list li .pic {
  margin-right: 5.33333333vw;
}
.list li .pic img {
  width: 28vw;
  height: 28vw;
  border-radius: 2.66666667vw;
}
.list li .txt a {
  display: block;
  font-size: 3.2vw;
  color: #a1a4b3;
  line-height: 1.8;
}
.list li .txt .more {
  font-size: 3.73333333vw;
  color: #333;
}
.list li .txt .more .iconfont {
  font-size: 4.26666667vw;
}
.title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4.26666667vw;
  line-height: 6.66666667vw;
}
.title h4 {
  font-size: 5.33333333vw;
}
.title a {
  font-size: 3.2vw;
  color: #a1a4b3;
}
.recommend {
  padding: 0 4vw;
}
.recommend ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.recommend ul li {
  margin-bottom: 4.26666667vw;
  width: 28vw;
  height: 38.13333333vw;
}
.recommend ul li .pic {
  position: relative;
  width: 28vw;
  height: 28vw;
}
.recommend ul li .pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2.66666667vw;
}
.recommend ul li .pic .cover {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 18.66666667vw;
  height: 7.46666667vw;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 0 2.66666667vw 0 2.66666667vw;
  text-align: center;
  line-height: 7.46666667vw;
  color: #fff;
  font-size: 3.73333333vw;
}
.recommend ul li .txt {
  font-size: 3.73333333vw;
}
.download {
  position: fixed;
  left: 4vw;
  bottom: 8vw;
  display: flex;
  align-items: center;
  padding: 0 2.66666667vw 0 4vw;
  width: 92vw;
  height: 12vw;
  background-color: #fff;
  border-radius: 5.86666667vw;
}
.download img {
  margin-right: 2.66666667vw;
  width: 9.6vw;
  height: 9.6vw;
}
.download p {
  flex: 1;
  font-size: 3.73333333vw;
}
.download span {
  width: 8.53333333vw;
  height: 8.53333333vw;
  background-color: #f2f3f5;
  border-radius: 50%;
  text-align: center;
  line-height: 8.53333333vw;
  font-size: 4.26666667vw;
}

在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1910034.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

旗晟机器人AI智能算法有哪些?

在当今迅猛发展的工业4.0时代&#xff0c;智能制造和自动化运维已然成为工业发展至关重要的核心驱动力。伴随技术的持续进步&#xff0c;工业场景中的运维巡检已不再单纯地依赖于传统的人工运维方式&#xff0c;而是愈发多地融入了智能化的元素&#xff0c;其中智能巡检运维系统…

51单片机嵌入式开发:6、 STC89C52RC 定时器0-1-2-看门狗 操作

STC89C52RC 定时器0-1-2-看门狗 操作 1 定时器介绍1.1 定时器概述1.2 课程思路 2 定时器类型2.1 定时器0、12.2 定时器22.3 看门狗定时器2.4 中断介绍 3 定时器操作3.1 定时器0操作3.2 定时器1操作3.3 定时器2操作3.4 看门狗定时器操作 4 定时器总结 1 定时器介绍 1.1 定时器概…

金蝶API取数+JSON解析,FDL助力高效数据处理

目录 一、企业介绍 二、业务难题与挑战 商管预算管理瓶颈凸显&#xff1a;金蝶数据手工导出&#xff0c;跨库关联分析时效受限 金蝶API数据提取&#xff1a;挑战重重的技术攻坚战 三、解决方案 商管预算管理升级&#xff1a;API取数JSON解析&#xff0c;FineDataLink助力高效数…

uni-app三部曲之二: 封装http请求

1.引言 前面一篇文章写了使用Pinia进行全局状态管理。 这篇文章主要介绍一下封装http请求&#xff0c;发送数据请求到服务端进行数据的获取。 感谢&#xff1a; 1.yudao-mall-uniapp: 芋道商城&#xff0c;基于 Vue Uniapp 实现&#xff0c;支持分销、拼团、砍价、秒杀、优…

k8s核心操作_Deployment的扩缩容能力_Deployment自愈和故障转移能力---分布式云原生部署架构搭建022

然后我们上面说了k8s中的deployment的多副本能力 然后,我们再来看 k8s中的deployment的扩缩容能力 可以看到,对于扩容,要使用 kubectl scale 命令 对于缩容 要使用kubectl scale 命令都是使用这个命令对吧 来试试,可以看到上面命令 首先看看 kubectl get pod 可以看到有…

u-boot的主要目录结构

arch 各种芯片架构的相关代码,u-boot入口代码 board 各种单板相关的代码,主要包含存储器驱动等 board/hi3516a hi3516a单板相关的代码 arch/xxx/lib 各种体系结构的相关的代码,如ARM include 头文件 include/configs 各种单板的配置文件 common 各种功能实…

springboot篮球馆管理系统-计算机毕业设计源码21945

目 录 摘要 1 绪论 1.1选题背景 1.2研究意义 1.3论文结构与章节安排 2 篮球馆管理系统系统分析 2.1 可行性分析 2.1.1 技术可行性分析 2.1.2 经济可行性分析 2.1.3 法律可行性分析 2.2 系统功能分析 2.2.1 功能性分析 2.2.2 非功能性分析 2.3 系统用例分析 2.4 …

SSO单点登录-1-同浏览器进行单点登录

前端同域 客户端前端同域&#xff0c;则cookie可以存在相同的域名或顶级域名下&#xff0c;一个客户端登录成功后&#xff0c;将token信息保存到域名下的cookie中其他不同客户端访问时&#xff0c;因为域名或者顶级域名相同&#xff0c;也能取到域名下的cookie中的token信息并…

华三m-lag三层转发+VRRP配置案例

目录 一、相关理论介绍 1.1 华三M-LAG介绍 1.2 DRCP协议 1.3 keepalive机制 1.4 MAD机制 1.5 一致性检查功能 二、M-LAG系统建立及工作过程 三、实验组网案例 3.1 组网需求 3.2 组网拓扑 3.3 设备接口及地址规划 四、具体配置命令 4.1 S6850-1的配置 4.2 S6850-2…

python爬虫和用腾讯云API接口进行翻译并存入excel,通过本机的Windows任务计划程序定时运行Python脚本!

项目场景&#xff1a; 提示&#xff1a;这里简述项目相关背景&#xff1a;定时爬取外网的某个页面&#xff0c;并将需要的部分翻译为中文存入excel 接下了的&#xff0c;没学过的最好看一下 基本爬虫的学习 【爬虫】requests 结合 BeautifulSoup抓取网页数据_requests beauti…

Visual Studio 安装Python 环境

前言 我在使用Visual Studio作为Python工具的时候&#xff0c;碰到了一些环境问题和依赖包安装问题&#xff0c;现将问题和方法总结出来&#xff0c;供大家学习和参考。 一、Python 安装 Python官网&#xff1a; Welcome to Python.org 可以下载左侧的稳定发布版本 下载完成之…

昇思25天学习打卡营第21天 | Diffusion扩散模型

内容介绍&#xff1a; 扩散模型&#xff08;Diffusion Models&#xff09;有很多种理解&#xff0c;本文的介绍是基于denoising diffusion probabilistic model &#xff08;DDPM&#xff09;&#xff0c;DDPM已经在&#xff08;无&#xff09;条件图像/音频/视频生成领域取得…

The Quinfall昆法尔卡顿延迟高怎么办?快速降低昆法尔延迟

The Quinfall昆法尔中&#xff0c;玩家可以选择数十种不同的职业&#xff0c;体验从战士到法师&#xff0c;从猎人到工匠的丰富人生。每个职业都有其独特的技能和装备&#xff0c;玩家可以根据自己的喜好和游戏风格来自由搭配。而游戏中的战斗系统更是丰富多彩&#xff0c;无论…

【深度学习实战(44)】Anchor based and Anchor free(无锚VS有锚)

1 anchor-based 深度学习目标检测通常都被建模成对一些候选区域进行分类和回归的问题。在单阶段检测器中&#xff0c;这些候选区域就是通过滑窗方式产生的 anchor&#xff1b;在两阶段检测器中&#xff0c;候选区域是 RPN 生成的 proposal&#xff0c;但是 RPN 本身仍然是对滑窗…

gen_cross_contour_xld 为每个输入点生成一个十字形状的XLD轮廓。

gen_cross_contour_xld Name 名称 gen_cross_contour_xld — Generate one XLD contour in the shape of a cross for each input point. 为每个输入点生成一个十字形状的XLD轮廓。 Signature 签名 gen_cross_contour_xld( : Cross : Row, Col, Size, Angle : ) Descripti…

SQL创建一个actor_name表

系列文章目录 文章目录 系列文章目录前言 前言 前些天发现了一个巨牛的人工智能学习网站&#xff0c;通俗易懂&#xff0c;风趣幽默&#xff0c;忍不住分享一下给大家。点击跳转到网站&#xff0c;这篇文章男女通用&#xff0c;看懂了就去分享给你的码吧。 描述 对于如下表ac…

微信投票小程序源码系统 带礼物功能 完整的源代码包以及搭建部署教程

系统概述 随着移动互联网的快速发展&#xff0c;微信小程序以其便捷性、轻量化及强大的社交属性&#xff0c;已成为众多企业和个人进行品牌宣传、活动推广的重要工具。其中&#xff0c;微信投票小程序更是因其独特的互动性和参与感&#xff0c;深受用户喜爱。然而&#xff0c;…

matlab 花瓣线绘制

matlab 花瓣线绘制 clc,clear,close all; % 创建一个范围内的 x 和 y 值 x linspace(-1.5, 1.5, 100); y linspace(-1.5, 1.5, 100);% 创建一个网格来表示 x 和 y 值的组合 [X, Y] meshgrid(x, y);% 计算方程的左边和右边的值 LHS1 X.^2 Y.^2; RHS1 X.^4 Y.^4;LHS2 X.…

内网信息收集:手动、脚本和工具查IP、端口

1.手动查IP和端口 2.工具查IP 3.工具查端口 我们在内网中拿下目标机器后&#xff0c;需要进行一系列的信息收集&#xff0c;以下为总结的收集方法 1.手动信息收集&#xff1a; 以下命令在CS执行时命令前须加shell,如&#xff1a;shell ipconfig 1.收集IP网卡&#xff1a; ip…

node-gyp 重新安装,解决编译遇到的问题【超详细图解】

一、报错信息 npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp10.0.1 npm ERR! gyp info using node18.19.0 | darwin | arm64 npm ERR! gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/python3.12/…