svg+css实现横向滚动的晶莹剔透气泡效果代码
代码语言:html
所属分类:加载滚动
代码描述:svg+css实现横向滚动的晶莹剔透气泡效果代码,拖动底部滚动条进行滚动。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --main-bg: #1d1e22; --light: 255, 255, 255; --violet: 82, 10, 159; --blue: 0, 190, 245; --pink: 248, 10, 184; --green: 21, 140, 94; } html { box-sizing: border-box; } *, *::before, *::after { box-sizing: inherit; margin: 0; padding: 0; } body { position: relative; display: grid; align-items: stretch; min-height: 100vh; /* padding: 0 calc(100% / 12); */ color: #ffffff; background-color: var(--main-bg); background: url("//repo.bfw.wiki/bfwrepo/image/666ba2a987e62.png") center / cover no-repeat, var(--main-bg); } .list { counter-reset: item; display: flex; justify-content: space-evenly; align-items: center; padding: 1rem calc(100% / 12); gap: calc(100% / 5); overflow: auto; list-style: none; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; } .list__item { position: relative; flex-shrink: 0; width: calc(100% / 5); aspect-ratio: 1/1; box-shadow: inset 0 0 10px 0 rgba(var(--light), 0.3), inset 0 1rem 20px 0 rgba(var(--light), 0.3), inset -1rem 0 20px 0 rgba(var(--light), 0.3); border-radius: 50%; scroll-snap-stop: normal; scroll-snap-align: center; transition: all 0.5s ease-in-out; backdrop-filter: blur(10px) brightness(2); overflow: hidden; } .list__item::before, .list__item::after { content: ""; position: absolute; display: block; border-radius: 100%; transform: rotate(40deg); } .list__item::before { top: 15%; right: 10%; width: 30%; height: 12%; background-color: rgba(var(--light), 1); background: radial-gradient( closest-side, rgba(var(--light), 0.7) 50%, transparent 100% ); } .list__item::after { bottom: 10%; left: 0; width: 50%; height: 30%; background: radial-gradient( closest-side, rgba(var(--light), 0.3) 0, transparent 100% ); } .list__item.center { scale: 1.5; box-shadow: inset 0 2rem 30px 0 rgba(var(--violet), 1), inset -2rem 0 30px 0 rgba(var(--pink), 0.8), inset 0 -1rem 30px 0 rgba(var(--green), 0.8), inset 1rem 0 20px 0 rgba(var(--blue), 0.8), inset 0 0 10px 0 rgba(var(--light), 0.8); backdrop-filter: blur(10px) brightness(5); animation: floating 6s infinite; } @keyframes floating { from { transform: translate(0, 0); } 65% { transform: translate(0, 1rem); } to { transform: translate(0, 0); } } @media (max-width: 768px) { html { font-size: 10px; } } .scroll-icon { position: fixed; bottom: 1rem; right: 1rem; width: 4rem; animation: hand 2s infinite ease-out; } @keyframes hand { from { translate: 0 0; } 50% { translate: -0.5rem 0; } to { translate: 0 0; } } </style> </head> <body translate="no"> <ul class="list"> <li class="list__item"></li> <li class="list__item center"></li> <li class="list__item"></li> <li class="list__item"></li> <li class="list__item"></li> <li class="list__item"></li> <li class="list__item"></li> <li class="list__item"></li> <li class="list__item"></li> <li class="list__item"></li> </ul> <svg class="scroll-icon" fill="none" height="143" viewBox="0 0 127 143" width="127" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m.054199.543213h126.017v141.769h-126.017z"/></clipPath><g clip-path="url(#a)" fill="#ffffff"><path d="m125.572 75.5233c-.145-3.2128-1.099-6.417-2.022-9.517l-.112-.3766c-.447-1.5133-1.234-2.9043-2.301-4.0665-1.068-1.1622-2.387-2.0648-3.857-2.6387-4.556-1.9171-8.833-1.2956-12.721 1.8456-1.793-4.0922-4.722-6.7085-8.7125-7.7783-4.6777-1.2536-8.4786-.2546-11.3054 2.972-4.7946-6.5831-8.3395-7.2736-15.9188-3.0848-.0841-1.2532-.1648-2.5003-.2409-3.7412-.1969-3.1078-.3938-6.3218-.7075-9.4604-.6183-6.2353-1.3226-12.9299-2.2793-19.7125-.5533-3.6251-2.0078-7.0536-4.2296-9.97108-2.6253-3.55734-6.2521-4.3397-10.221-2.20464-1.1919.61709-2.2406 1.47794-3.0782 2.52672-.8375 1.0488-1.4453 2.262-1.7834 3.5608-.5069 1.7486-.8167 3.5482-.924 5.3656-.0551 1.184-.1121 2.3678-.1708 3.5514-.2862 5.8933-.5827 11.9868-.5775 17.9837.0053 7.2906.174 14.4348.3526 21.9991.0695 2.9365.135 5.8966.1967 8.8797-.0479-.0434-.0944-.0854-.1397-.1274-.3479-.3275-.7123-.6366-1.0916-.9267-6.799-4.9883-14.0305-6.7229-21.495-5.1588-1.5427.2955-2.9886.9668-4.2102 1.9539-1.2215.9878-2.181 2.2604-2.7935 3.707-.6208 1.5109-.8599 3.1517-.6961 4.7775.1638 1.6251.7253 3.1852 1.6351 4.5425 1.1614 1.6874 2.5534 3.2049 4.1351 4.5071 5.1842 4.4178 9.4621 9.7997 12.597 15.8467 3.8218 7.416 8.1388 15.227 13.9933 25.312 1.3937 2.215 3.1752 4.162 5.2597 5.746 4.1808 3.291 8.8746 5.873 1.........完整代码请登录后点击上方下载按钮下载查看
网友评论0