-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost_sidebar.php
executable file
·132 lines (127 loc) · 5.61 KB
/
post_sidebar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php if (!defined('__TYPECHO_ROOT_DIR__'))
exit; ?>
<div class="aside-content" id="aside-content" role="complementary">
<?php if (!empty($this->options->PostSidebarBlock) && in_array('ShowAuthorInfo', $this->options->PostSidebarBlock)): ?>
<div class="card-widget card-info">
<div class="card-info-avatar is-center">
<div class="avatar-img">
<img id="img_hover" data-lazy-src="<?php $this->options->logoUrl() ?>"
onerror="this.onerror=null;this.src='/usr/themes/butterfly/img/friend_404.gif'"
src="<?php echo GetLazyLoad() ?>" alt="avatar">
<script>
var image = document.getElementById('img_hover');
var state = 0;
image.addEventListener('mouseover', function() {
var bg = document.documentElement.getAttribute('data-theme');
console.log('bg=' + bg);
if (bg === 'light') {
state = state + 1;
console.log(state % 2);
if (state % 2 === 1) {
this.src = "https://s2.loli.net/2024/02/17/eOgCndyiYcGI1WH.jpg";
} else {
this.src = this.dataset.lazySrc;
}
console.log(this.src);
} else {
this.src = "https://s2.loli.net/2024/02/17/h41rvlyxgLnmcJK.jpg";
}
});
const glitchText = () => {
const elem = document.querySelector('.cyberpunk');
let originalText = elem.getAttribute('data-text');
let glitchedText = '';
for (let i = 0; i < originalText.length; i++) {
if (Math.random() > 0.8) {
const char = originalText[i];
glitchedText += char === char.toUpperCase() ? char.toLowerCase() : char.toUpperCase();
} else {
glitchedText += originalText[i];
}
}
elem.setAttribute('data-text', glitchedText);
}
setInterval(glitchText, 200);
</script>
</div>
<div class="author-info__name cyberpunk glitched" data-text="<?php $this->author(); ?>">
<?php $this->author(); ?>
</div>
<div class="author-info__description">
<?php $this->options->author_description() ?>
</div>
</div>
<div class="card-info-data">
<div class="card-info-data site-data is-center">
<a href="<?php $this->options->archivelink() ?>">
<div class="headline">文章</div>
<div class="length-num">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?>
<?php $stat->publishedPostsNum() ?>
</div>
</a>
<a href="<?php $this->options->tagslink() ?>">
<div class="headline">标签</div>
<div class="length-num">
<?php echo tagsNum(); ?>
</div>
</a>
<a href="<?php $this->options->categorylink() ?>">
<div class="headline">
分类
</div>
<div class="length-num">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?>
<?php $stat->categoriesNum() ?>
</div>
</a>
</div>
</div>
<!--<a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="<?php $this->options->author_site() ?>">
<i class="fas fa-link">
</i>
<span>
<?php $this->options->author_site_description() ?>
</span>
</a>-->
<?php if ($this->options->author_bottom != null): ?>
<div class="card-info-social-icons is-center">
<?php $this->options->author_bottom() ?>
</div>
<?php elseif (!$this->options->author_bottom): ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!empty($this->options->PostSidebarBlock) && in_array('ShowAnnounce', $this->options->PostSidebarBlock)): ?>
<!-- <div class="card-widget card-announcement">
<div class="item-headline">
<i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span>
</div>
<div class="announcement_content">
<?php $this->options->announcement() ?>
</div>
</div> -->
<?php endif; ?>
<?php if (!empty($this->options->AD)): ?>
<div class="card-widget">
<div class="item-headline"><i class="fa-solid fa-rectangle-ad"></i><span>广告</span></div>
<div>
<?php $this->options->AD() ?>
</div>
</div>
<?php endif; ?>
<div class="sticky_layout">
<div class="card-widget" id="card-toc">
<div class="item-headline">
<i class="fas fa-stream"></i>
<span>目录</span>
<span class="toc-percentage"></span>
</div>
<div class="toc-content">
<ol class="toc">
<?php getCatalog(); ?>
</ol>
</div>
</div>
</div>
</div><!-- end #sidebar -->