mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-30 15:10:03 +00:00
add backToTop button
This commit is contained in:
@@ -123,3 +123,33 @@
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
#back-to-top {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
background-color: #dfd3c3;
|
||||
color: #333;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: none; /* 初始状态隐藏 */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
z-index: 1000;
|
||||
transition: all 0.3s ease; /* 添加过渡效果 */
|
||||
}
|
||||
|
||||
#back-to-top:hover {
|
||||
background-color: #d0c3b4; /* 稍微深一点的颜色作为悬停效果 */
|
||||
transform: translateY(-3px); /* 悬停时稍微上移 */
|
||||
}
|
||||
|
||||
#back-to-top:active {
|
||||
transform: translateY(1px); /* 点击时下移,创造按压效果 */
|
||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2); /* 减小阴影 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user