-
Notifications
You must be signed in to change notification settings - Fork 4
/
footer.php
190 lines (175 loc) · 7.82 KB
/
footer.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!--footer -->
<div class="footer">
<div class="wrap">
<div class="wrap_float">
<div class="footer-content">
<div class="wrap-center">
<div class="menu">
<ul>
<li>
<span>© 2019 - <?php echo date("Y"); ?> </span><a><?php $this->options->bcool_title() ?></a>
</li>
<li>Poweed by <a href="https://www.typecho.org/" target="_blank">Typecho</a> • <a
href="https://github.com/fordes123/gleaner" target="_blank">Gleaner</a>
</li>
<?php if ($this->options->bcool_icp) : ?>
<li><a href="http://beian.miit.gov.cn/publish/query/indexFirst.action"
target="_blank"><?php $this->options->bcool_icp(); ?></a></li> <?php endif; ?>
</ul>
</div>
</div>
<?php if (!$this->is('index')) : ?>
<div class="footer-right"><a href="#" class="login-link"><i class="fa-solid fa-circle-up"></i> 返回顶部</a>
</div><?php endif; ?>
</div>
</div>
</div>
</div>
<div class="overlay" id="overlay"></div>
</div>
</div>
<div style="display: none;">
<div class="modal modal_default modal_success" id="modal-qrcode">
<div class="modal_wrap">
<h2 class="title">微信分享二维码</h2>
<div class="subtitle">
<div id="qrcode"></div>
</div>
</div>
<div class="modal_close"></div>
</div>
</div>
</div>
</div>
<?php if ($this->is('index')) : ?>
<style> .index-anchor {
background-image: <?php if (empty($this->options->bcool_lightcolor)) echo 'linear-gradient(0deg, #4584b4, #1e4877)'; else echo $this->options->bcool_lightcolor; ?>;
}
.dark .index-anchor {
background-image: <?php if (empty($this->options->bcool_darkcolor)) echo 'linear-gradient(0deg,#ffa17f,#00223e)'; else echo $this->options->bcool_darkcolor ?>;
}</style>
<?php if ($this->options->debug_mode) : ?>
<script type="text/javascript"
src="<?php $this->options->themeUrl('./assets/js/webgl/ThreeWebGL.js'); ?>"></script>
<script type="text/javascript"
src="<?php $this->options->themeUrl('./assets/js/webgl/ThreeExtras.js'); ?>"></script>
<script type="text/javascript"
src="<?php $this->options->themeUrl('./assets/js/webgl/Detector.js'); ?>"></script>
<?php else : ?>
<script type="text/javascript"
src="//fastly.jsdelivr.net/gh/fordes123/gleaner/assets/js/webgl/ThreeWebGL.js"></script>
<script type="text/javascript"
src="//fastly.jsdelivr.net/gh/fordes123/gleaner/assets/js/webgl/ThreeExtras.js"></script>
<script type="text/javascript"
src="//fastly.jsdelivr.net/gh/fordes123/gleaner/assets/js/webgl/Detector.js"></script>
<?php endif; ?>
<script id="vs" type="x-shader/x-vertex">
varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }
</script>
<script id="fs" type="x-shader/x-fragment">
uniform sampler2D map; uniform vec3 fogColor; uniform float fogNear; uniform float fogFar; varying vec2 vUv; void main() { float depth = gl_FragCoord.z / gl_FragCoord.w; float fogFactor = smoothstep( fogNear, fogFar, depth ); gl_FragColor = texture2D( map, vUv ); gl_FragColor.w *= pow( gl_FragCoord.z, 20.0 ); gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor ); }
</script>
<?php endif; ?>
<?php if ($this->options->debug_mode) : ?>
<script src="<?php $this->options->themeUrl('./assets/js/lazyload.min.js'); ?>"
type="application/javascript"></script>
<script src="<?php $this->options->themeUrl('./assets/js/scripts.min.js'); ?>"
type="application/javascript"></script>
<script src="<?php $this->options->themeUrl('./assets/js/jquery.fancybox.min.js'); ?>"
type="application/javascript"></script>
<script src="<?php $this->options->themeUrl('./assets/js/masonry.pkgd.min.js'); ?>"
type="application/javascript"></script>
<script src="<?php $this->options->themeUrl('./assets/js/infinite-scroll.pkgd.min.js'); ?>"
type="text/javascript"></script>
<?php else : ?>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.js"
type="application/javascript"></script>
<script src="//fastly.jsdelivr.net/gh/fordes123/gleaner/assets/js/lazyload.min.js"
type="application/javascript"></script>
<script src="//fastly.jsdelivr.net/gh/fordes123/gleaner/assets/js/scripts.min.js?>"
type="application/javascript"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/masonry/4.2.2/masonry.pkgd.min.js"
type="application/javascript"></script>
<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-infinitescroll/4.0.1/infinite-scroll.pkgd.min.js"></script>
<?php endif; ?>
<script>clickToHref();
function clickToHref() {
var eles = document.querySelectorAll("div[href]");
eles.forEach(function (item) {
item.addEventListener("click", function () {
var href = item.getAttribute("href");
var target = item.getAttribute("target");
if (!target) {
location.href = href
} else {
window.open(href, target)
}
})
})
}
function fixFooter() {
var containerHeight = $(".content-container").innerHeight();
var windowHeight = $(window).innerHeight();
if (containerHeight < windowHeight) {
$(".footer").attr("style", "margin-top: " + (windowHeight - containerHeight) + 'px;')
$(".content-container-wrap").addClass("relative");
} else {
$(".footer").removeAttr("style");
$(".content-container-wrap").removeClass("relative");
}
}
$(window).resize(function () {
fixFooter()
});
$(window).on("load", function () {
fixFooter();
});
</script>
<?php if ($this->is('post') || $this->is('page')) : ?>
<script> /*生成文章二维码*/
new QRCode(document.getElementById("qrcode"), {
rendor: 'canvas',
text: '<?php $this->permalink() ?>',
width: 200,
height: 200,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H
});</script>
<?php endif; ?>
<script>
var $portfolio = $('.portfolio').masonry({
itemSelector: '.portfolio-item',
});
var lazyLoadInstance = new LazyLoad({
callback_error: (img) => {
$(img).attr('src', $(img).attr('error-src'));
},
callback_loaded: (img) => {
if ($('.portfolio')) {
$portfolio.masonry('layout')
fixFooter();
}
}
});
if ($('.ajaxloadpost .next').length > 0) {
var masonry = $portfolio.data('masonry');
$portfolio.infiniteScroll({
path: '.next',
append: '.portfolio-item',
hideNav: '.ajaxloadpost',
status: '.page-load-status',
history: false,
scrollThreshold: 100,
outlayer: masonry
});
$('.portfolio').on('append.infiniteScroll', function () {
lazyLoadInstance.update();
clickToHref();
});
}
</script>
<?php $this->footer(); ?>
</body>
</html>