js实现液态液体流动背景动画效果代码
代码语言:html
所属分类:背景
代码描述:js实现液态液体流动背景动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; font-weight: 400; color: black; background-color: whitesmoke; font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body { margin: 0; display: flex; place-items: center; min-width: 320px; min-height: 100vh; } .bouncing-blob { width: 32vw; aspect-ratio: 1; border-radius: 50%; will-change: transform; position: absolute; z-index: 1; top: 0; left: 0; transform-origin: left top; } .bouncing-blob--blue { background: #4783c7; } .bouncing-blob--white { background: #ffffff; z-index: 2; width: 15vw; } .bouncing-blob--purple { background: #8c8ff1; } .bouncing-blob--pink { background: #e289cd50; } .bouncing-blobs-container { position: fixed; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; } .bouncing-blobs-glass { position: absolute; z-index: 2; top: 0; left: 0; width: 100%; height: 100%; backdrop-filter: blur(140px); -webkit-backdrop-filter: blur(140px); pointer-events: none; } .bouncing-blobs { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: 100%; } .hero { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; } .hero h2 { font-size: 70px; max-width: 800px; line-height: 1; text-align: center; font-weight: bold; text-transform: capitalize; margin-bottom: 20px; color: #021123; } .hero p { font-size: 24px; max-width: 500px; text-align: center; color: #021123; } @media (max-width: 1200px) { .bouncing-blobs-glass { backdrop-filter: blur(120px); -webkit-backdrop-filter: blur(120px); } } @media (max-width: 500px) { .bouncing-blob { width: 60vw; } .bouncing-blob--white { width: 30vw; } .bouncing-blobs-glass { backdrop-filter: blur(90px); -webkit-backdrop-filter: blur(90px); } .hero h2 { font-size: 32px; } .hero p { font-size: 16px; padding: 0 20px; } } </style> </head> <body> <div class="bouncing-blobs-container"> <div class="bouncing-blobs-glass"></div> <div class="bouncing-blobs"> <div class="bouncing-blob bou.........完整代码请登录后点击上方下载按钮下载查看
网友评论0