卡片悬浮动画特效
代码语言:html
所属分类:悬停
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> Card Hover Effect | SASS | Cubic Bezier</title> <style> @import url("https://fonts.googleapis.com/css?family=Lato:300,400|Poppins:300,400,800&display=swap"); * { margin: 0px; padding: 0; } body { font-family: 'Poppins'; overflow: hidden; } .container { width: 100%; height: 100vh; background-color: #232323; display: flex; justify-content: center; align-items: center; } .container .post { width: 350px; height: 500px; display: flex; flex-direction: column; position: relative; } .container .post:hover .header_post { margin-top: -20px; } .container .post:hover .body_post { height: 50%; } .container .post .header_post { width: 100%; height: 40%; background: #ddd; position: absolute; top: 0; -webkit-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; -moz-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; -ms-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; -o-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; } .container .post .header_post img { max-width: 100%; height: auto; } .container .post .body_post { width: 100%; height: 60%; background: #fff; position: absolute; bottom: 0; display: flex; justify-content: center; align-items: center; -webkit-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; -moz-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; -ms-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; -o-transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) 320ms; cursor: pointer; } .container .post .body_post .post_content { width: 80%; height: 80%; background: #fff; position: relative; } .container .post .body_post .post_content h1 { font-size: 20px; font-weight: bold; } .container .post .body_post .post_content p { font-size: 14px; font-weight: normal; } .container .post .body_post .post_content .container_infos { width: 100%; display: flex; justify-content: space-between; position: absolute; bottom: 0; border-top: 1px solid rgba(0, 0, 0, 0.2); padding-top: 25px; } .container .post .body_post .post_content .container_infos .postedBy { display: flex; flex-direction: column; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; } .container .post .body_post .post_content .container_infos .postedBy span { font-size: 12px; text-transform: uppercase; opacity: 0.5; letter-spacing: 1px; font-weight: bold; } .container .post .body_post .post_content .container_infos .container_tags { display: flex; flex-direction: column; } .container .post .body_post .post_content .container_infos .container_tags span { font-size: 12px; text-transform: uppercase; opacity: 0.5; letter-spacing: 1px; font-weight: bold; } .container .post .b.........完整代码请登录后点击上方下载按钮下载查看
网友评论0