js实现足球球员主客场分布图动态展示交互效果代码

代码语言:html

所属分类:三维

代码描述:js实现足球球员主客场分布图动态展示交互效果代码

代码标签: 球员 主客场 分布图 动态 展示 交互 效果

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

<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title></title>

<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<style>
    * {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  font-size: 62.5%;
  padding: 0;
  margin: 0;
}
.velocity-animating {
  -webkit-transition: none !important;
  transition: none !important;
}
body {
  background-image: -webkit-radial-gradient(ellipse, #2a437c 0, #10203b 100%);
  font-family: 'Open Sans', helvetica, arial, sans-serif;
}
main {
  opacity: 0;
}
.static {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: #fff;
  text-align: center;
  padding: 0;
  z-index: 3;
}
.static h1 {
  margin: 50px 0 15px;
  font-size: 50px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 42px;
  letter-spacing: -3px;
  font-family: montserrat;
}
.static p {
  font-weight: 300;
  opacity: 0.4;
  margin: 0 0 20px;
  font-size: 16px;
  color: #7f98d3;
}
.loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  height: 16px;
  line-height: 16px;
  color: #fff;
  font-family: 'montserrat';
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1px;
  text-align: center;
  opacity: 0;
}
.team-list {
  position: absolute;
  left: 40px;
  top: 100px;
  list-style: none;
  display: none;
}
.team-list li:first-child {
  color: #fff;
  font-weight: bold;
}
.team-list li {
  font-size: 1.4rem;
  margin: 0 0 10px;
  color: #7f98d3;
}
.stage {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  -webkit-perspective-origin: 50% -200px;
          perspective-origin: 50% -200px;
  -webkit-perspective: 1100px;
          perspective: 1100px;
  z-index: 1;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.world {
  position: absolute;
  top: 130px;
  left: 50%;
  margin-left: -336px;
  width: 672px;
  height: 840px;
  -webkit-transform: translateZ(-210px);
          transform: translateZ(-210px);
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  z-index: 1;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.world.flipped {
  -webkit-transform: translateZ(-210px) rotateY(180deg);
          transform: translateZ(-210px) rotateY(180deg);
}
.world.switched {
  -webkit-transform: translateZ(250px) rotateY(30deg) translateX(60px) translateY(-200px);
          transform: translateZ(250px) rotateY(30deg) translateX(60px) translateY(-200px);
}
.switch-btn {
  display: inline-block;
  padding: 6px 15px;
  border: solid 1px #7f98d3;
  border-radius: 5px;
  text-align: center;
  color: #7f98d3;
  text-decoration: none;
  opacity: 1;
  font-size: 12px;
  -webkit-transition: all 0.15s;
  transition: all 0.15s;
}
.switch-btn.disabled {
  background: #7f98d3;
  color: #2a437c;
  cursor: default;
}
.switch-btn.disabled:hover {
  color: #2a437c;
}
.switch-btn:hover {
  color: #fff;
}
.switch-btn:first-child {
  border-radius: 10px 0 0 10px;
  border-right: none;
}
.switch-btn:last-child {
  border-radius: 0 10px 10px 0;
}
.team {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
}
.terrain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-transform-style: inherit;
          transform-style: inherit;
}
.field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #eee;
  z-index: 2;
  -webkit-transform: rotateX(90deg) translateZ(0);
          transform: rotateX(90deg) translateZ(0);
  -webkit-transform-origin: 50% 50%;
          transform-origin: 50% 50%;
  box-sizing: content-box;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.field--alt {
  display: block;
  width: 80%;
  left: 10%;
  -webkit-transform: rotateX(90deg) translateZ(-10px);
          transform: rotateX(90deg) translateZ(-10px);
  background: #000;
  opacity: 0.3;
  box-shadow: 0 0 40px 30px #000;
}
.field__texture {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 3;
}
.field__texture.field__texture--gradient {
  background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.2), transparent);
  background-image: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
  z-index: 4;
}
.flipped .field__texture.field__texture--gradient {
  opacity: 0;
}
.field__texture.field__texture--gradient-b {
  opacity: 0;
  background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.2), transparent);
  background-image: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent);
  z-index: 4;
}
.flipped .field__texture.field__texture--gradient-b {
  opacity: 1;
}
.texture .field__texture.field__texture--grass {
  background-image: url("//repo.bfw.wiki/bfwrepo/images/football/grass2.png");
  background-repeat: repeat;
  background-size: 75px 75px;
  background-position: -20px -20px;
}
.field__side {
  position: absolute;
  top: 420px;
  left: 0;
  width: 100%;
  height: 8px;
  -webkit-transform: rotateX(180deg) translateZ(-420px);
          transform: rotateX(180deg) translateZ(-420px);
  -webkit-transform-origin: 50% 50%;
          transform-origin: 50% 50%;
  background-color: #f7f7f7;
  z-index: 9;
}
.texture .field__side {
  background-color: #000;
}
.texture .field__side:after {
  content: "";
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: absolute;
  opacity: 0.55;
  background-image: url("//repo.bfw.wiki/bfwrepo/images/football/mud.png");
  background-repeat: repeat;
  background-size: 75px 75px;
  background-position: -20px -20px;
}
.field__side.field__side--left,
.field__side.field__side--right {
  top: 0;
  left: -8px;
  height: 100%;
  width: 8px;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0