css实现拉伸的咖啡loading加载动画效果代码
代码语言:html
所属分类:加载滚动
代码描述:css实现拉伸的咖啡loading加载动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<style>
* {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--hue: 223;
--bg: hsl(var(--hue),10%,90%);
--fg: hsl(var(--hue),10%,10%);
--primary: hsl(var(--hue),90%,55%);
--trans-dur: 0.3s;
font-size: calc(16px + (20 - 16) * (100vw - 320px) / (1280 - 320));
}
body {
background-color: var(--bg);
color: var(--fg);
font: 1em/1.5 sans-serif;
height: 100vh;
display: grid;
place-items: center;
transition:
background-color var(--trans-dur),
color var(--trans-dur);
}
.coffee {
font-size: 0.6em;
position: relative;
width: 21.5em;
height: 9em;
}
.coffee:before {
border-bottom: 0.25em dashed;
content: "";
display: block;
position: absolute;
top: 7.5em;
width: 100%;
}
.coffee__cup,
.coffee__cup-part,
.coffee__cup-handle,
.coffee__steam-part {
animation-duration: 8s;
animation-iteration-count: infinite;
}
.coffee__cup,
.coffee__cup-part,
.coffee__cup-handle {
animation-timing-function: cubic-bezier(0.9,0,0.1,1);
}
.coffee__cup {
animation-name: cup;
position: relative;
width: 11.25em;
height: 9em;
}
.coffee__cup-part {
background-color: var(--bg);
position: absolute;
transition.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0