44
55<script >
66export default {
7- mounted () {
8- const keyPage = this .$themeConfig .keyPage
9- let color = ' #424242'
10- let lineColor = ' #424242'
11- if (keyPage) {
12- color = keyPage .color || color
13- lineColor = keyPage .lineColor || lineColor
14- }
15-
16- const script = document .createElement (" script" );
17- script .src = " https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js" ;
7+ mounted () {
8+ const color = ' #fff'
9+ const lineColor = ' #fff'
10+ const num = 20
11+
12+ const script = document .createElement (' script' )
13+ script .src = ' https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js'
1814
19- document .body .append (script);
20- script .onload = function () {
21- particlesJS (" particles-oli-wrapper" , {
15+ document .body .append (script)
16+ script .onload = function () {
17+ const particlesJS = window .particlesJS
18+ particlesJS (' particles-oli-wrapper' , {
2219 particles: {
2320 number: {
24- value: 40 ,
21+ value: num ,
2522 density: {
2623 enable: true ,
2724 value_area: 800
@@ -31,27 +28,27 @@ export default {
3128 value: color
3229 },
3330 shape: {
34- type: " circle" ,
31+ type: ' circle' ,
3532 stroke: {
3633 width: 0 ,
37- color: " #000000"
34+ color: ' #000000'
3835 },
3936 polygon: {
4037 nb_sides: 5
4138 }
4239 },
4340 opacity: {
44- value: 0.3 ,
41+ value: 0.9 ,
4542 random: false ,
4643 anim: {
4744 enable: false ,
4845 speed: 1 ,
49- opacity_min: 0.1 ,
46+ opacity_min: 0.6 ,
5047 sync: false
5148 }
5249 },
5350 size: {
54- value: 20 ,
51+ value: 3 ,
5552 random: true ,
5653 anim: {
5754 enable: false ,
@@ -64,16 +61,16 @@ export default {
6461 enable: true ,
6562 distance: 250 ,
6663 color: lineColor,
67- opacity: 0.2 ,
64+ opacity: 0.4 ,
6865 width: 1
6966 },
7067 move: {
7168 enable: true ,
7269 speed: 3 ,
73- direction: " none" ,
70+ direction: ' none' ,
7471 random: true ,
7572 straight: false ,
76- out_mode: " out" ,
73+ out_mode: ' out' ,
7774 bounce: true ,
7875 attract: {
7976 enable: false ,
@@ -83,15 +80,15 @@ export default {
8380 }
8481 },
8582 interactivity: {
86- detect_on: " canvas" ,
83+ detect_on: ' canvas' ,
8784 events: {
8885 onhover: {
8986 enable: true ,
90- mode: " grab"
87+ mode: ' grab'
9188 },
9289 onclick: {
9390 enable: true ,
94- mode: " push"
91+ mode: ' push'
9592 },
9693 resize: true
9794 },
@@ -105,13 +102,17 @@ export default {
105102 }
106103 },
107104 retina_detect: true
108- });
109- };
105+ })
106+ }
110107 }
111- };
108+ }
112109 </script >
113- <style lang="stylus" scoped>
110+ <style lang='scss' scoped>
114111#particles-oli-wrapper {
112+ position : absolute ;
113+ z-index : -1 ;
114+ top : 0 ;
115+ width : 100% ;
115116 height : 99vh ;
116117}
117118 </style >
0 commit comments