js+css实现星球大战倒计时效果代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现星球大战倒计时效果代码

代码标签: 倒计时 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap");
body {
  background: whitesmoke;
  font-family: "Major Mono Display", monospace;
  font-size: 62.5%;
}

section {
  min-width: 500px;
}

.wrapper {
  color: whitesmoke;
  height: 500px;
  margin-top: 20px;
  position: relative;
}

.ui {
  margin: 20px auto;
  text-align: center;
  width: 160px;
}

input[type=checkbox] {
  vertical-align: middle;
}

.centered {
  position: absolute;
  text-align: center;
  width: 100%;
}

.timeOutput {
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.8rem;
  top: 50%;
  transform: translateY(-50%);
}
.timeOutput .small {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: normal;
  line-height: 0.7rem;
  margin-bottom: 5px;
  max-width: 143px;
}
</style>


</head>

<body >
  <section class="wrapper">
	<div class="canvas centered"></div>
	<div class="timeOutput centered"></div>
</section>
<section class="ui">
	<label>Animated edge:<input id="toggle" type="checkbox" checked></label>
</section>

  
      <script >
// Respect user System animation preference
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
let userAllowsAnimation = !mediaQuery || mediaQuery.matches ? false : true;
mediaQuery.addEventListener('change', () => {
  userAllowsAnimation = mediaQuery.matches ? false : true;
  setAnimationOption();
});
const toggle = document.que.........完整代码请登录后点击上方下载按钮下载查看

网友评论0