前端 - 那些你不知道的炫酷导航交互效果_个人文章 - SegmentFault 思否
基于上次发布的 那些你不知道的炫酷按钮交互效果 反馈比较好,后续将继续收集那些炫酷的交互效果,希望可以给你的项目添砖加瓦,更上一层楼。那些你不知道的炫酷交互效果系列:那些你不知道的炫酷按钮交互效果那些
2021-10-23 13:24:06
277
来自codepen,http://codepen.io/PalashSharma20/pen/YWBAgN
知识点:屏幕居中、transform、transition、transition-delay
最重要的是idea
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
* { margin: 0; padding: 0; }
body,
html { height: ; min-height: ; }
body { font-family: sans-serif; }
.button { height: 200px; width: 400px; position: relative; top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%); display: table; cursor: pointer; background: #252525; transition: 0.333333333333333s all ease-in; color: #ff4c4c; }
.button .border { background: #ff4c4c; position: absolute; transition: 1s all linear; }
.button .border.o { height: 5px; width: 0; bottom: 0; left: 0; transition-delay: 1s; }
.button .border.tw { bottom: 0; right: 0; width: 5px; height: 0; }
.button .border.th { top: 0; right: 0; width: 0; height: 5px; transition-delay: 1s; }
.button .border.f { top: 0; left: 0; width: 5px; height: 0; }
.button:hover { background: #ff4c4c; color: #252525; transition-delay: 2s; }
.button:hover .o,
.button:hover .th { width: ; }
.button:hover .tw,
.button:hover .f { height: ; }
.button span { display: table-cell; vertical-align: middle; font-size: 40px; text-align: center; letter-spacing: 13px; text-transform: uppercase; font-weight: 100; }
</style>
</head>
<body>
<div class="button">
<span>hover me</span>
<div class="border o"></div>
<div class="border tw"></div>
<div class="border th"></div>
<div class="border f"></div>
</div>
</body>
</html>
31
2022-10
19
2022-10
15
2022-09
15
2022-09
14
2022-09
14
2022-09