Hexo NexT主題內加入動態背景


主題內新添加內容

_layout.swig

找到themes\next\layout\_layout.swig文件,添加內容:
<body>里添加:

1
2
3
<div class="bg_content">
<canvas id="canvas"></canvas>
</div>

 

仍是該文件,在末尾添加:

1
<script type="text/javascript" src="/js/src/dynamic_bg.js"></script>

 

dynamic_bg.js

themes\next\source\js\src中新建文件dynamic_bg.js,代碼鏈接中可見:dynamic_bg.js

custom.styl

themes\next\source\css\_custom\custom.styl文件末尾添加內容:

1
2
3
4
5
6
7
.bg_content {
position: fixed;
top: 0;
z-index: -1;
width: 100%;
height: 100%;
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM