css布局实现湖面石头打水漂动画效果代码
代码语言:html
所属分类:动画
代码描述:css布局实现湖面石头打水漂动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; padding: 0; } .sky { background: linear-gradient(180deg, #673ab7, #ff980094); height: 50vh; } .sun { position: relative; background: -webkit-radial-gradient(50vw 55vh, circle cover, rgba(254, 255, 255, 0.8) 5%, rgb(236, 255, 0) 10%, rgb(253 50 41 / 54%) 25%, rgb(243 0 0 / 37%) 40%, rgb(93, 0, 0) 100%); width: 100vw; height: 100vh; left: 0; top: 0; box-shadow: 0 0 8em 4em #ff6600cc, 0 0 8em -16em #ff660000 inset, 0 0 20px 5px #ffcc007d; opacity: 0.5; } .water { background: linear-gradient(to top, rgba(0,25,45,1) 0%,rgba(14,71,117,1) 35%, rgba(26,126,174,1) 70%, rgba(62,168,220,1) 100%); height: 50vh; overflow: hidden; position: relative; } .water:before { content: ""; width: 100%; height: 100%; position: absolute; background: repeating-linear-gradient(175deg,rgba(165,165,165,0.08) 45%, rgba(175,175,175,0.08) 47%, rgba(235,235,235,0.08) 50%, rgba(195,195,195,0.08) 54%, rgba(165,165,165,0.08) 57%), linear-gradient(to left top, rgba(0,0,0,0.0) 10%,rgba(0,0,0,0.20) 44%,rgba(0,0,0,0.65) 95%,rgba(0,0,0,0.62) 100%); opacity: 0.5; box-shadow: 0 6px 6px -6px #ffc107 inset; animation: ocean 15s infinite; } .stone { position: relative; width: 3em; height: 1.5em; animation: skip-stone 4s 1.5s infinite; transform: translate(calc(50vw - 2em), 50vh); transition: transform 1s ease-out 0s; padding: 1em; z-index: 2; margin-left: -2em; transform-origin: center center; } .stone:before { background: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%); width: 1.75em; height: 0.65em; border-radius: 100%; content: ""; display: block; position: absolute; top: 1.25em; transform: rotate(173deg); left: 1.25em; opacity: 0.75; } .stone:after { background: radial-gradient(circle at 40% 0%, #323232, #0a0a0a 80%, #000000 100%); width: 3em; height: 1.5em; border-radius: 100%; content: ""; display: block; } .stone-shadow { position: absolute; width: 3em; height: 1.5em; padding: 1em; animation: skip-shadow 4s 1.5s infinite; transform: translate(50vw, 50vh); transition: transform 1s ease-out 0s; opacity: 0.35; margin-left: -1.5em; margin-top: -3em; } .stone-shadow:before { ba.........完整代码请登录后点击上方下载按钮下载查看
网友评论0