gsap实现消息纸张滚动卷起动画效果代码
代码语言:html
所属分类:加载滚动
代码描述:gsap实现消息纸张滚动卷起动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css"> <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Poppins:wght@400;500;600;700&display=swap'> <style> #phone { --c-frame: black; --c-interface: black; --c-headline: black; --c-screen: #e4e2e2; --c-letter: #fff; --c-date: black; --c-subline: #898989; --c-text: #A7A7A7; --empty-mask: 100%; --headline-y: 0; position: relative; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px; width: 375px; color: var(--c-interface); } @media (min-width: 501px) { #phone { border-radius: 9.6%/4.43%; box-shadow: 0 0 0 10px var(--c-frame); } #phone:before { content: ""; position: absolute; z-index: 1; top: 0; left: 50%; transform: translateX(-50%); height: 30px; width: 200px; border-radius: 0 0 16px 16px; background: var(--c-frame); } } #phone .time, #phone .battery, #phone .cellular, #phone .wifi { position: absolute; top: 17px; } @media (max-width: 500px) { #phone .time, #phone .battery, #phone .cellular, #phone .wifi { display: none; } } #phone .time { left: 21px; top: 15px; font-size: 100%; font-weight: 600; } #phone .battery { right: 15px; width: 25px; height: 12px; } #phone .cellular { right: 64px; width: 18px; height: 12px; } #phone .wifi { right: 44px; width: 16px; height: 12px; } #phone .screen { position: relative; width: 100%; } @media (min-width: 501px) { #phone .screen { padding-bottom: 216.533333333%; background: var(--c-screen); transform: translateZ(0); border-radius: 36px; overflow: hidden; -webkit-mask-image: -webkit-radial-gradient(white, black); } } @media (max-width: 500px) { #phone .screen { height: 100vh; } } #phone .screen h1 { font-size: 30px; font-family: "DM Serif Display", serif; font-weight: normal; color: var(--c-headline); text-align: center; margin: 0; position: absolute; top: 92px; left: 0; right: 0; transform: translateY(var(--headline-y)) translateZ(0); } #phone .screen .empty { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: var(--c-text); -webkit-mask-image: linear-gradient(to left, transparent var(--empty-mask), black calc(var(--empty-mask) + 10%)); mask-image: linear-gradient(to left, transparent var(--empty-mask), black calc(var(--empty-mask) + 10%)); } #phone .screen .empty svg { display: block; width: 48px; height: 48px; margin: 0 auto 12px auto; } #phone .screen .empty span { display: block; font-size: 20px; font-family: "DM Serif Display", serif; } #phone .screen .content { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow-y: scroll; overflow-x: hidden; -ms-overflow-style: none; scrollbar-width: none; } #phone .screen .content::-webkit-scrollbar { display: none; } #phone .screen .content .entries article { --clip: 0px; --compact-s: 0; --spacing: 32px; --border-radius-h: 0px; --border-radius-v: 0px; --article-r: 0deg; --article-x: 0; --article-y: 0; --to-article-r: -4deg; --to-article-x: -4px; --to-article-y: -44px; --compact-o: 0; margin-top: var(--spacing); margin-left: 20px; margin-righ.........完整代码请登录后点击上方下载按钮下载查看
网友评论0