DarkMode.js / 为网站一键添加深色模式

最后更新于 2023-03-05 972 次阅读


将以下代码放入footer部分即可~

        <!-- DarkMode by Dos7t3r | blog.iambzy.com -->
        <style>.darkmode-layer, .darkmode-toggle {
        z-index: 500;
        }</style>
        <script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.3.4/lib/darkmode-js.min.js"></script>
        <script>
          new Darkmode({ label: '&#x1f313;' }).showWidget();
        </script>

该脚本官网https://darkmodejs.learn.uno/

参考:https://www.wanghao.me/darkmode-js-wangzhanzhichixuankuanheimoshi-yejianmoshi.html

最后更新于 2023-03-05