Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions src/vue-particles/vue-particles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
:hoverMode="hoverMode"
:clickEffect="clickEffect"
:clickMode="clickMode"
:moveDirection="moveDirection"
></div>
</template>
<script>
Expand Down Expand Up @@ -88,28 +89,33 @@
clickMode: {
type: String,
default: 'push'
},
moveDirection: {
type: String,
default: 'none'
}
},
mounted () {
// import particle.js only on client-side
require('particles.js')
this.$nextTick(() => {
this.initParticleJS(
this.color,
this.particleOpacity,
this.particlesNumber,
this.shapeType,
this.particleSize,
this.linesColor,
this.linesWidth,
this.lineLinked,
this.lineOpacity,
this.linesDistance,
this.moveSpeed,
this.hoverEffect,
this.hoverMode,
this.clickEffect,
this.clickMode
this.color,
this.particleOpacity,
this.particlesNumber,
this.shapeType,
this.particleSize,
this.linesColor,
this.linesWidth,
this.lineLinked,
this.lineOpacity,
this.linesDistance,
this.moveSpeed,
this.hoverEffect,
this.hoverMode,
this.clickEffect,
this.clickMode,
this.moveDirection
)
})
},
Expand All @@ -129,7 +135,8 @@
hoverEffect,
hoverMode,
clickEffect,
clickMode
clickMode,
moveDirection
) {
particlesJS(this.id, {
"particles": {
Expand Down Expand Up @@ -184,7 +191,7 @@
"move": {
"enable": true,
"speed": moveSpeed,
"direction": "none",
"direction": moveDirection,
"random": false,
"straight": false,
"out_mode": "out",
Expand Down