css实现三维盒子点击打开产品商品切换效果代码

代码语言:html

所属分类:其他

代码描述:css实现电商三维盒子点击打开产品商品详细信息切换效果代码

代码标签: css 三维 盒子 打开 切换 商品

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

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
    
:root {
  --duration: .6s;
  --ease: cubic-bezier(.5, 0, .5, 1);
  --fast-ease-out: cubic-bezier(.4,0,.9,.1);
  --fast-ease-in: cubic-bezier(.1,.9,.3,1);
  --fade-ease: cubic-bezier(.7,0,.1,1);
  --tan-dark: #AF957D;
  --tan: #E9CFB9;
  --orange: #FC7B1C;
  --orange-dark: #DE762A;
  font-family: "Roboto Condensed", sans-serif;
}

*,
*:before,
*:after {
  position: relative;
  box-sizing: border-box;
}

img {
  display: block;
  max-width: 100%;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #E4C7B3;
}

#app {
  background: white;
  height: 90vmin;
  width: 50vmin;
  background: #EAEAEC;
  border-radius: 8vmin;
  border: 2vmin solid white;
}

.shoe-selector {
  display: grid;
  grid-template: 1 / 1;
  justify-content: center;
  align-items: center;
  height: 90%;
}
.shoe-selector:before {
  content: '';
  height: 10vmin;
  width: 10vmin;
  position: absolute;
  background-color: #3E474E;
  border-radius: 50%;
  bottom: -5vmin;
  left: calc(50% - 5vmin);
  z-index: 10;
}

/* ---------------------------------- */
.shoe {
  height: 100%;
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: 50% auto 1fr auto;
  padding: 1rem;
}
.shoe:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-image: linear-gradient(to bottom, transparent, transparent 40%, white);
  border-radius: 1rem;
}
.shoe > .shoebox {
  grid-column: 1 / -1;
}
.shoe > .shoe-header {
  grid-column: 1 / -1;
}
.shoe > .shoe-price {
  grid-column: 1 / -1;
}
.shoe > .shoe-rating {
  grid-column: 1 / 2;
}

.shoe-header {
  text-align: center;
}

.shoe-subheading {
  display: inline-block;
  text-transform: uppercase;
  color: #777;
  margin-bottom: .5rem;
}

.shoe-heading {
  margin: 0;
  font-weight: 300;
  font-size: 1.25rem;
}

.shoe-price {
  display: inline-block;
  text-align: center;
  font-size: 3rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
}
.shoe-price &.........完整代码请登录后点击上方下载按钮下载查看

网友评论0