纯 CSS 实现在鱼缸中养一条鱼【附源码】

前言

大家好,我是林三心,用最通俗易懂的话讲最难的知识点是我的座右铭,基础是进阶的前提是我的初心~

分享一条鱼缸里的小鱼,祝大家开心


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      body {
        background#e9ebe8;
      }
      .fishbowl {
        position: absolute;
        height310px;
        width350px;
        border5px solid#555555;
        top50%;
        left50%;
        transformtranslate(-50%, -50%);
        border-radius50%;
      }
      .fishbowl:after {
        content"";
        position: absolute;
        background#e9ebe8;
        width330px;
        height105px;
        top: -12px;
        left9px;
      }
      .bow {
        position: absolute;
        border-radius50%;
        height360px;
        width80px;
        box-shadow6px 2px 0 0#555555;
        top: -108px;
        left139px;
        z-index11;
        transformrotate(89deg);
      }
      .bow:after {
        content"";
        position: absolute;
        border-radius50%;
        height18px;
        width18px;
        box-shadow5px 3px 0 0#555555;
        transformscale(-11rotate(265deg);
        left38px;
        top5px;
      }
      .bow:before {
        content"";
        position: absolute;
        border-radius50%;
        height18px;
        width18px;
        box-shadow5px 3px 0 0#555555;
        transformscale(1, -1rotate(190deg);
        left38px;
        bottom2px;
      }
      .bowsecond {
        position: absolute;
        border-radius50%;
        height342px;
        width62px;
        box-shadow6px 2px 0 0#555555;
        top: -112px;
        left151px;
        z-index10;
        transformrotate(89deg);
      }
      .bowsecond:after {
        content"";
        position: absolute;
        border-radius50%;
        height352px;
        width68px;
        box-shadow6px 2px 0 0#555555;
        top: -1px;
        left14px;
        z-index50;
        transformscale(-11);
      }
      .shui {
        position: absolute;
        height310px;
        width318px;
        background#bbd7ea;
        border-radius50%;
        top: -5px;
        left16px;
        z-index: -50;
      }
      .shui:after {
        content"";
        position: absolute;
        background#e9ebe8;
        height65px;
        width100%;
        border-radius100%;
        top66px;
        left0px;
      }
      .fish {
        position: absolute;
        top150px;
        height117px;
        width146px;
        background#bea7ff;
        left87px;
        border-radius50%;
        border2px solid#555555;
      }
      .fish:after {
        content"";
        position: absolute;
        background#cdbcff;
        height117px;
        width136px;
        border-radius50%;
        right0px;
      }
      .yanjingyi {
        position: absolute;
        height32px;
        width32px;
        background#ddd;
        border-radius50%;
        right44px;
        top34px;
        border2px solid#555555;
        z-index13;
      }
      .yanjingyi:after {
        content"";
        position: absolute;
        background: white;
        height32px;
        width29px;
        border-radius50%;
        right0;
        z-index0;
      }
      .inner {
        position: absolute;
        border1px solid#555555;
        height18px;
        width18px;
        background#090b0b;
        border-radius50%;
        top11px;
        left5px;
        z-index2;
      }
      .inner:after {
        content"";
        position: absolute;
        background: white;
        height3px;
        width3px;
        border-radius50%;
        top7px;
        left6px;
      }
      .inner:before {
        content"";
        background: white;
        height5px;
        width5px;
        border-radius50%;
        top11px;
        position: absolute;
        left3px;
      }
      .yanjinger {
        position: absolute;
        height26px;
        width26px;
        background#ddd;
        border-radius50%;
        right10px;
        top34px;
        border2px solid#555555;
        z-index13;
      }
      .yanjinger:after {
        content"";
        background: white;
        height25px;
        width22px;
        border-radius50%;
        right0;
        position: absolute;
        z-index0;
      }
      .innertwo {
        position: absolute;
        width12px;
        background#090b0b;
        border-radius50%;
        top11px;
        left5px;
        border1px solid#555555;
        height12px;
        z-index2;
      }
      .innertwo:after {
        content"";
        position: absolute;
        background: white;
        height1px;
        width1px;
        border-radius50%;
        top5px;
        left6px;
      }
      .innertwo:before {
        content"";
        height3px;
        width3px;
        border-radius50%;
        position: absolute;
        background: white;
        top8px;
        left3px;
      }
      .zuiba {
        position: absolute;
        box-shadow2px 2px 0 0#555555;
        border-radius50%;
        transformscale(-11rotate(90deg);
        height28px;
        width12px;
        top62px;
        right40px;
        z-index50;
      }
      .yanyin {
        position: absolute;
        height22px;
        width8px;
        border-radius50%;
        box-shadow2px 2px 0 0#ae93ff;
        top69px;
        right42px;
        transformrotate(88degscale(1, -1);
        z-index1;
      }
      .meibao {
        position: absolute;
        border-radius50%;
        box-shadow3px 3px 0 0#555555;
        top25px;
        right21px;
        z-index50;
        height16px;
        width6px;
        transformrotate(-85degscale(1, -1);
      }
      .meibaotwo {
        position: absolute;
        height16px;
        width6px;
        border-radius50%;
        box-shadow3px 3px 0 0#555555;
        top25px;
        right64px;
        z-index50;
        transformrotate(-105deg);
      }
      .jiuwo {
        height10px;
        width5px;
        position: absolute;
        border-radius50%;
        box-shadow1px 1px 0 0#555555;
        right57px;
        top73px;
        z-index50;
      }
      .fin {
        width20px;
        height15px;
        top55px;
        z-index1;
        left25px;
        border-top-left-radius100%;
        border-bottom-left-radius50%;
        border-bottom-right-radius100%;
        position: absolute;
        border-top2px solid#555555;
        border-left2px solid#555555;
        border-bottom2px solid#555555;
        border-top-right-radius45%;
        transformrotate(-20deg);
      }
      .fin:after {
        content"";
        height11px;
        border-top-left-radius100%;
        border-bottom-left-radius50%;
        border-bottom-right-radius100%;
        border-top-right-radius45%;
        position: absolute;
        background#baa2ff;
        width14px;
        z-index5;
        left4px;
        top1px;
      }
      .topfin {
        position: absolute;
        z-index: -10;
        border-top-left-radius50%;
        top: -10px;
        left20px;
        border-top-right-radius30%;
        height50px;
        width50px;
        border2px solid#555555;
        background#d1c1ff;
      }
      .topfin:after {
        content"";
        width50px;
        border-top-right-radius30%;
        border-top-left-radius50%;
        position: absolute;
        background#baa2ff;
        height40px;
        top5px;
        left5px;
      }
      .weiba {
        position: absolute;
        height20px;
        width20px;
        border-top-left-radius100%;
        border-bottom-left-radius50%;
        border-top-right-radius50%;
        border2px solid#555555;
        z-index: -10;
        left: -20px;
        top35px;
        background#ae93ff;
      }
      .weiba:after {
        content"";
        position: absolute;
        background#baa2ff;
        width15px;
        border-top-left-radius100%;
        border-bottom-left-radius50%;
        border-top-right-radius50%;
        height20px;
        right0px;
        z-index: -1;
      }
      .weibatwo {
        position: absolute;
        height10px;
        width10px;
        border-bottom-left-radius50%;
        border-top-right-radius50%;
        left: -10px;
        top57px;
        background#ae93ff;
        border2px solid#555555;
        z-index: -5;
        border-top-left-radius100%;
        transformrotate(-90deg);
      }
      .container {
        position: absolute;
        animation5s hover ease infinite;
      }
      @keyframes hover {
        50% {
          transformtranslateY(12px);
        }
      }
      .bubble1 {
        position: absolute;
        height8px;
        width8px;
        background#e9ebe8;
        z-index100;
        left220px;
        border-radius100%;
        animation: bubble 2s ease infinite;
        animation-delay0.3s;
        opacity0;
        top220px;
      }
      @keyframes bubble {
        10% {
          transformtranslate(-4px, -20px);
          opacity1;
        }
        97% {
          transformtranslate(7px, -95px);
        }
      }
      .bubble2 {
        position: absolute;
        height8px;
        width8px;
        background#e9ebe8;
        z-index100;
        top210px;
        left230px;
        border-radius100%;
        animation: bubble2 2s ease infinite;
        animation-delay0.7s;
        opacity0;
      }
      @keyframes bubble2 {
        10% {
          transformtranslate(-4px, -10px);
          opacity1;
        }
        97% {
          transformtranslate(4px, -95px);
        }
      }
    
</style>
  </head>

  <body>
    <div class="fishbowl">
      <div class="bow"></div>
      <div class="bowsecond"></div>
      <div class="shui">
        <div class="container">
          <div class="fish">
            <div class="yanjingyi">
              <div class="inner"></div>
            </div>
            <div class="yanjinger">
              <div class="innertwo"></div>
            </div>
            <div class="zuiba"></div>
            <div class="yanyin"></div>
            <div class="meibao"></div>
            <div class="meibaotwo"></div>
            <div class="jiuwo"></div>
            <div class="fin"></div>
            <div class="topfin"></div>
            <div class="weiba"></div>
            <div class="weibatwo"></div>
          </div>
        </div>
        <div class="bubble1"></div>
        <div class="bubble2"></div>
      </div>
    </div>
  </body>
</html>


结语

我是林三心,感谢您的观看阅读,如果对你有帮助的话,请点点关注呗~

相关推荐

  • 文本挖掘实践再回顾:基于游记的事件演化序列抽取与图谱可视化展示
  • 老刘的RAG小课堂开始啦!从朴素RAG到KG增强RAG再到文档解析三阶段
  • 三个月建成“世界最大”Nvidia GPU 计算集群,马斯克:不够,还要再加 10 万个
  • InfoQ 技术大会双节福利套餐来啦!无套路立享折扣优惠
  • OpenAI 正在卷土重来!发布最新模型 o1,这次变为华人扛大旗?
  • “法定退休年龄计算器”热到崩溃;活久见:近一万颗星的知名开源项目竟被无理要求闭源;“纯血鸿蒙”正式版将于月底上线 | Q资讯
  • 如何用 Web 界面 AI 工作流提升科研写作效率?
  • 这10种分布式ID方案,真香!
  • ACL 2024 | 文本表示新SOTA!微软用大模型及其生成数据优化Text Embedding
  • 张俊林:OpenAI o1的价值意义及强化学习的Scaling Law
  • 小伙伴们节日快乐
  • 一个因docker容器挂载引发的事故
  • Star马上破万,这款开源AI知识库你一定要看看
  • 中文排版指南(有点变态)
  • 写给大家看的中文排版指南!
  • 每个人都需要的中文排版指南
  • 中文文案排版指南:提升网站气质的开源项目
  • 高赞 GitHub 项目盘点:美观的中文排版样式
  • 中文网页终于有了排版规范
  • 中文网页重设与排版-typo.ss