AI摘要
本文介绍了如何美化Argon博客主题,包括配置JSON、年度倒计时、音乐播放器、资源下载等,并提供了一键配置代码和进阶美化方案,如动态渐变背景、3D卡片悬浮效果等。
🎨 Argon 博客主题美化完全指南
🙏 致谢声明
本文主要内容借鉴�?Echi小窝 的原创文章,在此向原作者表示衷心感谢!
正是通过 Echo小窝 博主的详细教程,我才能顺利完成博客美化。希望本文也能帮助到你!
📋 目录导航
1.博客美化 JSON
{cat_tips_info color=""}注意:可复制一键导入{/cat_tips_info}
别忘记在主题设置页面修改头像、背景以及底部信息等设置哦(博客背景 url 已失效,需自己填写)
建议主题设置全局 CDN 选择不使用或更换为自己的,否则可能出现 CSS 样式失效
{"argon_theme_color":"#5e72e4","argon_theme_color_hex_preview":"#5e72e4","argon_show_customize_theme_color_picker":true,"argon_enable_immersion_color":"true","argon_darkmode_autoswitch":"time","argon_enable_amoled_dark":"false","argon_card_radius":"15","argon_card_shadow":"default","argon_page_layout":"double","argon_article_list_waterflow":"2","argon_article_list_layout":"1","argon_font":"serif","argon_assets_path":"jsdelivr_fastly","argon_custom_assets_path":"","argon_wp_path":"/","argon_dateformat":"YMD","argon_enable_headroom":"true","argon_toolbar_title":"Echo","argon_toolbar_icon":"","argon_toolbar_icon_link":" ","argon_toolbar_blur":"true","argon_banner_title":"Echo‘s blog","argon_banner_subtitle":"Banner 副标题","argon_banner_size":"fullscreen","argon_page_background_banner_style":"transparent","argon_show_toolbar_mask":true,"argon_banner_background_url":"--bing--","argon_banner_background_color_type":"shape-primary","argon_banner_background_hide_shapes":true,"argon_enable_banner_title_typing_effect":"true","argon_banner_typing_effect_interval":"100","argon_page_background_url":"https://yy.liveout.cn/background/wallhaven-yxjm57_1920x1080.png","argon_page_background_dark_url":"https://yy.liveout.cn/background/wallhaven-6dqjdl_1920x1080.png","argon_page_background_opacity":"1","argon_sidebar_banner_title":"左侧栏标题","argon_sidebar_banner_subtitle":"左侧栏子标题(格言)","argon_sidebar_auther_name":"Echo","argon_sidebar_auther_image":"https://yy.liveout.cn/photo/photo1.png","argon_sidebar_author_description":"左侧栏作者简介","argon_sidebar_announcement":"","argon_fab_show_settings_button":"false","argon_fab_show_darkmode_button":"true","argon_fab_show_gotocomment_button":"false","argon_seo_description":"网站描述 (Description Meta 标签)","argon_seo_keywords":"搜索引擎关键词(Keywords Meta 标签)","argon_article_meta":"time|categories|views","argon_show_readingtime":"true","argon_reading_speed":"580","argon_reading_speed_en":"80","argon_reading_speed_code":"10","argon_show_thumbnail_in_banner_in_content_page":"false","argon_first_image_as_thumbnail_by_default":"true","argon_reference_list_title":"参考","argon_show_sharebtn":"true","argon_show_headindex_number":"false","argon_donate_qrcode_url":"https://www.liveout.cn/wp-content/uploads/2022/10/wechat1.jpg","argon_additional_content_after_post":"文末附加内容","argon_related_post":"category,tag","argon_related_post_sort_orderby":"meta_value_num","argon_related_post_sort_order":"DESC","argon_related_post_limit":"10","argon_article_header_style":"article-header-style-2","argon_outdated_info_time_type":"createdtime","argon_outdated_info_days":"1","argon_outdated_info_tip_type":"inpost","argon_outdated_info_tip_content":"本文最后更新于%modify_date_delta% 天前,其中的信息可能已经过时,如有错误请发送邮件到big_fw@foxmail.com","argon_archives_timeline_show_month":"true","argon_archives_timeline_url":"https://www.liveout.cn/pigeonhole/","argon_footer_html":"<style>\n/* 核心样式 */\n.github-badge {\ndisplay: inline-block;\nborder-radius: 4px;\ntext-shadow: none;\nfont-size: 13.1px;\ncolor: #fff;\nline-height: 15px;\nmargin-bottom: 5px;\nfont-family: \"Open Sans\", sans-serif;\n}\n.github-badge .badge-subject {\ndisplay: inline-block;\nbackground-color: #4d4d4d;\npadding: 4px 4px 4px 6px;\nborder-top-left-radius: 4px;\nborder-bottom-left-radius: 4px;\nfont-family: \"Open Sans\", sans-serif;\n}\n.github-badge .badge-value {\ndisplay: inline-block;\npadding: 4px 6px 4px 4px;\nborder-top-right-radius: 4px;\nborder-bottom-right-radius: 4px;\nfont-family: \"Open Sans\", sans-serif;\n}\n.github-badge-big {\ndisplay: inline-block;\nborder-radius: 6px;\ntext-shadow: none;\nfont-size: 14.1px;\ncolor: #fff;\nline-height: 18px;\nmargin-bottom: 7px;\n}\n.github-badge-big .badge-subject {\ndisplay: inline-block;\nbackground-color: #4d4d4d;\npadding: 4px 4px 4px 6px;\nborder-top-left-radius: 4px;\nborder-bottom-left-radius: 4px;\n}\n.github-badge-big .badge-value {\ndisplay: inline-block;\npadding: 4px 6px 4px 4px;\nborder-top-right-radius: 4px;\nborder-bottom-right-radius: 4px;\n}\n.bg-orange {\nbackground-color: #ec8a64 !important;\n}\n.bg-red {\nbackground-color: #cb7574 !important;\n}\n.bg-apricots {\nbackground-color: #f7c280 !important;\n}\n.bg-casein {\nbackground-color: #dfe291 !important;\n}\n.bg-shallots {\nbackground-color: #97c3c6 !important;\n}\n.bg-ogling {\nbackground-color: #95c7e0 !important;\n}\n.bg-haze {\nbackground-color: #9aaec7 !important;\n}\n.bg-mountain-terrier {\nbackground-color: #99a5cd !important;\n}\n</style>\n \n<div class=\"github-badge-big\">\n<span class=\"badge-subject\"><i class=\"fa fa-id-card\"></i> 备案�?</span\n><span class=\"badge-value bg-orange\">\n<a href=\"https://beian.miit.gov.cn/\" target=\"_blank\" one-link-mark=\"yes\"\n>苏ICP�?000000000�?/a\n>\n|\n<a\nhref=\"http://www.beian.gov.cn/portal/registerSystemInfo?recordcode= 32072202010255\"\ntarget=\"_blank\"\none-link-mark=\"yes\"\n>苏公网安�?00000000000000�?/a\n></span\n>\n</div>\n\n \n<div class=\"github-badge\">\n<span class=\"badge-subject\"><img src=\"https://www.liveout.cn/wp-content/uploads/2022/10/又拍云_logo4.png\" height=\"20\" width=\"20\"/></i> CDN</span\n><span class=\"badge-value bg-shallots\"\n><a href=\"\" target=\"_blank\" one-link-mark=\"yes\"></a\n><a\nhref=\"https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral\"\ntarget=\"_blank\"\none-link-mark=\"yes\"\n>Upyun</a\n></span\n>\n<span class=\"badge-subject\"><i class=\"fa fa-wordpress\"></i> Powered</span\n><span class=\"badge-value bg-green\"\n><a href=\"https://cn.wordpress.org/\" target=\"_blank\" one-link-mark=\"yes\"\n>WordPress</a\n></span\n>\n</div>\n<div class=\"github-badge-big\">\n<span class=\"badge-subject\">Copyright </span\n><span class=\"badge-value bg-red\">\n2022-2022\n<i class=\"fa fa-copyright\"></i> Echo</span\n>\n</script>\n</div>\n<div class=\"github-badge-big\">\n<span class=\"badge-subject\"><i class=\"fa fa-clock-o\"></i> Running Time</span\n><span class=\"badge-value bg-apricots\"\n><span id=\"blog_running_days\" class=\"odometer odometer-auto-theme\"></span>\ndays\n<span id=\"blog_running_hours\" class=\"odometer odometer-auto-theme\"></span> H\n<span id=\"blog_running_mins\" class=\"odometer odometer-auto-theme\"></span> M\n<span id=\"blog_running_secs\" class=\"odometer odometer-auto-theme\"></span>\nS</span\n>\n <script no-pjax=\"\">\nvar blog_running_days = document.getElementById(\"blog_running_days\");\nvar blog_running_hours = document.getElementById(\"blog_running_hours\");\nvar blog_running_mins = document.getElementById(\"blog_running_mins\");\nvar blog_running_secs = document.getElementById(\"blog_running_secs\");\nfunction refresh_blog_running_time() {\nvar time = new Date() - new Date(2020, 0,0, 0, 0, 0);\nvar d = parseInt(time / 24 / 60 / 60 / 1000);\nvar h = parseInt((time % (24 * 60 * 60 * 1000)) / 60 / 60 / 1000);\nvar m = parseInt((time % (60 * 60 * 1000)) / 60 / 1000);\nvar s = parseInt((time % (60 * 1000)) / 1000);\nblog_running_days.innerHTML = d;\nblog_running_hours.innerHTML = h;\nblog_running_mins.innerHTML = m;\nblog_running_secs.innerHTML = s;\n}\nrefresh_blog_running_time();\nif (typeof bottomTimeIntervalHasSet == \"undefined\") {\nvar bottomTimeIntervalHasSet = true;\nsetInterval(function () {\nrefresh_blog_running_time();\n}, 500);\n}\n</script>\n","argon_enable_code_highlight":"true","argon_code_theme":"vs2015","argon_code_highlight_hide_linenumber":"true","argon_code_highlight_break_line":"false","argon_code_highlight_transparent_linenumber":"false","argon_math_render":"none","argon_mathjax_cdn_url":"//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js","argon_mathjax_v2_cdn_url":"//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML","argon_katex_cdn_url":"//cdn.jsdelivr.net/npm/katex@0.11.1/dist/","argon_enable_lazyload":"true","argon_lazyload_threshold":"800","argon_lazyload_effect":"fadeIn","argon_lazyload_loading_style":"1","argon_enable_fancybox":"true","argon_enable_zoomify":"false","argon_zoomify_duration":"200","argon_zoomify_easing":"cubic-bezier(0.4,0,0,1)","argon_zoomify_scale":"0.9","argon_enable_pangu":"article","argon_custom_html_head":"","argon_custom_html_foot":"<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css\">\n<script src=\"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js\"></script>\n \n<meting-js \n server=\"netease\" \n type=\"playlist\" \n id=\"7373135320\"\n fixed=\"true\" \n mini=\"true\"\n order=\"list\"\n loop=\"all\"\n preload=\"auto\"\n list-folded=\"true\"\n lrc-type=\"0\"\n>\n</meting-js>\n\n\n","argon_enable_smoothscroll_type":"1_pulse","argon_enable_into_article_animation":"true","argon_disable_pjax_animation":"false","argon_comment_pagination_type":"page","argon_comment_emotion_keyboard":"true","argon_hide_name_email_site_input":"false","argon_comment_need_captcha":"false","argon_get_captcha_by_ajax":"false","argon_comment_allow_markdown":"true","argon_comment_allow_editing":"true","argon_comment_allow_privatemode":"true","argon_comment_allow_mailnotice":"true","argon_comment_mailnotice_checkbox_checked":true,"argon_comment_enable_qq_avatar":"true","argon_comment_avatar_vcenter":"false","argon_who_can_visit_comment_edit_history":"commentsender","argon_enable_comment_pinning":"true","argon_enable_comment_upvote":"true","argon_comment_ua":"platform,browser","argon_show_comment_parent_info":"true","argon_fold_long_comments":"true","argon_gravatar_cdn":"gravatar.pho.ink/avatar/","argon_text_gravatar":"true","argon_enable_search_filters":"true","argon_search_filters_type":"*post,*page,shuoshuo","argon_pjax_disabled":"false","argon_hide_categories":"","argon_enable_login_css":"true","argon_home_show_shuoshuo":"false","argon_fold_long_shuoshuo":"true","argon_enable_timezone_fix":"false","argon_hide_shortcode_in_preview":"true","argon_trim_words_count":"0","argon_enable_mobile_scale":"false","argon_disable_googlefont":"false","argon_disable_codeblock_style":"false","argon_update_source":"github","argon_hide_footer_author":"true"}
📊 年度倒计时显�?(左侧�?
🎨 效果预览:在侧边栏显示一个动态的年度进度条,实时更新当前年份剩余天数
📋 一键复制代�?
<!-- 🎯 年度倒计时组�?- 直接复制到侧边栏HTML小工�?-->
<style>
#yearProgress {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 15px;
padding: 20px;
margin: 20px 0;
color: white;
text-align: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
transition: transform 0.3s ease;
}
#yearProgress:hover {
transform: translateY(-3px);
box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}
#yearProgress h3 {
margin: 0 0 15px 0;
font-size: 18px;
font-weight: 600;
}
.progress-bar {
background: rgba(255,255,255,0.2);
border-radius: 10px;
height: 12px;
margin: 15px 0;
overflow: hidden;
position: relative;
}
.progress-fill {
background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
height: 100%;
border-radius: 10px;
transition: width 0.8s ease;
position: relative;
}
.progress-fill::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
animation: shimmer 2s infinite;
}
@keyframes shimmer {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
.progress-text {
font-size: 14px;
margin: 8px 0;
opacity: 0.9;
font-weight: 500;
}
</style>
<div id="yearProgress">
<h3>🎯 <span id="currentYear">2024</span>年度进度</h3>
<div class="progress-bar">
<div class="progress-fill" id="progressFill"></div>
</div>
<div class="progress-text" id="progressText">📈 正在计算...</div>
<div class="progress-text" id="daysLeft">�?正在统计...</div>
</div>
<script>
function updateYearProgress() {
const now = new Date();
const currentYear = now.getFullYear();
const start = new Date(currentYear, 0, 1);
const end = new Date(currentYear + 1, 0, 1);
const total = end - start;
const current = now - start;
const percentage = (current / total * 100).toFixed(2);
const daysLeft = Math.ceil((end - now) / (1000 * 60 * 60 * 24));
// 更新年份显示
document.getElementById('currentYear').textContent = currentYear;
document.getElementById('progressFill').style.width = percentage + '%';
document.getElementById('progressText').innerHTML = `📈 已完�?<strong>${percentage}%</strong>`;
document.getElementById('daysLeft').innerHTML = `�?还剩 <strong>${daysLeft}</strong> 天`;
}
// 页面加载完成后执�?
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', updateYearProgress);
} else {
updateYearProgress();
}
// 每分钟更新一�?
setInterval(updateYearProgress, 60000);
</script>
🔧 使用说明
步骤 | 操作说明 | 注意事项 |
---|---|---|
1️⃣ | 进入WordPress后台 �?外观 �?小工�? | 确保主题支持自定义HTML |
2️⃣ | 添加「自定义HTML」小工具到侧边栏 | 放置在合适位置 |
3️⃣ | 复制上方完整代码粘贴保存 | 无需修改任何内容 |
*💡 小贴�?:代码会自动识别当前年份,无需手动修改年份数字
🎵 底部音乐播放�?
🎼 功能特色:网易云音乐歌单无缝集成,支持歌词显示、播放列表、自动播放控�?
📋 一键配置代�?
<!-- 🎵 APlayer音乐播放�?- 页脚脚本 -->
<!-- 🚀 引入APlayer核心样式和脚�?-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
<!-- 🎼 引入MetingJS音乐解析�?-->
<script src="https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js"></script>
<!-- 🎯 音乐播放器配�?-->
<meting-js
id="8658099444"
server="netease"
type="playlist"
fixed="true"
autoplay="false"
loop="all"
order="list"
preload="auto"
list-folded="true"
list-max-height="340px"
lrc-type="1">
</meting-js>
🔧 配置参数详解
参数 | 说明 | 可选�? | 推荐设置 |
---|---|---|---|
id | 歌单ID | 网易云歌单ID | 8658099444 |
server | 音乐平台 | netease , tencent , kugou | netease |
type | 资源类型 | playlist , album , song | playlist |
fixed | 固定位置 | true , false | true |
autoplay | 自动播放 | true , false | false |
loop | 循环模式 | all , one , none | all |
🎼 自定义歌单教�?
*如何更换为自己的歌单�?
获取网易云歌单ID
- 打开网易云音乐网页版
- 进入你的歌单页面
- 复制URL中的数字ID
- 例如:
https://music.163.com/#/playlist?id=123456789
修改配置代码
<!-- 将id参数改为你的歌单ID --> <meting-js id="123456789" <!-- 这里改成你的歌单ID --> server="netease" type="playlist" ...其他参数保持不变... </meting-js>
高级定制选项
- 自动播放:将
autoplay="false"
改为true
- 随机播放:将
order="list"
改为random
- 主题颜色:通过CSS自定义播放器颜色
- 自动播放:将
🚀 安装步骤
步骤 | 操作路径 | 注意事项 |
---|---|---|
1️⃣ | WordPress后台 �?外观 �?Argon主题选项 | 确保已启用Argon主题 |
2️⃣ | 进入「脚本」→「页尾脚本�? | 找到页脚代码编辑区域 |
3️⃣ | 复制上方完整代码粘贴保存 | 建议放在页脚最底部 |
⚠️ 注意事项
- 部分浏览器可能阻止自动播放,建议设置
autoplay="false"
- 歌单需要设置为公开才能正常加载
- 如遇加载失败,请检查CDN网络连接
📥 资源下载
🎯 下载地址
资源类型 | 下载地址 | 版本说明 | |
---|---|---|---|
主题源码 | GitHub Releases | 最新稳定版 | |
美化源码 | v1.3.5美化包 | 配套美化资源 | 2024年 |
*主题�? | 123云盘 | 完整主题�? |
⚠️ 注意事项
🚨 常见问题FAQ
Q:配置后没有生效怎么办?
检查缓存
- 清除WordPress缓存插件
- 浏览器强制刷新:
Ctrl+F5
检查主题版本
- 确保Argon主题更新到最新版
- 部分功能需要特定版本支持
排查冲突
- 暂时禁用其他插件测试
- 检查浏览器控制台错误信息
Q:音乐播放器不显示怎么办?
检查网络
- 确保能正常访问CDN
- 尝试切换其他CDN源
检查歌单
- 确认歌单ID正确
- 确保歌单为公开状态
浏览器兼容性
- 建议使用Chrome或Edge浏览器
- 检查浏览器控制台错误信息
🚀 ### 🚀 进阶美化方案(新增内容)
🌈 动态渐变背景
🌟 效果预览:页面背景随时间自动变换渐变
/* 🌈 动态渐变背景 - 添加到主题自定义CSS */
body {
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
background-size: 400% 400%;
animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
/* 🌙 暗黑模式适配 */
body.darkmode {
background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #533483);
background-size: 400% 400%;
animation: gradientBG 15s ease infinite;
}
🎭 3D卡片悬浮效果
🎯 效果预览:文章卡片悬停时3D翻转效果💡 点击展开完整代码
/* 🎭 3D卡片效果 - 文章列表 */
.post-card {
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transform-style: preserve-3d;
perspective: 1000px;
}
.post-card:hover {
transform: translateY(-10px) rotateX(5deg);
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
/* �?卡片内容增强 */
.post-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 100%);
opacity: 0;
transition: opacity 0.3s ease;
}
.post-card:hover::before {
opacity: 1;
}
🎪 导航栏透明效果
🌟 效果预览:滚动时导航栏透明度渐�?
💡 透明导航栏代码
// 🎪 透明导航栏 - 添加到页眉脚件
window.addEventListener('scroll', function() {
const navbar = document.querySelector('.navbar-main');
const scrolled = window.scrollY;
if (scrolled > 50) {
navbar.style.background = 'rgba(255, 255, 255, 0.95)';
navbar.style.backdropFilter = 'blur(10px)';
} else {
navbar.style.background = 'rgba(255, 255, 255, 0.1)';
navbar.style.backdropFilter = 'blur(0px)';
}
});
📱 移动端优�?
📊 响应式布局增强
💡 移动端优化代码
/* 📱 移动端优化 - 媒体查询 */
@media screen and (max-width: 768px) {
/* 📏 调整卡片间距 */
.post-card {
margin: 10px 0;
border-radius: 10px;
}
/* 🔤 字体大小优化 */
.post-title {
font-size: 1.2rem;
line-height: 1.4;
}
/* 🎯 按钮尺寸调整 */
.btn-mobile {
padding: 8px 16px;
font-size: 14px;
}
}
/* 📱 暗黑模式移动端适配 */
@media screen and (max-width: 768px) and (prefers-color-scheme: dark) {
body {
background: #1a1a1a;
}
}
🎨 高级美化组件
🌟 打字机效果标�?
💡 打字机效果代码
// 🌟 打字机效果 - 添加到页眉脚件
class TypeWriter {
constructor(element, text, speed = 100) {
this.element = element;
this.text = text;
this.speed = speed;
this.index = 0;
}
type() {
if (this.index < this.text.length) {
this.element.innerHTML += this.text.charAt(this.index);
this.index++;
setTimeout(() => this.type(), this.speed);
}
}
}
// 🎯 应用打字机效果
window.addEventListener('DOMContentLoaded', function() {
const title = document.querySelector('.banner-title');
if (title) {
const originalText = title.textContent;
title.textContent = '';
const typewriter = new TypeWriter(title, originalText, 150);
typewriter.type();
}
});
🎪 粒子背景效果
💡 粒子背景代码
// 🎪 粒子背景 - 添加到页眉脚件
particlesJS('particles-js', {
particles: {
number: { value: 80, density: { enable: true, value_area: 800 } },
color: { value: '#5e72e4' },
shape: { type: 'circle' },
opacity: { value: 0.5, random: false },
size: { value: 3, random: true },
line_linked: {
enable: true,
distance: 150,
color: '#5e72e4',
opacity: 0.4,
width: 1
},
move: {
enable: true,
speed: 6,
direction: 'none',
random: false,
straight: false,
out_mode: 'out',
bounce: false
}
},
interactivity: {
detect_on: 'canvas',
events: {
onhover: { enable: true, mode: 'repulse' },
onclick: { enable: true, mode: 'push' },
resize: true
}
},
retina_detect: true
});
📊 实用工具集成
🌤️ 天气小组件
💡 天气小组件代码
<!-- 🌤️天气小组件 - 添加到侧边栏 -->
<div id="weather-widget" class="weather-card">
<div class="weather-info">
<div class="weather-icon" id="weather-icon">☀️</div>
<div class="weather-temp" id="weather-temp">--°C</div>
<div class="weather-city" id="weather-city">加载中..</div>
</div>
</div>
<style>
.weather-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 15px;
padding: 20px;
color: white;
text-align: center;
margin: 20px 0;
}
.weather-icon {
font-size: 48px;
margin-bottom: 10px;
}
.weather-temp {
font-size: 24px;
font-weight: bold;
margin-bottom: 5px;
}
.weather-city {
font-size: 14px;
opacity: 0.8;
}
</style>
<script>
// 🌤️天气API集成
fetch('https://api.openweathermap.org/data/2.5/weather?q=Beijing&appid=YOUR_API_KEY&units=metric')
.then(response => response.json())
.then(data => {
document.getElementById('weather-temp').textContent = Math.round(data.main.temp) + '°C';
document.getElementById('weather-city').textContent = data.name;
// 根据天气代码设置图标
const weatherCode = data.weather[0].id;
const weatherIcons = {
800: '☀️', 801: '🌤️', 802: '⛅', 803: '☁️', 804: '☁️',
300: '🌦️', 500: '🌧️', 600: '❄️', 701: '🌫️'
};
document.getElementById('weather-icon').textContent = weatherIcons[weatherCode] || '🌤️';
})
.catch(error => console.log('天气加载失败'));
</script>
🎵 音乐可视�?
💡 音乐可视化代码
// 🎵 音乐可视化 - 添加到页脚脚本
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
const analyser = audioContext.createAnalyser();
// 创建可视化容器
const visualizer = document.createElement('div');
visualizer.id = 'audio-visualizer';
visualizer.style.cssText = `
position: fixed;
bottom: 20px;
right: 20px;
width: 200px;
height: 50px;
z-index: 9999;
display: flex;
align-items: end;
gap: 2px;
`;
document.body.appendChild(visualizer);
// 创建频谱条
for (let i = 0; i < 20; i++) {
const bar = document.createElement('div');
bar.style.cssText = `
width: 8px;
background: linear-gradient(to top, #667eea, #764ba2);
border-radius: 4px;
transition: height 0.1s ease;
`;
visualizer.appendChild(bar);
}
// 更新频谱
function updateVisualizer() {
const dataArray = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(dataArray);
const bars = visualizer.querySelectorAll('div');
bars.forEach((bar, index) => {
const value = dataArray[index];
const height = (value / 255) * 50;
bar.style.height = height + 'px';
});
requestAnimationFrame(updateVisualizer);
}
updateVisualizer();
📚 完整配置清单
🎨 颜色方案对照�?
主题风格 | 主色�? | 背景�? | 文字�? | 适用场景 |
---|---|---|---|---|
清新蓝 | #5e72e4 | #f8f9fe | #2d3748 | 技术博客 |
少女粉 | #ff6b9d | #fff5f7 | #4a5568 | 生活博客 |
商务灰 | #4a5568 | #f7fafc | #1a202c | 企业官网 |
暗夜黑 | #2d3748 | #1a202c | #e2e8f0 | 极客博客 |
森林绿 | #48bb78 | #f0fff4 | #1a202c | 环保主题 |
🔧 一键配置JSON(增强版)
💡 完整配置清单
{
"argon_theme_color": "#5e72e4",
"argon_enable_immersion_color": "true",
"argon_darkmode_autoswitch": "time",
"argon_card_radius": "15",
"argon_card_shadow": "default",
"argon_page_layout": "double",
"argon_article_list_waterflow": "2",
"argon_font": "serif",
"argon_banner_size": "fullscreen",
"argon_banner_background_url": "--bing--",
"argon_page_background_url": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=1920",
"argon_page_background_dark_url": "https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920",
"argon_sidebar_auther_image": "https://via.placeholder.com/150",
"argon_code_theme": "vs2015",
"argon_enable_code_highlight": "true",
"argon_enable_lazyload": "true",
"argon_enable_fancybox": "true",
"argon_enable_smoothscroll_type": "1_pulse",
"argon_enable_into_article_animation": "true",
"argon_custom_html_head": "",
"argon_custom_html_foot": ""
}
📝 使用建议
🎯 完成效果预览
经过以上配置,你的Argon主题将拥有:
- 🌈 现代化UI:渐变背景、悬浮效果
- 📊 实用工具:年度倒计时、音乐播放
- 📱 响应式:完美适配手机和平板
- 🎨 个性化:支持自定义颜色主题
📚 延伸阅读
🙏 再次感谢原作者Echo小窝 的分享!
本文档持续更新,建议收藏以便获取最新美化方案
博客系统😎