fixed bug
This commit is contained in:
1 parent
7b945786ed
commit
54b18039e3
21 files changed
+2340
-385
No files matched your search
@@ -32,78 +32,3 @@ draft: false
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section-title">01 / 热力图 (Hot Map)</div>
|
||||
|
||||
{{< heatmap >}}
|
||||
|
||||
<div class="section-title">02 / 技能栈 (System Ops)</div>
|
||||
|
||||
<section class="skills-section" style="margin-top: 0;">
|
||||
<div class="skills-container">
|
||||
<div class="skills-row">
|
||||
<div class="skills-track">
|
||||
<span class="skill-tag">Linux</span>
|
||||
<span class="skill-tag">CentOS</span>
|
||||
<span class="skill-tag">Ubuntu</span>
|
||||
<span class="skill-tag">Debian</span>
|
||||
<span class="skill-tag">RedHat</span>
|
||||
<span class="skill-tag">Alpine</span>
|
||||
<span class="skill-tag">Linux</span>
|
||||
<span class="skill-tag">CentOS</span>
|
||||
<span class="skill-tag">Ubuntu</span>
|
||||
<span class="skill-tag">Debian</span>
|
||||
<span class="skill-tag">RedHat</span>
|
||||
<span class="skill-tag">Alpine</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skills-row">
|
||||
<div class="skills-track skills-track-reverse">
|
||||
<span class="skill-tag">Docker</span>
|
||||
<span class="skill-tag">Kubernetes</span>
|
||||
<span class="skill-tag">Nginx</span>
|
||||
<span class="skill-tag">Apache</span>
|
||||
<span class="skill-tag">Tomcat</span>
|
||||
<span class="skill-tag">Caddy</span>
|
||||
<span class="skill-tag">Docker</span>
|
||||
<span class="skill-tag">Kubernetes</span>
|
||||
<span class="skill-tag">Nginx</span>
|
||||
<span class="skill-tag">Apache</span>
|
||||
<span class="skill-tag">Tomcat</span>
|
||||
<span class="skill-tag">Caddy</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skills-row">
|
||||
<div class="skills-track">
|
||||
<span class="skill-tag">Shell</span>
|
||||
<span class="skill-tag">Python</span>
|
||||
<span class="skill-tag">MySQL</span>
|
||||
<span class="skill-tag">Redis</span>
|
||||
<span class="skill-tag">MongoDB</span>
|
||||
<span class="skill-tag">PostgreSQL</span>
|
||||
<span class="skill-tag">Shell</span>
|
||||
<span class="skill-tag">Python</span>
|
||||
<span class="skill-tag">MySQL</span>
|
||||
<span class="skill-tag">Redis</span>
|
||||
<span class="skill-tag">MongoDB</span>
|
||||
<span class="skill-tag">PostgreSQL</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skills-row">
|
||||
<div class="skills-track skills-track-reverse">
|
||||
<span class="skill-tag">Git</span>
|
||||
<span class="skill-tag">Jenkins</span>
|
||||
<span class="skill-tag">Ansible</span>
|
||||
<span class="skill-tag">Prometheus</span>
|
||||
<span class="skill-tag">Grafana</span>
|
||||
<span class="skill-tag">ELK</span>
|
||||
<span class="skill-tag">Git</span>
|
||||
<span class="skill-tag">Jenkins</span>
|
||||
<span class="skill-tag">Ansible</span>
|
||||
<span class="skill-tag">Prometheus</span>
|
||||
<span class="skill-tag">ELK</span>
|
||||
<span class="skill-tag">Git</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -87,6 +87,13 @@ hasCJKLanguage = true
|
||||
# 站点参数配置 (Site Parameters)
|
||||
# ==============================================================================
|
||||
[params]
|
||||
# ----------------------------------------------------------------------------
|
||||
# 关于页面配置 (About Page Configuration)
|
||||
# ----------------------------------------------------------------------------
|
||||
[params.about]
|
||||
enableheatmap = false # 开启热力图 (Enable Heatmap)
|
||||
enableskills = false # 开启技能栈 (Enable Skills)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# 社交链接 (Social Links)
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
@@ -703,7 +703,195 @@ ul {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
/* Pjax 页面切换过渡动画 */
|
||||
/* Searchable Header Styles */
|
||||
.searchable-header-container {
|
||||
position: relative;
|
||||
margin-bottom: 15px;
|
||||
height: 40px; /* Fixed height to prevent layout jump */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section-header.normal-mode {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
transition: all 0.3s ease;
|
||||
margin: 0; /* Reset margin */
|
||||
}
|
||||
|
||||
.search-hint {
|
||||
font-size: 0.75rem;
|
||||
font-weight: normal;
|
||||
color: #999;
|
||||
opacity: 0;
|
||||
transform: translateX(-10px);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.section-header.normal-mode:hover .search-hint {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.search-mode {
|
||||
width: 100%;
|
||||
animation: fadeIn 0.3s ease;
|
||||
}
|
||||
|
||||
.search-input-group {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
border-bottom: 2px solid #e5e7eb;
|
||||
transition: border-color 0.3s ease;
|
||||
}
|
||||
|
||||
.search-input-group:focus-within {
|
||||
border-color: #111827;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-group:focus-within {
|
||||
border-color: #e5e7eb;
|
||||
}
|
||||
|
||||
.search-input-group input {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: transparent;
|
||||
padding: 8px 35px 8px 45px; /* Increased left padding to separate from icon */
|
||||
font-size: 1rem;
|
||||
color: var(--text-title-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-group input {
|
||||
color: var(--text-title-dark-color);
|
||||
}
|
||||
|
||||
.search-icon, .close-icon {
|
||||
position: absolute;
|
||||
font-size: 1.2rem;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
right: 5px;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.close-icon:hover {
|
||||
color: var(--text-title-color);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .close-icon:hover {
|
||||
color: var(--text-title-dark-color);
|
||||
}
|
||||
|
||||
.search-dropdown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: rgba(255, 255, 255, 0.98);
|
||||
backdrop-filter: blur(10px);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
|
||||
z-index: 100;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
margin-top: 10px;
|
||||
display: none; /* Hidden by default */
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-dropdown {
|
||||
background: rgba(30, 41, 59, 0.98);
|
||||
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.search-dropdown.show {
|
||||
display: block;
|
||||
animation: slideDown 0.2s ease;
|
||||
}
|
||||
|
||||
.search-result-item {
|
||||
padding: 12px 15px;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.05);
|
||||
transition: background 0.2s;
|
||||
text-align: left; /* Align text left */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-item {
|
||||
border-bottom: 1px solid rgba(255,255,255,0.05);
|
||||
}
|
||||
|
||||
.search-result-item:hover {
|
||||
background: rgba(0,0,0,0.02);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-item:hover {
|
||||
background: rgba(255,255,255,0.02);
|
||||
}
|
||||
|
||||
.search-result-title {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
color: var(--text-title-color);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-title {
|
||||
color: var(--text-title-dark-color);
|
||||
}
|
||||
|
||||
.search-result-date {
|
||||
font-size: 0.75rem;
|
||||
color: #999;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.search-result-summary {
|
||||
font-size: 0.85rem;
|
||||
color: #666;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-summary {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from { opacity: 0; transform: translateY(-10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* Mobile Adaptation */
|
||||
@media (max-width: 767px) {
|
||||
.search-hint {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
.pjax-leave {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -2409,6 +2597,16 @@ input[type=submit] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Migrated from assets/js/modules/style-fix.js */
|
||||
#libabys:nth-of-type(-n+2) {
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.itp-index:nth-child(even) {
|
||||
float: right;
|
||||
width: 48%;
|
||||
}
|
||||
|
||||
/* 修改小方块的背景填充颜色 */
|
||||
[data-theme=dark] .ch-subdomain-bg {
|
||||
fill: var(--gray-200);
|
||||
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
(function ($) {
|
||||
var defaults = {
|
||||
showTime: 800,
|
||||
offsetBottom: 0,
|
||||
offsetTopm: 50,
|
||||
onLoadBackEnd: function (index, dom) { },
|
||||
onLoadBackStart: function (index, dom) { }
|
||||
};
|
||||
|
||||
var $lazyImgList = $();
|
||||
|
||||
function checkOffset() {
|
||||
var scrollTop = $(document).scrollTop();
|
||||
var windowHeight = $(window).height();
|
||||
|
||||
$lazyImgList.each(function (index) {
|
||||
var $dom = $(this);
|
||||
if ($dom.attr("data-comp")) return; // Already processed
|
||||
|
||||
var offsetTop = $dom.offset().top;
|
||||
// Check if image is in viewport (with some buffer)
|
||||
if (offsetTop - scrollTop + defaults.offsetTopm >= 0 &&
|
||||
offsetTop - scrollTop < (windowHeight + defaults.offsetBottom)) {
|
||||
|
||||
showImg($dom, index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showImg($dom, index) {
|
||||
$dom.attr("data-comp", "true");
|
||||
var src = $dom.attr("data-lazy-src");
|
||||
|
||||
defaults.onLoadBackStart(index, $dom);
|
||||
|
||||
// Create a temporary image to preload
|
||||
var temp = new Image();
|
||||
temp.onload = function() {
|
||||
// Prepare for transition
|
||||
$dom.css({
|
||||
"opacity": 0,
|
||||
"transition": "opacity " + (defaults.showTime / 1000) + "s ease-in-out"
|
||||
});
|
||||
|
||||
// Swap source
|
||||
$dom.attr("src", src);
|
||||
|
||||
// Force reflow to ensure transition triggers
|
||||
void $dom[0].offsetWidth;
|
||||
|
||||
// Fade in
|
||||
$dom.css("opacity", 1);
|
||||
|
||||
defaults.onLoadBackEnd(index, $dom);
|
||||
};
|
||||
temp.onerror = function() {
|
||||
// On error, show anyway (maybe broken image icon) but ensure visible
|
||||
$dom.attr("src", src);
|
||||
$dom.css("opacity", 1);
|
||||
};
|
||||
temp.src = src;
|
||||
}
|
||||
|
||||
function init(setting) {
|
||||
defaults = $.extend(defaults, setting);
|
||||
|
||||
// Auto-convert standard images to lazy load format
|
||||
// Exclude .blog-img (Header Avatar) to prevent visibility issues
|
||||
$("img").not(".blog-img").each(function() {
|
||||
var $this = $(this);
|
||||
// Only convert if not already converted and has a src
|
||||
if (!$this.attr("data-lazy-src") && $this.attr("src")) {
|
||||
$this.attr("data-lazy-src", $this.attr("src"));
|
||||
// Set placeholder
|
||||
$this.attr("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==");
|
||||
}
|
||||
});
|
||||
|
||||
$lazyImgList = $("img[data-lazy-src]");
|
||||
|
||||
checkOffset();
|
||||
|
||||
// Debounced scroll handler could be better, but sticking to simple binding for now
|
||||
$(window).off("scroll.lazy").on("scroll.lazy resize.lazy", function() {
|
||||
checkOffset();
|
||||
});
|
||||
}
|
||||
|
||||
function tryAgain() {
|
||||
// Re-initialize for new content
|
||||
init(defaults);
|
||||
}
|
||||
|
||||
window.lazyLoadInit = init;
|
||||
window.lazyLoadAgain = tryAgain;
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,78 +1,19 @@
|
||||
// 判断是否为移动端
|
||||
function isMobile() {
|
||||
if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
|
||||
return true; // 移动端
|
||||
} else {
|
||||
return false; // PC端
|
||||
}
|
||||
}
|
||||
|
||||
// 文章图片灯箱
|
||||
window.ViewImage && ViewImage.init('.post-content img');
|
||||
|
||||
// Pure JavaScript Back to Top (High Performance)
|
||||
// Initial Call
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var backToTopButton = document.getElementById('back-to-top');
|
||||
if (backToTopButton) {
|
||||
var isVisible = false;
|
||||
var ticking = false;
|
||||
|
||||
function update() {
|
||||
if (window.scrollY > 300) {
|
||||
if (!isVisible) {
|
||||
backToTopButton.classList.add('show');
|
||||
isVisible = true;
|
||||
}
|
||||
} else {
|
||||
if (isVisible) {
|
||||
backToTopButton.classList.remove('show');
|
||||
isVisible = false;
|
||||
}
|
||||
}
|
||||
ticking = false;
|
||||
// 文章图片灯箱
|
||||
if (window.ViewImage) {
|
||||
ViewImage.init('.post-content img');
|
||||
}
|
||||
|
||||
window.addEventListener('scroll', function() {
|
||||
if (!ticking) {
|
||||
window.requestAnimationFrame(update);
|
||||
ticking = true;
|
||||
}
|
||||
}, { passive: true });
|
||||
|
||||
backToTopButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// loader定时器
|
||||
$(document).ready(function () {
|
||||
setTimeout(function () {
|
||||
$("#loader").addClass("hide");
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
|
||||
// 点击进入按钮
|
||||
$("#closeloader").click(function () {
|
||||
$("#loader").addClass("hide");
|
||||
});
|
||||
// nav栏样式调整
|
||||
$('#libabys').first().attr("style", "margin-left: -5px");
|
||||
|
||||
$('#libabys').eq(1).attr("style", "margin-left: -5px");
|
||||
// 友链列表版样式调整
|
||||
$('.itp-index:odd').attr("style", "float: right;width:48%;");
|
||||
// 初始化各个模块
|
||||
if (window.initLoader) window.initLoader();
|
||||
if (window.initFloatingTools) window.initFloatingTools();
|
||||
if (window.initSearch) window.initSearch();
|
||||
if (window.initArtalk) window.initArtalk();
|
||||
|
||||
// 文章图片懒加载
|
||||
if (typeof lazyLoadInit === 'function') {
|
||||
lazyLoadInit({
|
||||
// coverColor: "white",
|
||||
// coverDiv: "<div style='display: flex; justify-content: center; align-items: center; height: 200px; color: #000000;'><span>优世界·一个记录生活点滴的小站</span></div>",
|
||||
offsetBottom: 800,
|
||||
offsetTopm: 800,
|
||||
showTime: 1100
|
||||
@@ -80,111 +21,4 @@ if (typeof lazyLoadInit === 'function') {
|
||||
} else {
|
||||
console.warn('lazyLoadInit is not defined');
|
||||
}
|
||||
|
||||
|
||||
// 异步初始化 Artalk 并获取评论数据 (Moved to barrage.js)
|
||||
|
||||
// Global Artalk Initialization Function (Supports PJAX)
|
||||
window.initArtalk = function() {
|
||||
if (!document.querySelector("#Comments")) return;
|
||||
|
||||
// Check if configuration exists
|
||||
if (!window.artalkConfig) {
|
||||
console.warn('window.artalkConfig is not defined. Skipping Artalk init.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if Artalk library is loaded
|
||||
if (typeof Artalk === 'undefined') {
|
||||
console.warn('Artalk library is not loaded yet. Waiting for bundle...');
|
||||
// Optional: Retry logic could be added here if needed, but usually bundle is loaded by now
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if Artalk is already initialized on this container to avoid duplicates
|
||||
// But Artalk.init usually handles this or we create a new instance.
|
||||
// Since we want to re-bind to the new DOM after PJAX, we create a new instance.
|
||||
|
||||
// Clean up previous instance if needed? Artalk doesn't strictly require explicit destroy if DOM is removed,
|
||||
// but it's good practice. For now, we assume simple re-init is fine.
|
||||
|
||||
try {
|
||||
var artalk = Artalk.init(window.artalkConfig);
|
||||
window.artalk = artalk; // Expose to window for other scripts
|
||||
|
||||
// Handle list-loaded event for lazy loading avatars and animations
|
||||
artalk.on('list-loaded', function() {
|
||||
// Restore AI Comment if configured
|
||||
if (window.artalkConfig.aiComment) {
|
||||
var ai = window.artalkConfig.aiComment;
|
||||
var listBody = document.querySelector('.atk-list .atk-list-body');
|
||||
if (listBody && !listBody.querySelector('.atk-ai-comment')) {
|
||||
var aiCommentHtml = `
|
||||
<div class="atk-comment-wrap atk-comment atk-ai-comment" id="atk-comment-ai">
|
||||
<div class="atk-avatar" uk-scrollspy="cls: uk-animation-scale-up; delay: 200">
|
||||
<img src="${ai.avatar}" alt="${ai.name}">
|
||||
</div>
|
||||
<div class="atk-main" uk-scrollspy="cls: uk-animation-slide-right-small; delay: 300">
|
||||
<div class="atk-header">
|
||||
<span class="atk-nick" uk-scrollspy="cls: uk-animation-slide-top-small; delay: 350">${ai.name}</span>
|
||||
<span class="atk-badge">AI</span>
|
||||
<span class="atk-date">${ai.date}</span>
|
||||
</div>
|
||||
<div class="atk-body">
|
||||
<div class="atk-content">${ai.content}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
listBody.insertAdjacentHTML('afterbegin', aiCommentHtml);
|
||||
|
||||
// Hide "No Comment" placeholder if it exists
|
||||
var noComment = document.querySelector('.atk-list-no-comment');
|
||||
if (noComment) {
|
||||
noComment.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add staggered animation to the comment list
|
||||
var list = document.querySelector('.atk-list');
|
||||
if (list) {
|
||||
list.setAttribute('uk-scrollspy', 'target: > .atk-comment-wrap; cls: uk-animation-slide-bottom-small; delay: 50');
|
||||
}
|
||||
|
||||
// Apply granular animations to inner elements (Avatar, Nickname, Main Content)
|
||||
// Note: We already added attributes to AI comment above, but this loop ensures all other comments get it too.
|
||||
// Duplicate attributes on AI comment are harmless or we can skip it.
|
||||
document.querySelectorAll('.atk-comment-wrap:not(.atk-ai-comment)').forEach(function(wrap) {
|
||||
var avatar = wrap.querySelector('.atk-avatar');
|
||||
if (avatar) avatar.setAttribute('uk-scrollspy', 'cls: uk-animation-scale-up; delay: 200');
|
||||
|
||||
var main = wrap.querySelector('.atk-main');
|
||||
if (main) main.setAttribute('uk-scrollspy', 'cls: uk-animation-slide-right-small; delay: 300');
|
||||
|
||||
var nick = wrap.querySelector('.atk-nick');
|
||||
if (nick) nick.setAttribute('uk-scrollspy', 'cls: uk-animation-slide-top-small; delay: 350');
|
||||
});
|
||||
|
||||
// Find all avatars in the comment list
|
||||
var avatars = document.querySelectorAll('.atk-list .atk-avatar img');
|
||||
avatars.forEach(function(img) {
|
||||
var src = img.getAttribute('src');
|
||||
if (src) {
|
||||
img.setAttribute('data-lazy-src', src);
|
||||
img.removeAttribute('src');
|
||||
img.classList.add('lazyload'); // Add class if your lazyloader needs it
|
||||
}
|
||||
});
|
||||
|
||||
// Trigger lazy load update
|
||||
// Assuming window.lazyLoadInstance is available or using the global function
|
||||
if (window.lazyLoadAgain) {
|
||||
window.lazyLoadAgain();
|
||||
}
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
console.error('Artalk init failed:', e);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
// Global Artalk Initialization Function (Supports PJAX)
|
||||
window.initArtalk = function() {
|
||||
if (!document.querySelector("#Comments")) return;
|
||||
|
||||
// Check if configuration exists
|
||||
if (!window.artalkConfig) {
|
||||
console.warn('window.artalkConfig is not defined. Skipping Artalk init.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if Artalk library is loaded
|
||||
if (typeof Artalk === 'undefined') {
|
||||
console.warn('Artalk library is not loaded yet. Waiting for bundle...');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var artalk = Artalk.init(window.artalkConfig);
|
||||
window.artalk = artalk; // Expose to window for other scripts
|
||||
|
||||
// Handle list-loaded event for lazy loading avatars and animations
|
||||
artalk.on('list-loaded', function() {
|
||||
// Restore AI Comment if configured
|
||||
if (window.artalkConfig.aiComment) {
|
||||
var ai = window.artalkConfig.aiComment;
|
||||
var listBody = document.querySelector('.atk-list .atk-list-body');
|
||||
if (listBody && !listBody.querySelector('.atk-ai-comment')) {
|
||||
var aiCommentHtml = `
|
||||
<div class="atk-comment-wrap atk-comment atk-ai-comment" id="atk-comment-ai">
|
||||
<div class="atk-avatar" uk-scrollspy="cls: uk-animation-scale-up; delay: 200">
|
||||
<img src="${ai.avatar}" alt="${ai.name}">
|
||||
</div>
|
||||
<div class="atk-main" uk-scrollspy="cls: uk-animation-slide-right-small; delay: 300">
|
||||
<div class="atk-header">
|
||||
<span class="atk-nick" uk-scrollspy="cls: uk-animation-slide-top-small; delay: 350">${ai.name}</span>
|
||||
<span class="atk-badge">AI</span>
|
||||
<span class="atk-date">${ai.date}</span>
|
||||
</div>
|
||||
<div class="atk-body">
|
||||
<div class="atk-content">${ai.content}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
listBody.insertAdjacentHTML('afterbegin', aiCommentHtml);
|
||||
|
||||
// Hide "No Comment" placeholder if it exists
|
||||
var noComment = document.querySelector('.atk-list-no-comment');
|
||||
if (noComment) {
|
||||
noComment.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add staggered animation to the comment list
|
||||
var list = document.querySelector('.atk-list');
|
||||
if (list) {
|
||||
list.setAttribute('uk-scrollspy', 'target: > .atk-comment-wrap; cls: uk-animation-slide-bottom-small; delay: 50');
|
||||
}
|
||||
|
||||
// Apply granular animations to inner elements
|
||||
document.querySelectorAll('.atk-comment-wrap:not(.atk-ai-comment)').forEach(function(wrap) {
|
||||
var avatar = wrap.querySelector('.atk-avatar');
|
||||
if (avatar) avatar.setAttribute('uk-scrollspy', 'cls: uk-animation-scale-up; delay: 200');
|
||||
|
||||
var main = wrap.querySelector('.atk-main');
|
||||
if (main) main.setAttribute('uk-scrollspy', 'cls: uk-animation-slide-right-small; delay: 300');
|
||||
|
||||
var nick = wrap.querySelector('.atk-nick');
|
||||
if (nick) nick.setAttribute('uk-scrollspy', 'cls: uk-animation-slide-top-small; delay: 350');
|
||||
});
|
||||
|
||||
// Find all avatars in the comment list
|
||||
var avatars = document.querySelectorAll('.atk-list .atk-avatar img');
|
||||
avatars.forEach(function(img) {
|
||||
var src = img.getAttribute('src');
|
||||
if (src) {
|
||||
img.setAttribute('data-lazy-src', src);
|
||||
img.removeAttribute('src');
|
||||
img.classList.add('lazyload');
|
||||
}
|
||||
});
|
||||
|
||||
// Trigger lazy load update
|
||||
if (window.lazyLoadAgain) {
|
||||
window.lazyLoadAgain();
|
||||
}
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
console.error('Artalk init failed:', e);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
window.initFloatingTools = function() {
|
||||
// 1. Back to Top
|
||||
var backToTopButton = document.getElementById('back-to-top');
|
||||
if (backToTopButton) {
|
||||
var ticking = false;
|
||||
|
||||
function update() {
|
||||
var btn = document.getElementById('back-to-top');
|
||||
if (!btn) return;
|
||||
|
||||
if (window.scrollY > 300) {
|
||||
if (!btn.classList.contains('show')) {
|
||||
btn.classList.add('show');
|
||||
}
|
||||
} else {
|
||||
if (btn.classList.contains('show')) {
|
||||
btn.classList.remove('show');
|
||||
}
|
||||
}
|
||||
ticking = false;
|
||||
}
|
||||
|
||||
// Global Scroll Handler
|
||||
if (!window.backToTopScrollHandler) {
|
||||
window.backToTopScrollHandler = function() {
|
||||
if (!ticking) {
|
||||
window.requestAnimationFrame(update);
|
||||
ticking = true;
|
||||
}
|
||||
};
|
||||
window.addEventListener('scroll', window.backToTopScrollHandler, { passive: true });
|
||||
}
|
||||
|
||||
|
||||
// Re-bind click event
|
||||
var newBtn = backToTopButton.cloneNode(true);
|
||||
backToTopButton.parentNode.replaceChild(newBtn, backToTopButton);
|
||||
backToTopButton = newBtn;
|
||||
|
||||
backToTopButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Theme Toggle
|
||||
var themeToggle = document.getElementById('theme-toggle');
|
||||
if (themeToggle) {
|
||||
var newToggle = themeToggle.cloneNode(true);
|
||||
themeToggle.parentNode.replaceChild(newToggle, themeToggle);
|
||||
themeToggle = newToggle;
|
||||
|
||||
// Update icon based on current theme
|
||||
var updateIcon = function() {
|
||||
var currentTheme = document.documentElement.getAttribute('data-theme');
|
||||
var icon = themeToggle.querySelector('i');
|
||||
if (icon) {
|
||||
if (currentTheme === 'dark') {
|
||||
icon.className = 'ri-moon-line';
|
||||
} else {
|
||||
icon.className = 'ri-sun-line';
|
||||
}
|
||||
}
|
||||
};
|
||||
updateIcon();
|
||||
|
||||
themeToggle.addEventListener('click', function() {
|
||||
var currentTheme = document.documentElement.getAttribute('data-theme');
|
||||
var newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
||||
document.documentElement.setAttribute('data-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateIcon();
|
||||
|
||||
// Trigger Artalk theme update
|
||||
if (window.artalk) {
|
||||
window.artalk.setDarkMode(newTheme === 'dark');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 3. To Comments
|
||||
var toComments = document.getElementById('to-comments');
|
||||
if (toComments) {
|
||||
var newToComments = toComments.cloneNode(true);
|
||||
toComments.parentNode.replaceChild(newToComments, toComments);
|
||||
toComments = newToComments;
|
||||
|
||||
toComments.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
var comments = document.getElementById('Comments');
|
||||
if (comments) {
|
||||
comments.scrollIntoView({ behavior: 'smooth' });
|
||||
} else {
|
||||
var artalkEl = document.querySelector('.artalk');
|
||||
if (artalkEl) {
|
||||
artalkEl.scrollIntoView({ behavior: 'smooth' });
|
||||
} else {
|
||||
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,88 @@
|
||||
(function() {
|
||||
var defaults = {
|
||||
showTime: 800,
|
||||
offsetBottom: 0,
|
||||
offsetTopm: 50,
|
||||
onLoadBackEnd: function (index, dom) { },
|
||||
onLoadBackStart: function (index, dom) { }
|
||||
};
|
||||
|
||||
var observer;
|
||||
|
||||
function init(setting) {
|
||||
defaults = Object.assign({}, defaults, setting || {});
|
||||
|
||||
// Initialize IntersectionObserver
|
||||
if (!observer) {
|
||||
observer = new IntersectionObserver(function(entries, self) {
|
||||
entries.forEach(function(entry) {
|
||||
if (entry.isIntersecting) {
|
||||
var img = entry.target;
|
||||
showImg(img);
|
||||
self.unobserve(img);
|
||||
}
|
||||
});
|
||||
}, {
|
||||
rootMargin: defaults.offsetTopm + "px 0px " + defaults.offsetBottom + "px 0px"
|
||||
});
|
||||
}
|
||||
|
||||
processImages();
|
||||
}
|
||||
|
||||
function processImages() {
|
||||
var images = document.querySelectorAll('img:not(.blog-img):not([data-comp])');
|
||||
images.forEach(function(img) {
|
||||
// Check if already processed or has data-lazy-src
|
||||
if (img.getAttribute('data-lazy-src')) {
|
||||
// Already setup for lazy load, just observe
|
||||
observer.observe(img);
|
||||
} else if (img.getAttribute('src')) {
|
||||
// Convert to lazy load
|
||||
var src = img.getAttribute('src');
|
||||
img.setAttribute('data-lazy-src', src);
|
||||
img.setAttribute('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
|
||||
observer.observe(img);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showImg(dom) {
|
||||
if (dom.getAttribute('data-comp')) return;
|
||||
dom.setAttribute('data-comp', 'true');
|
||||
|
||||
var src = dom.getAttribute('data-lazy-src');
|
||||
if (!src) return;
|
||||
|
||||
// Create a temporary image to preload
|
||||
var temp = new Image();
|
||||
temp.onload = function() {
|
||||
// Prepare for transition
|
||||
dom.style.opacity = 0;
|
||||
dom.style.transition = "opacity " + (defaults.showTime / 1000) + "s ease-in-out";
|
||||
|
||||
// Swap source
|
||||
dom.setAttribute('src', src);
|
||||
|
||||
// Force reflow
|
||||
void dom.offsetWidth;
|
||||
|
||||
// Fade in
|
||||
dom.style.opacity = 1;
|
||||
};
|
||||
temp.onerror = function() {
|
||||
// On error, show anyway
|
||||
dom.setAttribute('src', src);
|
||||
dom.style.opacity = 1;
|
||||
};
|
||||
temp.src = src;
|
||||
}
|
||||
|
||||
function tryAgain() {
|
||||
processImages();
|
||||
}
|
||||
|
||||
window.lazyLoadInit = init;
|
||||
window.lazyLoadAgain = tryAgain;
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,17 @@
|
||||
window.initLoader = function() {
|
||||
var loader = document.getElementById('loader');
|
||||
if (!loader) return;
|
||||
|
||||
// 定时关闭
|
||||
setTimeout(function() {
|
||||
loader.classList.add('hide');
|
||||
}, 30000);
|
||||
|
||||
// 点击关闭
|
||||
var closeBtn = document.getElementById('closeloader');
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', function() {
|
||||
loader.classList.add('hide');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,196 @@
|
||||
window.initSearch = function() {
|
||||
initSearchModal();
|
||||
initInlineSearch();
|
||||
};
|
||||
|
||||
function loadSearchIndex() {
|
||||
if (!window.searchIndex) {
|
||||
return fetch('/index.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
window.searchIndex = data;
|
||||
return data;
|
||||
})
|
||||
.catch(err => console.error('Failed to load search index:', err));
|
||||
}
|
||||
return Promise.resolve(window.searchIndex);
|
||||
}
|
||||
|
||||
function initSearchModal() {
|
||||
var searchBtn = document.getElementById('search-btn');
|
||||
var searchModal = document.getElementById('search-modal');
|
||||
|
||||
if (searchBtn && searchModal) {
|
||||
// Clone to remove old listeners
|
||||
var newSearchBtn = searchBtn.cloneNode(true);
|
||||
searchBtn.parentNode.replaceChild(newSearchBtn, searchBtn);
|
||||
searchBtn = newSearchBtn;
|
||||
|
||||
searchBtn.addEventListener('click', function() {
|
||||
searchModal.classList.add('show');
|
||||
var input = document.getElementById('search-input');
|
||||
if (input) setTimeout(function() { input.focus(); }, 100);
|
||||
|
||||
loadSearchIndex();
|
||||
});
|
||||
|
||||
// Close logic
|
||||
var closeBtn = searchModal.querySelector('.close-search');
|
||||
if (closeBtn) {
|
||||
closeBtn.onclick = function() {
|
||||
searchModal.classList.remove('show');
|
||||
};
|
||||
}
|
||||
|
||||
// Click outside to close
|
||||
searchModal.onclick = function(e) {
|
||||
if (e.target === searchModal) {
|
||||
searchModal.classList.remove('show');
|
||||
}
|
||||
};
|
||||
|
||||
// Search Input Logic
|
||||
var searchInput = document.getElementById('search-input');
|
||||
var searchResults = document.getElementById('search-results');
|
||||
|
||||
if (searchInput && searchResults) {
|
||||
// Clone input to remove old listeners
|
||||
var newInput = searchInput.cloneNode(true);
|
||||
searchInput.parentNode.replaceChild(newInput, searchInput);
|
||||
searchInput = newInput;
|
||||
|
||||
// Clone results to remove old listeners
|
||||
var newResults = searchResults.cloneNode(true);
|
||||
searchResults.parentNode.replaceChild(newResults, searchResults);
|
||||
searchResults = newResults;
|
||||
|
||||
// Close modal when a result is clicked
|
||||
searchResults.addEventListener('click', function(e) {
|
||||
if (e.target.closest('a')) {
|
||||
searchModal.classList.remove('show');
|
||||
}
|
||||
});
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
var query = this.value.trim().toLowerCase();
|
||||
if (!window.searchIndex || query.length === 0) {
|
||||
searchResults.innerHTML = '<p class="search-tip">输入关键词并回车进行搜索</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
var results = window.searchIndex.filter(function(item) {
|
||||
return (item.title && item.title.toLowerCase().includes(query)) ||
|
||||
(item.summary && item.summary.toLowerCase().includes(query));
|
||||
});
|
||||
|
||||
if (results.length > 0) {
|
||||
var html = results.map(function(item) {
|
||||
return `
|
||||
<div class="search-result-item">
|
||||
<a href="${item.permalink}" class="search-result-title">${item.title}</a>
|
||||
<span class="search-result-date">${item.date}</span>
|
||||
<div class="search-result-summary">${item.summary || ''}</div>
|
||||
</div>
|
||||
`;
|
||||
}).join('');
|
||||
searchResults.innerHTML = html;
|
||||
|
||||
// Refresh PJAX to recognize new links
|
||||
if (window.pjax) {
|
||||
window.pjax.refresh(searchResults);
|
||||
}
|
||||
} else {
|
||||
searchResults.innerHTML = '<p class="search-tip">未找到相关文章</p>';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initInlineSearch() {
|
||||
var header = document.getElementById('essay-header');
|
||||
var searchContainer = document.getElementById('search-container');
|
||||
var input = document.getElementById('inline-search-input');
|
||||
var resultsContainer = document.getElementById('inline-search-results');
|
||||
|
||||
window.toggleSearchMode = function(show) {
|
||||
if (!header || !searchContainer || !input || !resultsContainer) return;
|
||||
|
||||
if (show) {
|
||||
header.style.display = 'none';
|
||||
searchContainer.style.display = 'block';
|
||||
input.focus();
|
||||
loadSearchIndex();
|
||||
} else {
|
||||
header.style.display = 'inline-flex';
|
||||
searchContainer.style.display = 'none';
|
||||
input.value = '';
|
||||
resultsContainer.classList.remove('show');
|
||||
resultsContainer.innerHTML = '';
|
||||
}
|
||||
};
|
||||
|
||||
if (!header || !searchContainer || !input || !resultsContainer) return;
|
||||
|
||||
// Input Event
|
||||
var newInput = input.cloneNode(true);
|
||||
input.parentNode.replaceChild(newInput, input);
|
||||
input = newInput;
|
||||
|
||||
input.addEventListener('input', function() {
|
||||
var query = this.value.trim().toLowerCase();
|
||||
|
||||
if (query.length === 0) {
|
||||
resultsContainer.classList.remove('show');
|
||||
resultsContainer.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!window.searchIndex) return;
|
||||
|
||||
var results = window.searchIndex.filter(function(item) {
|
||||
return (item.title && item.title.toLowerCase().includes(query)) ||
|
||||
(item.summary && item.summary.toLowerCase().includes(query));
|
||||
});
|
||||
|
||||
if (results.length > 0) {
|
||||
var html = results.slice(0, 5).map(function(item) {
|
||||
return `
|
||||
<a href="${item.permalink}" class="search-result-item" style="display:block; text-decoration:none;" onclick="window.toggleSearchMode(false)">
|
||||
<span class="search-result-title">${item.title}</span>
|
||||
<div style="display:flex; align-items:center;">
|
||||
<span class="search-result-date">${item.date}</span>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}).join('');
|
||||
|
||||
resultsContainer.innerHTML = html;
|
||||
resultsContainer.classList.add('show');
|
||||
|
||||
// PJAX Refresh
|
||||
if (window.pjax) {
|
||||
window.pjax.refresh(resultsContainer);
|
||||
}
|
||||
} else {
|
||||
resultsContainer.innerHTML = '<div class="search-result-item" style="text-align:center;color:#999;cursor:default;">无搜索结果</div>';
|
||||
resultsContainer.classList.add('show');
|
||||
}
|
||||
});
|
||||
|
||||
// Close on click outside
|
||||
if (!window.inlineSearchClickOutside) {
|
||||
window.inlineSearchClickOutside = function(e) {
|
||||
var header = document.getElementById('essay-header');
|
||||
var searchContainer = document.getElementById('search-container');
|
||||
var resultsContainer = document.getElementById('inline-search-results');
|
||||
|
||||
if (header && searchContainer && resultsContainer && searchContainer.style.display === 'block') {
|
||||
if (!searchContainer.contains(e.target) && !header.contains(e.target) && !resultsContainer.contains(e.target)) {
|
||||
window.toggleSearchMode(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
document.addEventListener('click', window.inlineSearchClickOutside);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// 判断是否为移动端
|
||||
window.isMobile = function() {
|
||||
if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
|
||||
return true; // 移动端
|
||||
} else {
|
||||
return false; // PC端
|
||||
}
|
||||
};
|
||||
@@ -1,26 +1,55 @@
|
||||
// 定义pjax 预设pjax
|
||||
(function() {
|
||||
if (typeof Pjax === 'undefined') {
|
||||
console.error('Pjax library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
var pjax = new Pjax({
|
||||
// 这里填写页面中改变的部分(和 CSS 选择器用法一样)
|
||||
selectors: ["title", "#pjax-container"],
|
||||
cacheBust: false,
|
||||
elements: "a"
|
||||
// 移除 sideBySide,改用默认替换以配合骨架屏逻辑
|
||||
elements: "a", // 拦截所有链接
|
||||
switches: {
|
||||
"#pjax-container": Pjax.switches.default
|
||||
}
|
||||
});
|
||||
// 设置图片灯箱回调函数
|
||||
// Removed redundant lazyimg_pjax definition as EasyLazyload.min.js handles it globally now
|
||||
|
||||
// 将 pjax 实例挂载到 window 以便调试或外部访问
|
||||
window.pjax = pjax;
|
||||
|
||||
console.log("Pjax initialized:", pjax);
|
||||
})();
|
||||
|
||||
// pjax预先加载代码
|
||||
function pjax_reload() {
|
||||
console.log("Pjax reload triggered");
|
||||
// 给pjax容器加入css过渡动画
|
||||
// $("#pjax-container").addClass("uk-animation-slide-bottom-small");
|
||||
// var pjaxContainer = document.getElementById("pjax-container");
|
||||
// if (pjaxContainer) pjaxContainer.classList.add("uk-animation-slide-bottom-small");
|
||||
|
||||
// 评论区过渡动画
|
||||
$(".comment-meta").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
$(".comment-author vcard").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
$(".comment-metadata").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
$(".comment-content").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
$(".reply").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
var selectors = [
|
||||
".comment-meta",
|
||||
".comment-author vcard",
|
||||
".comment-metadata",
|
||||
".comment-content",
|
||||
".reply"
|
||||
];
|
||||
|
||||
selectors.forEach(function(selector) {
|
||||
document.querySelectorAll(selector).forEach(function(el) {
|
||||
el.setAttribute("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
});
|
||||
});
|
||||
|
||||
// 说说页面过渡动画
|
||||
$("#shuoshuo_body").attr("uk-scrollspy", "target: > .shuoshuo; cls: uk-animation-fade; delay: 250");
|
||||
var shuoshuoBody = document.getElementById("shuoshuo_body");
|
||||
if (shuoshuoBody) {
|
||||
shuoshuoBody.setAttribute("uk-scrollspy", "target: > .shuoshuo; cls: uk-animation-fade; delay: 250");
|
||||
}
|
||||
}
|
||||
|
||||
// pjax发送时期
|
||||
document.addEventListener("pjax:send", function () {
|
||||
// pjax动画减少圆圈动画
|
||||
@@ -30,9 +59,11 @@ document.addEventListener("pjax:send", function () {
|
||||
// pjax执行动画开始
|
||||
NProgress.start(); //加载动画效果开始
|
||||
});
|
||||
|
||||
// Pjax 成功后,重新加载下面的函数
|
||||
document.addEventListener("pjax:success", function () {
|
||||
// 重载图片懒加载插件的js
|
||||
if (typeof lazyLoadInit === 'function') {
|
||||
lazyLoadInit({
|
||||
// coverColor: "white",
|
||||
// coverDiv: "<div style='display: flex; justify-content: center; align-items: center; height: 200px; color: #000000;'><span>优世界·一个记录生活点滴的小站</span></div>",
|
||||
@@ -40,33 +71,45 @@ document.addEventListener("pjax:success", function () {
|
||||
offsetTopm: 800,
|
||||
showTime: 1100
|
||||
});
|
||||
}
|
||||
// 激活文章图片灯箱
|
||||
window.ViewImage && ViewImage.init('.post-content img');
|
||||
if (window.ViewImage) {
|
||||
ViewImage.init('.post-content img');
|
||||
}
|
||||
});
|
||||
|
||||
// pjax加载完成
|
||||
document.addEventListener("pjax:complete", function () {
|
||||
// pjax完成动画
|
||||
if (typeof NProgress !== 'undefined') {
|
||||
NProgress.done();
|
||||
}
|
||||
|
||||
// 重载一些js样式调整
|
||||
pjax_reload()
|
||||
pjax_reload();
|
||||
|
||||
// 初始化代码复制
|
||||
initCodeCopy()
|
||||
if (typeof initCodeCopy === 'function') initCodeCopy();
|
||||
|
||||
// 初始化代码折叠
|
||||
initCodeFold()
|
||||
if (typeof initCodeFold === 'function') initCodeFold();
|
||||
|
||||
// 初始化友链状态
|
||||
if (typeof window.initLinkStatus === 'function') {
|
||||
window.initLinkStatus();
|
||||
}
|
||||
|
||||
// 重载评论
|
||||
if (typeof window.initArtalk === 'function') {
|
||||
window.initArtalk();
|
||||
}
|
||||
|
||||
// 重载不蒜子统计
|
||||
if (typeof window.bsz_fetch === 'function') {
|
||||
window.bsz_fetch();
|
||||
}
|
||||
|
||||
// 重载 Search 和 Floating Tools (Moved from main.js)
|
||||
if (typeof window.initFloatingTools === 'function') window.initFloatingTools();
|
||||
if (typeof window.initSearch === 'function') window.initSearch();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,9 +3,30 @@
|
||||
<div class="post-content" itemprop="articleBody" uk-scrollspy="target: > *; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
{{ .Content }}
|
||||
|
||||
<!-- Album Section -->
|
||||
{{ $sectionCount := 0 }}
|
||||
|
||||
<!-- Heatmap Section -->
|
||||
{{ if site.Params.about.enableheatmap }}
|
||||
{{ $sectionCount = add $sectionCount 1 }}
|
||||
<div style="margin-top: 40px;">
|
||||
<div class="section-title">03 / 光影 (Album)</div>
|
||||
<div class="section-title">{{ printf "%02d" $sectionCount }} / 热力图 (Hot Map)</div>
|
||||
{{ partial "heatmap.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<!-- Skills Section -->
|
||||
{{ if site.Params.about.enableskills }}
|
||||
{{ $sectionCount = add $sectionCount 1 }}
|
||||
<div style="margin-top: 40px;">
|
||||
<div class="section-title">{{ printf "%02d" $sectionCount }} / 技能栈 (System Ops)</div>
|
||||
{{ partial "skills.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<!-- Album Section -->
|
||||
{{ $sectionCount = add $sectionCount 1 }}
|
||||
<div style="margin-top: 40px;">
|
||||
<div class="section-title">{{ printf "%02d" $sectionCount }} / 光影 (Album)</div>
|
||||
<div class="album-content" uk-scrollspy="target: > .album-item; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
{{ range site.Data.album }}
|
||||
<div class="album-item">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="category-content">
|
||||
{{ $paginator := .Paginate .Pages }}
|
||||
{{ range $paginator.Pages.GroupByDate "2006" }}
|
||||
<div class="year-group" data-aos="fade-up" data-aos-delay="100">
|
||||
<div class="year-group" uk-scrollspy="cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
<h2 class="year-title">{{ .Key }}</h2>
|
||||
<ul class="year-list">
|
||||
{{ range .Pages }}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
{{ $iconfont := resources.Get "js/iconfont.js" }}
|
||||
{{ $lightgallery := resources.Get "js/lightgallery.umd.min.js" }}
|
||||
{{ $uikit := resources.Get "js/uikit.min.js" }}
|
||||
{{ $easylazyload := resources.Get "js/EasyLazyload.min.js" }}
|
||||
{{ $easylazyload := resources.Get "js/modules/lazyload.js" }}
|
||||
{{ $viewimage := resources.Get "js/view-image.min.js" }}
|
||||
{{ $artalk := resources.Get "js/Artalk.js" }}
|
||||
{{ $barrage := resources.Get "js/barrage.js" }}
|
||||
@@ -61,7 +61,15 @@
|
||||
{{ $echarts := resources.Get "js/echarts.min.js" }}
|
||||
{{ $tiaozhuan := resources.Get "js/tiaozhuan.js" }}
|
||||
|
||||
{{ $scripts := slice $iconfont $lightgallery $uikit $easylazyload $viewimage $artalk $barrage $main $mypjax $nprogress $message $echarts $tiaozhuan | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint }}
|
||||
{{/* Modules */}}
|
||||
{{ $utils := resources.Get "js/modules/utils.js" }}
|
||||
{{ $loader := resources.Get "js/modules/loader.js" }}
|
||||
{{ $search := resources.Get "js/modules/search.js" }}
|
||||
{{ $floatingTools := resources.Get "js/modules/floating-tools.js" }}
|
||||
{{ $artalkModule := resources.Get "js/modules/artalk.js" }}
|
||||
{{ $pjaxLib := resources.Get "js/pjax.js" }}
|
||||
|
||||
{{ $scripts := slice $iconfont $lightgallery $uikit $easylazyload $viewimage $artalk $barrage $utils $loader $search $floatingTools $artalkModule $nprogress $pjaxLib $main $mypjax $message $echarts $tiaozhuan | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint }}
|
||||
<script src="{{ $scripts.RelPermalink }}"></script>
|
||||
<script async src="/js/bsz.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -205,11 +205,10 @@
|
||||
height: 50%;
|
||||
}
|
||||
</style>
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<!-- <script src="/js/jquery.min.js"></script> -->
|
||||
|
||||
|
||||
<script src="/js/instantpage.min.js" type="module" defer></script>
|
||||
<script src="/js/pjax.js"></script>
|
||||
{{ if or (eq .Type "about") (eq .Type "post") }}
|
||||
<link rel="stylesheet" href="/css/mywaline.css" />
|
||||
{{ end }}
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
<style>
|
||||
.heatmap-scroll-wrapper {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.heatmap-scroll-wrapper::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="heatmap-wrapper" class="heatmap-scroll-wrapper">
|
||||
<div id="heatmap" style="max-width: 800px; height: 160px; margin: 0 auto 0px auto; padding: 10px; border-radius: 10px; transition: all 0.3s ease; display: block !important; visibility: visible !important; min-width: 300px;"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function renderHeatmap() {
|
||||
if (!window.echarts) {
|
||||
console.warn("ECharts not loaded yet, retrying...");
|
||||
setTimeout(renderHeatmap, 500);
|
||||
return;
|
||||
}
|
||||
var chartDom = document.getElementById('heatmap');
|
||||
if (!chartDom) {
|
||||
console.warn("Heatmap DOM not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Dispose existing instance if any
|
||||
var existing = echarts.getInstanceByDom(chartDom);
|
||||
if (existing) {
|
||||
existing.dispose();
|
||||
}
|
||||
|
||||
var myChart = echarts.init(chartDom, null, { renderer: 'svg' });
|
||||
|
||||
// Check mobile state
|
||||
var isMobile = window.innerWidth < 768;
|
||||
|
||||
// Handle resize with debouncing and re-render for responsive range
|
||||
var resizeTimer;
|
||||
window.addEventListener('resize', function() {
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(function() {
|
||||
var newIsMobile = window.innerWidth < 768;
|
||||
if (newIsMobile !== isMobile) {
|
||||
// Re-render if switching between mobile/desktop to update range
|
||||
renderHeatmap();
|
||||
} else {
|
||||
myChart.resize();
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Data Processing
|
||||
var dataMap = new Map();
|
||||
{{ range where .Site.RegularPages "Type" "post" }}
|
||||
var key = "{{ .Date.Format "2006-01-02" }}";
|
||||
var link = "{{ .RelPermalink }}";
|
||||
var title = "{{ .Title }}";
|
||||
var wordCount = {{ .WordCount }};
|
||||
|
||||
if (!dataMap.has(key)) {
|
||||
dataMap.set(key, []);
|
||||
}
|
||||
dataMap.get(key).push({link, title, wordCount});
|
||||
{{- end -}}
|
||||
|
||||
var data = [];
|
||||
for (const [key, value] of dataMap.entries()) {
|
||||
data.push([key, value.length]);
|
||||
}
|
||||
|
||||
// Date Range Logic
|
||||
var endDate = new Date();
|
||||
var startDate = new Date();
|
||||
|
||||
if (isMobile) {
|
||||
// Mobile: Show last 5 months to fit screen
|
||||
startDate.setMonth(startDate.getMonth() - 5);
|
||||
} else {
|
||||
// Desktop: Show last 12 months
|
||||
startDate.setFullYear(startDate.getFullYear() - 1);
|
||||
}
|
||||
|
||||
var startDateStr = echarts.format.formatTime('yyyy-MM-dd', startDate);
|
||||
var endDateStr = echarts.format.formatTime('yyyy-MM-dd', endDate);
|
||||
|
||||
// Theme Logic
|
||||
var isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
|
||||
// Minimalist Monochrome Colors (Black/White/Gray)
|
||||
// Light: Light Gray -> Black
|
||||
var colorLight = ['#f0f0f0', '#d9d9d9', '#a6a6a6', '#737373', '#000000'];
|
||||
// Dark: Dark Gray -> White
|
||||
var colorDark = ['#1f1f1f', '#404040', '#737373', '#a6a6a6', '#ffffff'];
|
||||
|
||||
var rangeColors = isDark ? colorDark : colorLight;
|
||||
var calendarLabelColor = isDark ? '#a6a6a6' : '#737373';
|
||||
|
||||
var option = {
|
||||
tooltip: {
|
||||
padding: 10,
|
||||
backgroundColor: isDark ? '#2d2d2d' : '#ffffff',
|
||||
borderColor: isDark ? '#444' : '#eee',
|
||||
borderWidth: 1,
|
||||
textStyle: {
|
||||
color: isDark ? '#eee' : '#333',
|
||||
fontSize: 12
|
||||
},
|
||||
formatter: function (p) {
|
||||
const date = p.data[0];
|
||||
const posts = dataMap.get(date);
|
||||
if (!posts) return;
|
||||
|
||||
var content = `<div style="font-weight:bold; margin-bottom:5px;">${date}</div>`;
|
||||
content += `<div style="max-height:150px; overflow-y:auto;">`;
|
||||
for (const post of posts) {
|
||||
content += `<div style="margin-bottom:2px;">`;
|
||||
content += `<a href="${post.link}" target="_blank" style="color:${isDark ? '#fff' : '#000'}; text-decoration:none;">${post.title}</a>`;
|
||||
content += `</div>`;
|
||||
}
|
||||
content += `</div>`;
|
||||
return content;
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 4,
|
||||
type: 'piecewise',
|
||||
orient: 'horizontal',
|
||||
left: 'center',
|
||||
top: 0,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: rangeColors.slice(1)
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
top: 30,
|
||||
left: 'center',
|
||||
range: [startDateStr, endDateStr],
|
||||
cellSize: ['auto', 13],
|
||||
splitLine: { show: false },
|
||||
itemStyle: {
|
||||
color: isDark ? '#1f1f1f' : '#f0f0f0',
|
||||
borderWidth: 2,
|
||||
borderColor: isDark ? '#121212' : '#ffffff'
|
||||
},
|
||||
yearLabel: { show: false },
|
||||
monthLabel: {
|
||||
nameMap: 'CN',
|
||||
color: calendarLabelColor,
|
||||
fontSize: 12
|
||||
},
|
||||
dayLabel: {
|
||||
show: true,
|
||||
firstDay: 1,
|
||||
nameMap: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
color: calendarLabelColor,
|
||||
fontSize: 10
|
||||
}
|
||||
},
|
||||
series: {
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
data: data,
|
||||
itemStyle: {
|
||||
borderRadius: 2
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
myChart.setOption(option);
|
||||
}
|
||||
|
||||
// Initial render
|
||||
if (window.echarts) {
|
||||
renderHeatmap();
|
||||
} else {
|
||||
// Retry a few times if script is still loading
|
||||
setTimeout(renderHeatmap, 500);
|
||||
setTimeout(renderHeatmap, 1500);
|
||||
setTimeout(renderHeatmap, 3000);
|
||||
}
|
||||
|
||||
// Re-render on theme change
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type == "attributes" && mutation.attributeName == "data-theme") {
|
||||
renderHeatmap();
|
||||
}
|
||||
});
|
||||
});
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,68 @@
|
||||
<section class="skills-section" style="margin-top: 0;">
|
||||
<div class="skills-container">
|
||||
<div class="skills-row">
|
||||
<div class="skills-track">
|
||||
<span class="skill-tag">Linux</span>
|
||||
<span class="skill-tag">CentOS</span>
|
||||
<span class="skill-tag">Ubuntu</span>
|
||||
<span class="skill-tag">Debian</span>
|
||||
<span class="skill-tag">RedHat</span>
|
||||
<span class="skill-tag">Alpine</span>
|
||||
<span class="skill-tag">Linux</span>
|
||||
<span class="skill-tag">CentOS</span>
|
||||
<span class="skill-tag">Ubuntu</span>
|
||||
<span class="skill-tag">Debian</span>
|
||||
<span class="skill-tag">RedHat</span>
|
||||
<span class="skill-tag">Alpine</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skills-row">
|
||||
<div class="skills-track skills-track-reverse">
|
||||
<span class="skill-tag">Docker</span>
|
||||
<span class="skill-tag">Kubernetes</span>
|
||||
<span class="skill-tag">Nginx</span>
|
||||
<span class="skill-tag">Apache</span>
|
||||
<span class="skill-tag">Tomcat</span>
|
||||
<span class="skill-tag">Caddy</span>
|
||||
<span class="skill-tag">Docker</span>
|
||||
<span class="skill-tag">Kubernetes</span>
|
||||
<span class="skill-tag">Nginx</span>
|
||||
<span class="skill-tag">Apache</span>
|
||||
<span class="skill-tag">Tomcat</span>
|
||||
<span class="skill-tag">Caddy</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skills-row">
|
||||
<div class="skills-track">
|
||||
<span class="skill-tag">Shell</span>
|
||||
<span class="skill-tag">Python</span>
|
||||
<span class="skill-tag">MySQL</span>
|
||||
<span class="skill-tag">Redis</span>
|
||||
<span class="skill-tag">MongoDB</span>
|
||||
<span class="skill-tag">PostgreSQL</span>
|
||||
<span class="skill-tag">Shell</span>
|
||||
<span class="skill-tag">Python</span>
|
||||
<span class="skill-tag">MySQL</span>
|
||||
<span class="skill-tag">Redis</span>
|
||||
<span class="skill-tag">MongoDB</span>
|
||||
<span class="skill-tag">PostgreSQL</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skills-row">
|
||||
<div class="skills-track skills-track-reverse">
|
||||
<span class="skill-tag">Git</span>
|
||||
<span class="skill-tag">Jenkins</span>
|
||||
<span class="skill-tag">Ansible</span>
|
||||
<span class="skill-tag">Prometheus</span>
|
||||
<span class="skill-tag">Grafana</span>
|
||||
<span class="skill-tag">ELK</span>
|
||||
<span class="skill-tag">Git</span>
|
||||
<span class="skill-tag">Jenkins</span>
|
||||
<span class="skill-tag">Ansible</span>
|
||||
<span class="skill-tag">Prometheus</span>
|
||||
<span class="skill-tag">ELK</span>
|
||||
<span class="skill-tag">Git</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
|
||||
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={IDLine truncated
|
||||
a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e=Line truncated
|
||||
null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?bLine truncated
|
||||
@@ -1,7 +0,0 @@
|
||||
/*!
|
||||
* scrollup v2.4.1
|
||||
* Url: http://markgoodyear.com/labs/scrollup/
|
||||
* Copyright (c) Mark Goodyear — @markgdyr — http://markgoodyear.com
|
||||
* License: MIT
|
||||
*/
|
||||
!function(l,o,e){"use strict";l.fn.scrollUp=function(o){l.data(e.body,"scrollUp")||(l.data(e.body,"scrollUp",!0),l.fn.scrollUp.init(o))},l.fn.scrollUp.init=function(r){var s,t,c,i,n,a,d,p=l.fn.scrollUp.settings=l.extend({},l.fn.scrollUp.defaults,r),f=!1;switch(d=p.scrollTrigger?l(p.scrollTrigger):l("<a/>",{id:p.scrollName,href:"#top"}),p.scrollTitle&&d.attr("title",p.scrollTitle),d.appendTo("body"),p.scrollImg||p.scrollTrigger||d.html(p.scrollText),d.css({display:"none",position:"fixed",zIndex:p.zIndex}),p.activeOverlay&&l("<div/>",{id:p.scrollName+"-active"}).css({position:"absolute",top:p.scrollDistance+"px",width:"100%",borderTop:"1px dotted"+p.activeOverlay,zIndex:p.zIndex}).appendTo("body"),p.animation){case"fade":s="fadeIn",t="fadeOut",c=p.animationSpeed;break;case"slide":s="slideDown",t="slideUp",c=p.animationSpeed;break;default:s="show",t="hide",c=0}i="top"===p.scrollFrom?p.scrollDistance:l(e).height()-l(o).height()-p.scrollDistance,n=l(o).scroll(function(){l(o).scrollTop()>i?f||(d[s](c),f=!0):f&&(d[t](c),f=!1)}),p.scrollTarget?"number"==typeof p.scrollTarget?a=p.scrollTarget:"string"==typeof p.scrollTarget&&(a=Math.floor(l(p.scrollTarget).offset().top)):a=0,d.click(function(o){o.preventDefault(),l("html, body").animate({scrollTop:a},p.scrollSpeed,p.easingType)})},l.fn.scrollUp.defaults={scrollName:"scrollUp",scrollDistance:300,scrollFrom:"top",scrollSpeed:300,easingType:"linear",animation:"fade",animationSpeed:200,scrollTrigger:!1,scrollTarget:!1,scrollText:"Scroll to top",scrollTitle:!1,scrollImg:!1,activeOverlay:!1,zIndex:2147483647},l.fn.scrollUp.destroy=function(r){l.removeData(e.body,"scrollUp"),l("#"+l.fn.scrollUp.settings.scrollName).remove(),l("#"+l.fn.scrollUp.settings.scrollName+"-active").remove(),l.fn.jquery.split(".")[1]>=7?l(o).off("scroll",r):l(o).unbind("scroll",r)},l.scrollUp=l.fn.scrollUp}(jQuery,window,document);
|
||||
Reference in new issue
Block a user