css+js实现科技风格表格分页悬浮滚动翻页效果代码

代码语言:html

所属分类:表格

代码描述:css+js实现科技风格表格分页悬浮滚动翻页效果代码,支持鼠标滚轮滚动翻页,支持鼠标悬浮动画,自带总数进度条。

代码标签: css js 科技 风格 表格 分页 悬浮 滚动 翻页

下面为部分代码预览,完整代码请点击下载或在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.6.4.0.css">
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900;1000&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
body {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: linear-gradient(#00121B, #000102);
  overflow: hidden;
  font-family: "Cairo", sans-serif;
}

.d-flex {
  display: flex;
}

.row {
  flex-direction: row;
}

.flex-fill {
  flex: 1 1 auto;
  width: 100%;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-start {
  justify-content: flex-start;
}

.justify-content-end {
  justify-content: flex-end;
}

.align-items-center {
  align-items: center;
}

.align-items-start {
  align-items: flex-start;
}

.align-items-end {
  align-items: flex-end;
}

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0turn;
}
@keyframes conic-rotate {
  to {
    --angle: 1turn;
  }
}
.table-container {
  position: relative;
  display: flex;
  width: 85vw;
  height: calc(((var(--data-limit) + 1) * 2rem) + 10rem);
  transform-style: preserve-3d;
  box-shadow: inset 0 -0.5rem 1rem rgba(0, 18, 27, 0.5), inset 0 0 1rem rgba(127, 255, 212, 0.3);
  border: 2px solid rgba(127, 255, 212, 0.5);
  border-radius: 1rem;
  flex-direction: column;
}
.table-container::before {
  position: absolute;
  display: flex;
  content: "";
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: conic-gradient(from var(--angle), #80FF80, rgba(127, 255, 212, 0.5), #80FF80, royalblue, #80FF80);
  filter: blur(0.5rem);
  transform: translatez(-2px);
  z-index: -2;
  opacity: 0.99;
  animation: conic-rotate 12s infinite linear;
}
.table-container::after {
  position: absolute;
  display: flex;
  content: "";
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 18, 27, 0.95);
  transform: translatez(-1px);
  z-index: -1;
  border-radius: inherit;
}

.table {
  position: relative;
  display: flex;
  width: 100%;
  padding: 1rem 0 0 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(90deg, transparent, rgba(128, 255, 128, 0.15), transparent);
  -webkit-background-image: linear-gradient(90deg, transparent, rgba(128, 255, 128, 0.15), transparent);
  overflow: hidden;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}
.table .table-row {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: inherit;
  width: calc(100% - 4rem);
  padding: 0 2rem;
  transition: opacity 0.5s;
}
.table .table-row:nth-child(2n) {
  background-color: rgba(0, 0, 0, 0.1);
}
.table .table-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: inherit;
  flex: 1 1 0;
  height: 2rem;
  justify-content: center;
  align-items: flex-start;
  color: #7FFFD4;
  text-shadow: 0 0 0.5rem rgba(127, 255, 212, 0.6);
  font-size: calc(0.390625vw + 12px);
  padding: 0 1rem;
  cursor: pointer;
  white-space: nowrap;
}
.table .table-col span {
  position: relative;
  display: flex;
  cursor: pointer;
}
.table .table-col span::before, .table .table-col span::after {
  position: absolute;
  display: flex;
  content: "";
  height: 70%;
  width: 0.3rem;
  border-top: 2px solid #7FFFD4;
  border-bottom: 2px solid #7FFFD4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.table .table-col span::before {
  border-left: 2px solid #7FFFD4;
  left: 0;
  top: 50%;
  transform: translate(-0.5rem, -50%) scale(0.6) rotate(20deg);
}
.table .table-col span::after {
  border-right: 2px solid #7FFFD4;
  right: 0;
  top: 50%;
  transform: translate(0.5rem, -50%) scale(0.6) rotate(20deg);
}
.table .table-col span:hover::before {
  opacity: 1;
  transform: translate(-1rem, -50%) scale(0.8) rotate(0deg);
}
.table .table-col span:hover::after {
  opacity: 1;
  transform: translate(1rem, -50%) scale(0.8) rotate(0deg);
}
.table .table-heading .table-col {
  color: #80FF80 !important;
  text-shadow: 0 0 0.5rem rgba(128, 255, 128, 0.6);
  font-weight: 600;
  text-transform: uppercase;
}

.pagination-container {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 1.5rem;
  padding-top: 1rem;
  flex-direction: column;
}

.pagination-wrapper {
  position: relative;
  display: flex;
  height: fit-content;
  overflow: hidden;
  justify-content: flex-start;
  width: 20rem;
}

.pagination {
  position: relative;
  display: flex;
  flex-direction: row;
  list-style-type: none;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: flex-start;
  transition: transform 0.5s;
}
.pagination > li {
  position: relative;
  display: flex;
  width: 4rem;
  max-width: 4rem;
  flex: 0 0 auto;
  height: 3rem;
  justify-content: center;
  align-items: center;
  color: #80FF80;
  font-size: calc(0.390625vw + 18px);
  z-index: 5;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 0 0.4rem rgba(128, 255, 128, 0.6);
}
.pagination > li span {
  pointer-events: none;
}
.pagination > li.active span {
  position: relative;
  display: flex;
  height: 2.5rem;
  padding: 0 1rem;
  font-weight: bolder;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(45deg, rgba(128, 255, 128, 0.1), rgba(0, 18, 27, 0.4));
  border: 1px solid rgba(128, 255, 128, 0.3);
  color: #b2ffe5;
  border-radius: 5px;
  text-shadow: 0 0 0.4rem rgba(178, 255, 229, 0.6);
}

.pagination-info {
  position: absolute;
  display: flex;
  font-size: calc(0.390625vw + 10px);
  color: #acd3ac;
  bottom: 4.5rem;
  text-shadow: 0 0 0.5rem rgba(172, 211, 172, 0.5);
}

.pagination-extreme {
  position: relative;
  display: flex;
  height: 3rem;
  width: 10rem;
  border: none;
  background-color: transparent;
  border-radius: 5px;
  justify-content: center;
  align-items: center;
  color: #80FF80;
  font-size: calc(0.390625vw + 15px);
  cursor: pointer;
  transition: transform 0.3s;
}
.pagination-extreme:hover {
  transform: scale(1.4);
}

.progress-bar {
  position: relative;
  display: flex;
  width: calc(100% - 6rem);
  height: 2px;
  background-color: rgba(127, 255, 212, 0.1);
  border-radius: 2px;
  margin: 0 3rem 2rem 3rem;
}
.progress-bar .progress-point {
  position: absolute;
  display: flex;
  height: 0.5rem;
  width: 0.5rem;
  background-color: #004c32;
  border-radius: 50%;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  transition: left 0.5s;
}

.infos {
  position: absolute;
  display: flex;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Cairo", sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
  justify-content: center;
  align-items: center;
  height: 6rem;
  font-size: calc(0.390625vw + 12px);
  line-height: 24px;
  font-weight: 600;
  background-color: #80FF80;
  background-image: linear-gradient(45deg, royalblue, #80FF80, #7FFFD4);
  -webkit-background-image: linear-gradient(45deg, #80FF80, royalblue, #7FFFD4);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 0.4rem rgba(127, 255, 212, 0.4);
}
</style>

  
</head>

<body>
  <p class="infos">
	You can switch pages using your mouse wheel !<br />
	The amount of rows per pages depends on the height of your window when loading the page.
</p>

<div class="table-container" style="--data-limit: 9">
	<div class="table" id="table-0" data-limit="9">
		<div class="table-row table-heading">
			<div class="table-col">
				#
			</div>
			<div class="table-col">
				First name
			</div>
			<div class="table-col">
				Last name
			</div>
			<div class="table-col">
				Title
			</div>
			<div class="table-col">
				Completed
			</div>
		</div>
		<div class="table-row" data-copy="103">
			<div class="table-col">
				<span class="auto-increment">0</span>
			</div>
			<div class="table-col">
				<span class="auto-firstname"></span>
			</div>
			<div class="table-col">
				<span class="auto-lastname"></span>
			</div>
			<div class="table-col">
				<span class="auto-title"></span>
			</div>
			<div class="table-col">
				<span class="auto-integer" min="0" max="250"></span>
			</div>
		</div>
	</div>

	<div class="pagination-container">
		<div class="d-flex row flex-fill align-items-end justify-content-center">
			<span class="pagination-info"></span>
			<button class="pagination-extreme pagination-left">
				<i class="fa-solid fa-angles-left"></i>
			</button>
			<button class="pagination-extreme pagination-left-one">
				<i class="fa-solid fa-angle-left"></i>
			</button>
			<div class="d-flex flex-fill justify-content-center">
				<div class="pagination-wrapper">
					<ul class="pagination" data-table="tabl.........完整代码请登录后点击上方下载按钮下载查看

网友评论0