给博客添加天气

1.去和风天气创建一个插件,最后生成代码
2.在navbar.php中添加

<div id="he-plugin-simple"></div>
<script>
WIDGET = {
  "CONFIG": {
    "modules": "01234",
    "background": "5",
    "tmpColor": "000000",
    "tmpSize": "16",
    "cityColor": "000000",
    "citySize": "16",
    "aqiColor": "000000",
    "aqiSize": "16",
    "weatherIconSize": "24",
    "alertIconSize": "18",
    "padding": "10px 10px 10px 10px",
    "shadow": "0",
    "language": "auto",
    "fixed": "false",
    "vertical": "top",
    "horizontal": "left",
    "key": "dd350946eb62489888b88035a9fd39bb"
  }
}
</script>
<script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>
评论区
头像
萌ICP备20241104号 本站支持SSL安全访问

本站已运行:

欢迎光临本站!您是第位访问者