优化性能、逻辑、冗余代码【2.0 版本】✅
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
---
|
||||
const { time, sitename, title, site, id, auther } = Astro.props;
|
||||
const articleURL = `${site}/article/${id}`;
|
||||
import "./Copyright.less";
|
||||
---
|
||||
|
||||
<section class="vh-copyright">
|
||||
<p>本文由 <span>{auther}</span> 于 {time} 发布</p>
|
||||
<p>文章地址:<a href={articleURL}>{title}</a></p>
|
||||
<p>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0" target="_blank" rel="noopener nofollow">CC BY-NC-SA 4.0</a> 许可协议。完整转载请注明来自 <a href={site}>{sitename}</a>!</p>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"> <path d="M245.8 214.9l-33.2 17.3c-9.4-19.6-25.2-19.9-27.5-19.9-22.1 0-33.2 14.6-33.2 43.8 0 23.6 9.2 43.8 33.2 43.8 14.5 0 24.7-7.1 30.6-21.3l30.6 15.5c-6.2 11.5-25.7 39-65.1 39-22.6 0-74-10.3-74-77.1 0-58.7 43-77.1 72.6-77.1 30.7 0 52.7 12 66 35.9zm143.1 0l-32.8 17.3c-9.5-19.8-25.7-19.9-27.9-19.9-22.1 0-33.2 14.6-33.2 43.8 0 23.6 9.2 43.8 33.2 43.8 14.5 0 24.7-7.1 30.5-21.3l31 15.5c-2.1 3.8-21.4 39-65.1 39-22.7 0-74-9.9-74-77.1 0-58.7 43-77.1 72.6-77.1 30.7 0 52.6 12 65.6 35.9zM247.6 8.1C104.7 8.1 0 123.1 0 256.1c0 138.5 113.6 248 247.6 248 129.9 0 248.4-100.9 248.4-248 0-137.9-106.6-248-248.4-248zm.9 450.8c-112.5 0-203.7-93-203.7-202.8 0-105.4 85.4-203.3 203.7-203.3 112.5 0 202.8 89.5 202.8 203.3 0 121.7-99.7 202.8-202.8 202.8z"></path></svg>
|
||||
</section>
|
||||
@@ -0,0 +1,74 @@
|
||||
.vh-copyright {
|
||||
position: relative;
|
||||
margin: 1.868rem 0;
|
||||
box-sizing: border-box;
|
||||
padding: 1rem;
|
||||
width: 100%;
|
||||
height: max-content;
|
||||
background-color: rgba(0, 0, 0, 0.03);
|
||||
border-radius: 0.618rem;
|
||||
overflow: hidden;
|
||||
|
||||
a {
|
||||
box-sizing: border-box;
|
||||
padding: 1.88px;
|
||||
position: relative;
|
||||
width: max-content;
|
||||
height: max-content;
|
||||
color: #33333388;
|
||||
box-shadow: none !important;
|
||||
overflow: hidden;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 2px;
|
||||
background-color: #60a5fa;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&::before {
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&>p {
|
||||
box-sizing: border-box;
|
||||
padding: 0.38rem 0 !important;
|
||||
width: 100%;
|
||||
height: max-content;
|
||||
font-size: 0.875rem !important;
|
||||
|
||||
&>span {
|
||||
color: #9CC5FB;
|
||||
}
|
||||
}
|
||||
|
||||
&>svg {
|
||||
position: absolute;
|
||||
right: 3.66rem;
|
||||
top: 0;
|
||||
width: auto;
|
||||
height: 100%;
|
||||
opacity: 0.06;
|
||||
transform: scale(1.8);
|
||||
pointer-events: none;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 666px) {
|
||||
.vh-copyright {
|
||||
&>svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user