jquery+css实现8款精美带指针走动的精美数字时钟效果代码

代码语言:html

所属分类:其他

代码描述:jquery+css实现8款精美带指针走动的精美数字时钟效果代码

代码标签: jquery css 8款 精美 指针 走动 精美 数字 时钟

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

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

<head>
  <meta charset="UTF-8">
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

body {
  background: #f5f5f5;
  min-height: 100vh;
  margin: 0;
  padding: 40px 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: #333;
}

h1 {
  font-weight: 600;
  font-size: 2.5rem;
  color: #101828;
	text-align: center;
	display: block;
	margin-top: 1em;
	margin-bottom: 1em;
	font-weight: bold;
}

.container {
  display: flex;
  gap: 40px;
  padding: 20px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center

}

.card {
  background: white;
  border-radius: 24px !important;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
  width: 356px;
  height: 426px;
  display:flex;
  align-items: center;
  justify-content: center
}

.card::after {
  content: attr(data-description);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #F5F5F5;
background: linear-gradient(0deg,rgba(245, 245, 245, 1) 0%, rgba(245, 245, 245, 0.8) 39%, rgba(255, 255, 255, 0) 100%);
  color: #191919;
  padding: 30px;
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 12;
  height: calc(100% - 60px);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.card:hover::after {
  opacity: 1;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  position: absolute;
  top: 40px;
  left: 0;
  text-align: center;
    width: 100%;
  display:block;
  z-index: 99
}

.card p {
  margin-top: 0;
  margin-bottom: 20px;
  color: #666;
  font-size: 14px;
}

.clock-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  display:flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px
}

.clock-face {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
}

.hour-marks {
  position: absolute;
  width: 100%;
  height: 100%;
}

.hour-mark {
  position: absolute;
  left: 50%;
  transform-origin: 0 140px;
}

.minute-mark {
  position: absolute;
  left: 50%;
  transform-origin: 0 140px;
}

.hour-number {
  position: absolute;
  text-align: center;
  transform-origin: center;
}

.hand {
  position: absolute;
  transform-origin: bottom center;
  bottom: 140px;
  left: 140px;
}

.skeuomorphic {
background: #F5F5F5;
background: linear-gradient(140deg,rgba(245, 245, 245, 1) 0%, rgba(230, 230, 230, 1) 50%, rgba(214, 214, 214, 1) 100%);
}

.skeuomorphic .clock-container {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  box-shadow: rgba(0, 0, 0, 0.07) 0px 1px 2px, rgba(0, 0, 0, 0.07) 0px 2px 4px, rgba(0, 0, 0, 0.07) 0px 4px 8px, rgba(0, 0, 0, 0.07) 0px 8px 16px, rgba(0, 0, 0, 0.07) 0px 16px 32px, rgba(0, 0, 0, 0.07) 0px 32px 64px;
    0 2px 5px rgba(0, 0, 0, 0.3);
  border: 8px solid #fff;
  border-radius: 50%;
}

.skeuomorphic .clock-face {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.1),
    0 2px 5px rgba(0, 0, 0, 0.3);

}

.skeuomorphic .clock-reflection {
  position: absolute;
  width: 260px;
  height: 130px;
  top: 20px;
  left: 10px;
  border-radius: 130px 130px 0 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 11;
}

.skeuomorphic .clock-center {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #333;
  border-radius: 50%;
  top: 133px;
  left: 133px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.skeuomorphic .clock-center::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: #888;
  border-radius: 50%;
  top: 4px;
  left: 4px;
}

.skeuomorphic .hour-mark {
  width: 4px;
  height: 12px;
  background: #333;
  margin-left: -2px;
}

.skeuomorphic .minute-mark {
  width: 2px;
  height: 6px;
  background: #666;
  margin-left: -1px;
}

.skeuomorphic .hour-number {
  font-size: 24px;
  font-weight: 500;
  color: #333;
  width: 40px;
  height: 40px;
  line-he.........完整代码请登录后点击上方下载按钮下载查看

网友评论0