css布局实现啤酒瓶饮料饮品容器杯子效果代码

代码语言:html

所属分类:布局界面

代码描述:css布局实现啤酒瓶饮料饮品容器杯子效果代码

代码标签: css 啤酒 饮料 饮品 容器 杯子

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    html {
  --beer: #674d06;
  --beer-glass: #e29121;
  --beer-foam: #f9e1b6;
  --beer-bubble: #e29121;
  --beer-glass-detail: #e2c165;
  --cocktail1: #ee3636;
  --cocktail2: #c61414;
  --cocktail3: #b50505;
  --cocktail-glass: #ffd4bf;
  --straw: #ffffff;
  --straw-stripe: #0d5ec6;
  --whisky-glass: #a1c1c1;
  --whisky: #b56a06;
  --ice: #9ef6ff;
}

body {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background-color: black;
  min-height: 100vh;
}

#beer,
#cocktail,
#whisky {
  width: 200px;
  height: 200px;
  position: relative;
}

/*BEER*/
#glass {
  width: 50%;
  height: 60%;
  position: absolute;
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--beer);
  border-radius: 0.2em 0.2em 2em 2em;
  border-style: solid;
  border-color: var(--beer-glass);
  border-width: 0.6em 0.5em 1.1em 0.5em;
}
#glass .foam.drip {
  -webkit-animation-name: beerDrip;
          animation-name: beerDrip;
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}
#glass .foam.drip:nth-child(1) {
  top: -0.8em;
  left: -1em;
  width: 0.7em;
  height: 0em;
  border-radius: 0.6em;
  -webkit-animation-duration: 10s;
          animation-duration: 10s;
}
#glass .foam.drip:nth-child(2) {
  top: 0.4em;
  left: 0.5em;
  width: 1.2em;
  height: 0em;
  border-radius: 0.6em;
  -webkit-animation-duration: 7s;
          animation-duration: 7s;
}
#glass .foam {
  background-color: var(--beer-foam);
  position: absolute;
  border-radius: 50%;
  z-index: 1;
}
#glass .foam:nth-child(1) {
  top: -1.8em;
  left: -1em;
  width: 3em;
  height: 3em;
}
#glass .foam:nth-child(2) {
  top: -2em;
  left: 1.4em;
  width: 3.7em;
  height: 3.7em;
}
#glass .foam:nth-child(3) {
  top: -1.8em;
  left: 4.4em;
  width: 3em;
  height: 3em;
}
#glass .foam:nth-child(3):after {
  content: "";
  display: block;
}
#glass .foam.........完整代码请登录后点击上方下载按钮下载查看

网友评论0