Add dynamic background theme within Hexo NexT

Adding new content within topics

_layout.swig

Find the themes\next\layout\_layout.swigfile, add content:
in <body>adding years:

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

 

The file is still, added at the end:

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

 

dynamic_bg.js

In themes\next\source\js\srcthe new document dynamic_bg.js, the code links visible: dynamic_bg.js

custom.styl

In themes\next\source\css\_custom\custom.styladd content end of the file:

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

Guess you like

Origin www.cnblogs.com/php-linux/p/11304530.html