CSS 动态提示框

​​在这里插入图片描述

<template>
<div class="terminal-loader">
  <div class="terminal-header">
    <div class="terminal-title">提示框</div>
    <div class="terminal-controls">
      <div class="control close"></div>
      <div class="control minimize"></div>
      <div class="control maximize"></div>
    </div>
  </div>
  <div class="text">温馨提示!</div>
</div>

</template>

<script>

</script>

<style>
@keyframes blinkCursor {
  50% {
    border-right-color: transparent;
  }
}

@keyframes typeAndDelete {
  0%,
  10% {
    width: 0;
  }
  45%,
  55% {
    width: 200rpx;
  } /* adjust width based on content */
  90%,
  100% {
    width: 0;
  }
}

.terminal-loader {
  border: 0.1em solid #333;
  background-color: #1a1a1a;
  color: #0f0;
  font-family: "Courier New", Courier, monospace;
  font-size: 1em;
  padding: 1.5em 1em;
  width: 200rpx;
  margin: 100px auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  height: auto;
}

.terminal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background-color: #333;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  padding: 0 0.4em;
  box-sizing: border-box;
}

.terminal-controls {
  float: right;
}

.control {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.4em;
  border-radius: 50%;
  background-color: #777;
}

.control.close {
  background-color: #e33;
}

.control.minimize {
  background-color: #ee0;
}

.control.maximize {
  background-color: #0b0;
}

.terminal-title {
  float: left;
  line-height: 2em;
  color: #eee;
  font-size: 15rpx;
}

.text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 0.2em solid green; /* Cursor */
  animation: typeAndDelete 4s steps(11) infinite,
    blinkCursor 0.5s step-end infinite alternate;
  margin-top: 1.5em;
  word-wrap: break-word;
}

</style>

教学视频地址

点击跳转教学视频

相关推荐

  1. css去除滑动

    2023-12-31 05:48:04       16 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-31 05:48:04       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-31 05:48:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-31 05:48:04       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-31 05:48:04       20 阅读

热门阅读

  1. LC 1185. 一周中的第几天

    2023-12-31 05:48:04       40 阅读
  2. R语言孟德尔随机化研究工具包(1)---friendly2MR

    2023-12-31 05:48:04       42 阅读
  3. Python装饰器

    2023-12-31 05:48:04       39 阅读
  4. k8s学习 — 各章节重要知识点

    2023-12-31 05:48:04       38 阅读
  5. k8s的网络类型

    2023-12-31 05:48:04       30 阅读
  6. GitHub Copilot 快速入门

    2023-12-31 05:48:04       37 阅读
  7. k8s学习 — (运维)第十一章 ELK 日志管理

    2023-12-31 05:48:04       30 阅读
  8. XAMPP for Windows 8.0.30, 8.1.25 & 8.2.12

    2023-12-31 05:48:04       37 阅读
  9. GitHub Copilot 快速入门

    2023-12-31 05:48:04       37 阅读