div+css实现飞机订票按钮悬浮变形成飞机动画效果代码

代码语言:html

所属分类:悬停

代码描述:div+css实现飞机订票按钮悬浮变形成飞机动画效果代码

代码标签: div css 飞机 订票 按钮 悬浮 动画

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

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

<head>
  <meta charset="UTF-8">
  

<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
  
  
  
<style>
:root {
  --wingRadius: 0px;
  --dkBlue: #147ff8;
  --ltBlue: #549ff9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: grid;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

i {
  font-size: 2.5em;
  padding: 0;
  margin: 0;
}

#button-container {
  position: relative;
}
#button-container button {
  border-radius: 10px;
  font-size: 1.25em;
  font-family: "Montserrat", sans-serif;
  position: relative;
  transition: all 0.4s ease-in-out;
  cursor: pointer;
  transform-origin: center center;
  border-color: #004ab2;
}
#button-container button span {
  display: block;
  padding: 10px 50px;
  position: relative;
  z-index: 100;
  border-radius: 10px;
  transition: all 0.4s ease-in-out;
  background-color: #e1effe;
  background: linear-gradient(to bottom, #e1effe 0%, rgba(179, 221, 253, 0.65) 50%, #e1effe 100%);
  text-transform: uppercase;
  border-color: #004ab2;
  color: #004ab2;
  font-weight: 700;
}
#button-container button .tail {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  margin: auto;
  height: 5px;
  width: 0px;
  z-index: 100;
  background-color: var(--dkBlue);
  transform-origin: right center;
  transition: all 0.4s ease-in-out;
}
#button-container button .tail:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0px;
  background-color: var(--ltBlue);
  transform-origin: right center;
  transition: all 0.4s ease-in-out;
}
#button-container button .windows {
  position: absolute;
  display: flex;
  justify-content: space-between;
  width: 100px;
  left: 35%;
  margin: auto;
  z-index: 111;
}
#button-container button .windows i {
  border-radius: 5px;
  width: 0px;
  height: 10px;
  background-color: var(--ltBlue);
  transition: all 0.4s ease-in-out;
  transform-origin: center center;
}
#button-container button .windows.left {
  top: 3px;
}
#button-container button .windows.right {
  bottom: 3px;
}
#button-container button .wing,
#button-container button .stabilizer {
  background-color: var(--dkBlue);
  position: absolute;
  transition: all 0.5s ease-in-out;
  z-index: -1;
}
#button-container button .wing.left,
#button-container button .stabilizer.left {
  bottom: 99%;
  transform-origin: bottom right;
  clip-path: polygon(0 0, 50% 0, 100% 100%, 25% 100%);
  border-top-left-radius: var(--wingRadius);
  border-top-right-radius: var(--wingRadius);
  border-top: 5px solid var(--ltBlue);
}
#button-container button .wing.right,
#button-container button .stabilizer.right {
  top: 100%;
  transform-origin: top right;
  clip-path: polygon(25% 0, 100% 0, 50% 100%, 0 100%);
  border-bottom-left-radius: var(--wingRadius);
  border-bottom-right-radius: var(--wingRadius);
  border-bottom: 5px solid var(--ltBlue);
}
#button-container button .wing {
  height: 3em;
  width: 3em;
}
#button-container button .wing.left, #button-container button .wing.right {
  left: 35%;
}
#button-container button .wing.left {
  clip-path: polygon(0 0, 40% 0, 100% 100%, 40.........完整代码请登录后点击上方下载按钮下载查看

网友评论0