css云朵下雨动画效果
代码语言:html
所属分类:动画
代码描述:css云朵下雨动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> :root { --background-color: #0C3451 } body{ background: var(--background-color); } .box-canvas{ position: relative; margin: auto; display: block; margin-top: 10vmin; margin-bottom: 10vmin; width: 80vmin; height: 80vmin; overflow: hidden; } .rain { position: absolute; width: 70vmin; height: 160vmin; -webkit-transform: rotate(25deg); transform: rotate(25deg); -webkit-transform-origin: top left; transform-origin: top left; left: 18vmin; display: -webkit-box; display: flex; padding-left: 10vmin; } .stream { width: 1vmin; height: 160vmin; background: repeating-linear-gradient( #5F9ECC, #5F9ECC 2vmin, transparent 2vmin, transparent 5vmin ); margin-right: 3vmin; -webkit-animation: rain 2s infinite linear; animation: rain 2s infinite linear; } @-webkit-keyframes rain { 0% { -webkit-transform: translateY(-80vmin); transform: translateY(-80vmin); } 100% { -webkit-transform: none; transform: none; } } @keyframes rain { 0% { -webkit-transform: translateY(-80vmin); transform: translateY(-80vmin); } 100% { -webkit-transform: none; transform: none; } } .cloud { --cloud-color: #7F7F7F; --highlight-color: #D3D3D3; position: absolute; width: 80vmin; height: 40vmin; background: var(--background-color); } .floof { position: absolute; background: var(--cloud-color); border-radius: 50%; } .floof:nth-child(1) { top: 2vmin; left: 20vmin; width: 40vmin; height: 20vmin; box-shadow: 0 -1.5vmin 0 var(--highlight-color); } .floof:nth-child(2) { left: 2vmin; width: 40vmin; hei.........完整代码请登录后点击上方下载按钮下载查看
网友评论0