圆环立体滚动卡片效果
代码语言:html
所属分类:加载滚动
代码描述:圆环立体滚动卡片效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Oswald&display=swap"); *, *::before { padding: 0; margin: 0 auto; box-sizing: border-box; } body { font-family: 'Oswald', sans-serif; background-color: #333; color: #ccc; padding: 0 1em; height: calc(100vh + 10px); display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; -webkit-box-orient: vertical; -webkit-box-direction: normal; flex-direction: column; } div { padding: 0.5em; background-color: #333; width: 100%; text-align: center; z-index: 2; } ul { width: 320px; height: 560px; -webkit-perspective: 600px; perspective: 600px; counter-reset: counter; } li { background-color: #444; font-size: 0.6em; line-height: 1.2; position: absolute; left: 0; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); display: block; padding: 1em; width: 320px; height: 80px; border: 1px solid #666; border-radius: 4px; display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden; } li::before { counter-increment: counter; content: counter(counter); position: absolute; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); font-size: 100px; z-index: -1; color: #333; } li:nth-child(2n)::before { right: 30px; } li:nth-child(2n+1)::before { left: 30px; } a { color: #def; } .twitterLink { position: fixed; bottom: 0.5em; right: 0.5em; } .twitterLink img { width: 2em; -webkit-filter: grayscale(100%); filter: grayscale(100%); -webkit-transition: -webkit-filter 0.25s; transition: -webkit-filter 0.........完整代码请登录后点击上方下载按钮下载查看
网友评论0