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

html加载页面

 

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>算数模一体化</title>
</head>

<body>
  <div class="content">
    <div class="loader JS_on">
      <span class="binary"></span>
      <span class="binary"></span>
    </div>
    <span class="getting-there">当前模型训练【模型名称】加载中...</span>
    <div class="progress-bar" id="myElement"></div>
  </div>
  <style>
    html,
    body {
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #2D4654;
    }

    .content {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .loader {
      width: 130px;
      height: 170px;
      position: relative;

      &::before,
      &::after {
        content: "";
        width: 0;
        height: 0;
        position: absolute;
        bottom: 30px;
        left: 15px;
        z-index: 1;
        border-left: 50px solid transparent;
        border-right: 50px solid transparent;
        border-bottom: 20px solid #1b2a33;
        transform: scale(0);
        transition: all 0.2s ease;
      }

      &::after {
        border-right: 15px solid transparent;
        border-bottom: 20px solid #162229;
      }

      .binary {
        width: 100%;
        height: 140px;
        display: block;
        color: white;
        position: absolute;
        top: 0;
        left: 15px;
        z-index: 2;
        overflow: hidden;

        &::before,
        &::after {
          font-family: "Lato";
          font-size: 24px;
          position: absolute;
          top: 0;
          left: 0;
          opacity: 0;
        }

        &:nth-child(1) {
          &::before {
            content: "0";
            animation: a 1.1s linear infinite;
          }

          &::after {
            content: "0";
            animation: b 1.3s linear infinite;
          }
        }

        &:nth-child(2) {
          &::before {
            content: "1";
            animation: c 0.9s linear infinite;
          }

          &::after {
            content: "1";
            animation: d 0.7s linear infinite;
          }
        }
      }

      &.JS_on {

        &::before,
        &::after {
          transform: scale(1);
        }
      }
    }

    @keyframes a {
      0% {
        transform: translate(30px, 0) rotate(30deg);
        opacity: 0;
      }

      100% {
        transform: translate(30px, 150px) rotate(-50deg);
        opacity: 1;
      }
    }

    @keyframes b {
      0% {
        transform: translate(50px, 0) rotate(-40deg);
        opacity: 0;
      }

      100% {
        transform: translate(40px, 150px) rotate(80deg);
        opacity: 1;
      }
    }

    @keyframes c {
      0% {
        transform: translate(70px, 0) rotate(10deg);
        opacity: 0;
      }

      100% {
        transform: translate(60px, 150px) rotate(70deg);
        opacity: 1;
      }
    }

    @keyframes d {
      0% {
        transform: translate(30px, 0) rotate(-50deg);
        opacity: 0;
      }

      100% {
        transform: translate(45px, 150px) rotate(30deg);
        opacity: 1;
      }
    }

    .getting-there {
      text-align: center;
      font-family: "Lato";
      font-size: 16px;
      letter-spacing: 2px;
      color: white;
    }

    .progress-bar {
      background-color: #fff;
      width: 300px;
      height: 16px;
      box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.25), 0px 1px 2px rgba(0, 0, 0, 0.25);
      border-radius: 10px;
      position: relative;
      margin-top: 10px;
    }

    .progress-bar:after {
      content: "";
      background-color: rgb(66, 195, 247);
      position: absolute;
      border-radius: 10px;
      width: var(--after-width, 0%);
      height: 100%;
      top: 0px;
      left: 0px;
    }
  </style>
  <script>
    function changeWidth() {
      const xhr = new XMLHttpRequest()
      xhr.open('get', '/xxx/abc', true)
      xhr.onload = function (data) {
        if (xhr.status === 200) {
          const data = JSON.parse(xhr.response)
          console.log(data)
          var element = document.getElementById('myElement');
          element.style.setProperty('--after-width', `50%`);
        }
      }
      xhr.send(JSON.stringify({}))
    }
    setInterval(function () {
      // location.reload();
      changeWidth()
    }, 2000)
  </script>
  </div>
</body>

</html>


http://www.kler.cn/news/306145.html

相关文章:

  • android 14.0 USB连接模式默认设为MTP
  • matlab data = textscan(lin(5:end),‘%f%f%f%f%*[^\n]‘);语句解释
  • 大棚分割数据集,40765对影像,16.9g数据量,0.8米高分二,纯手工标注(arcgis标注)的大规模农业大棚分割数据集。
  • 字典+泛型的栈与队列+委托
  • SpringBoot接口开发总结
  • “树”据结构:并查集从入门到AC
  • MATLAB基础语法知识
  • MySQL指令
  • linux 操作系统下的cut命令介绍和使用案例
  • JavaScript控制语句和函数的使用
  • Python Numpy布尔数组在数据分析中的应用
  • 思维商业篇(3)—三大竞争战略
  • 【安全系列--处理挖矿】
  • Centos 执行yum安装 出现Failed connect to mirrors.163.com:80; 拒绝连接
  • Golang | Leetcode Golang题解之第409题最长回文串
  • Java中的服务端点响应缓存:Spring Cache抽象
  • ★ C++基础篇 ★ string类的实现
  • Python实现pdf转图片、转文字、去水印
  • 房产销售系统开发:SpringBoot技术要点
  • 避免 PyCharm 将该 Python 脚本作为测试运行
  • 串口数据波形显示工具对比
  • k8s service如何实现流量转发
  • Python 课程10-单元测试
  • 基于 TDMQ for Apache Pulsar 的跨地域复制实践
  • 2024.9.14 Python与图像处理新国大EE5731课程大作业,马尔可夫随机场和二值图割,校正立体图像的深度
  • 攻击者如何在日常网络资源中隐藏恶意软件
  • rust + bevy 实现小游戏 打包成wasm放在浏览器环境运行
  • Vue3使用Websocket进行跨页面通信
  • 2024年金九银十最新版Java面试题及答案整理(持续更新)
  • 从单体到微服务:FastAPI ‘挂载’子应用程序的转变