美化url和mp4链接
This commit is contained in:
1 parent
791be8bd4f
commit
cc5887a74d
8 files changed
+244
-2641
No files matched your search
@@ -20,10 +20,25 @@
|
||||
|
||||
|
||||
|
||||
<div class="post-content" id="post-writing" itemprop="articleBody" uk-scrollspy="target: > h2, > h3, > h4, > blockquote, > table, > figure; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
<div class="post-content" id="post-writing" itemprop="articleBody">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var content = document.getElementById('post-writing');
|
||||
if (!content) return;
|
||||
// 滚动时内容从下方淡入,符合"往下看"的直觉
|
||||
content.querySelectorAll('h2, h3, h4, p, ul, ol, blockquote, table').forEach(function(el) {
|
||||
el.setAttribute('uk-scrollspy', 'cls: uk-animation-fade; delay: 60');
|
||||
});
|
||||
// 图片/视频/链接卡片稍微带点位移,更有"出现感"
|
||||
content.querySelectorAll('figure, img, .post-video, .link-card').forEach(function(el) {
|
||||
el.setAttribute('uk-scrollspy', 'cls: uk-animation-slide-bottom-small; delay: 100');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</article>
|
||||
<hr class="uk-divider-icon">
|
||||
|
||||
Reference in new issue
Block a user