vue实现页面过渡动画效果代码
代码语言:html
所属分类:布局界面
代码描述:vue实现页面过渡动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> *, *::before, *::after { box-sizing: border-box; } body { overflow: hidden; font-size: 24px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; } button { font-family: inherit; font-size: inherit; } .page { overflow-y: auto; position: absolute; left: 0; right: 0; top: 0; bottom: 0; padding: 50px 0; text-align: center; } .inner { margin: auto; height: 100%; width: 700px; } .title { margin-bottom: 50px; font-size: 48px; } .button-wrapper { margin-top: 50px; } .button { position: relative; height: 60px; width: 300px; background-color: transparent; border: 3px solid #fff; color: #fff; cursor: pointer; -webkit-transition: color 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: color 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9); } .button::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; top: 0; background-color: #fff; -webkit-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: left center; transform-origin: left center; -webkit-transition: -webkit-transform 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: -webkit-transform 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: transform 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: transform 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9), -webkit-transform 150ms cubic-bezier(0.1, 0.7, 0.6, 0.9); } .button:hover.button-start { color: #f1b00f; } .button:hover.button-next { color: #c598af; } .button:hover::before { -webkit-transform: scaleX(1); transform: scaleX(1); } .button-text { position: relative; } .start { background-color: #f1b00f; color: #fff; } .next { background-color: #c598af; color: #fff; } .next-list { list-style: disc; text-align: left; margin: auto; width: 430px; line-height: 1.6; } /* Transition -----------------------------*/ .page-enter-active { overflow: hidden; -webkit-transition: -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95), -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); } .page-enter-active .enter-1 { -webkit-transition: 300ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: 300ms cubic-bezier(0.1, 0.7, 0.6, 0.9); -webkit-transition-property: opacity, -webkit-transform; transition-property: opacity, -webkit-transform; transition-property: opacity, transform; transition-property: opacity, transform, -webkit-transform; -webkit-transition-delay: 520ms; transition-delay: 520ms; } .page-enter { -webkit-transform: translateX(100%); transform: translateX(100%); } .page-enter .enter-1 { opacity: 0; -webkit-transform: translateX(50px); transform: translateX(50px); } .page-leave-active { display: block; } .page-enter-active { overflow: hidden; -webkit-transition: -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95), -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); } .page-enter-active .enter-2 { -webkit-transition: 300ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: 300ms cubic-bezier(0.1, 0.7, 0.6, 0.9); -webkit-transition-property: opacity, -webkit-transform; transition-property: opacity, -webkit-transform; transition-property: opacity, transform; transition-property: opacity, transform, -webkit-transform; -webkit-transition-delay: 640ms; transition-delay: 640ms; } .page-enter { -webkit-transform: translateX(100%); transform: translateX(100%); } .page-enter .enter-2 { opacity: 0; -webkit-transform: translateX(50px); transform: translateX(50px); } .page-leave-active { display: block; } .page-enter-active { overflow: hidden; -webkit-transition: -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); transition: transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95), -webkit-transform 400ms cubic-bezier(0.4, 0.1, 0.7, 0.95); } .page-enter-active .enter-3 { -webkit-transition: 300ms cubic-bezier(0.1, 0.7, 0.6, 0.9); transition: 300ms cubic-bezier(0.1, 0.7, 0.6, 0.9); -webkit-transition-property: opacity, -webkit-transform; transition-property: opacity, -webkit-transform; transition-property:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0