js+css实现春夏秋冬动态视频背景环形进度倒计时计时器代码

代码语言:html

所属分类:其他

代码描述:js+css实现春夏秋冬动态视频背景环形进度倒计时计时器代码

代码标签: js css 春夏秋冬 动态 视频 背景 环形 进度 倒计时 计时器 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

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

<head>
  <meta charset="UTF-8">
  

  <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.min.css">
  
  
<style>
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

#video-background {
  position: fixed;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -1000;
  background-size: cover;
  filter: blur(5px);
  transform: scale(1.1);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: -999;
}

body {
  color: #fff;
  font-family: "Rubik", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 95vh;
}

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 210px;
  max-width: 100%;
  padding: 20px;
  box-sizing: border-box;
  transform: translateY(7px) scale(1);
  transition: transform 0.3s ease;
}

.countdown-container {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
}

.countdown-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-circle {
  fill: none;
  stroke: url(#calm-gradient);
  stroke-width: 10;
  stroke-linecap: round;
}

.countdown-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  font-family: "Orbitron", sans-serif;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.countdown-input-wrapper {
  position: relative;
  width: 100%;
  margin-top: 20px;
}

.countdown-input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid #ff69b4;
  color: #fff;
  padding: 10px 30px 10px 10px;
  font-family: "Rubik", sans-serif;
  text-align: center;
  font-size: 1em;
  box-sizing: border-box;
}

.countdown-input::-webkit-inner-spin-button,
.countdown-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.countdown-input[type="number"] {
  -moz-appearance: textfield;
}

.input-arrows {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.input-arrows i {
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  margin: 0px 0;
}

.button-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 20px;
}

.countdown-button {
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid #fff;
  color: #fff;
  padding: 10px 15px;
  font-family: "Rubik", sans-serif;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48%;
  position: relative;
}

.countdown-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.countdown-button i {
  margin-right: 5px;
  transition: transform 0.5s;
}

.countdown-button i.flipped {
  transform: rotate(180deg);
}

.season-icons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 20px;
}

.season-icon {
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.season-icon.active {
  color: inherit;
}

@keyframes moveGradient {
  0% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -283;
  }
}

.tooltip {
  visibility: hidden;
  width: 120px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.countdown-button:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
</style>


</head>

<body>
  <video autoplay muted loop id="video-background">
    <source src="//repo.bfw.wiki/bfwrepo/video/66e2ddff5216b.mp4" type="video/mp4">
    Your browser does not support the video tag.
  </video>
  <div class="overlay"></div>
  <div class="main-container" id="mainContainer">
    <div class="countdown-container">
      <svg class="countdown-svg" viewBox="0 0 100 100">
        <defs>
          <linearGradient id="calm-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
            <!-- Default Gradient for initial load -->
            <stop offset="0%" style="stop-color:#9a4e2b" />
            <stop offset="50%" style="stop-color:#693d1e" />
            <stop offset="100%" style="stop-color:#3b2416" />
          </linearGradient>
        </defs>
        <circle class="countdown-circle" cx="50" cy="50" r="45"></circle>
      </svg>
      <div class="countdown-text" id="countdown">00:00</div>
    </div>
    <div class="countdown-input-wrapper">
      <input type="number" class="countdown-input" id="timeInput" placeholder="Enter Seconds" min="1">
      <div class="input-arrows">
        <i class="fas fa-chevron-up" onclick="incrementTime()"></i>
        <i class="fas fa-chevron-down" onclick="decrementTime()"></i>
      </div>
    </div>
    <div class="button-container">
      <button class="countdown-button" onclick="startCountdown()" id="startButton">
        <i class="fa-solid fa-hourglass-start" id="startIcon"></i> Start
        <span class="tooltip"&.........完整代码请登录后点击上方下载按钮下载查看

网友评论0