0.1.3 • Published 4 years ago

vue-text-loading v0.1.3

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

vue-text-loading npm package

A text loading component for Vue.js. Uses SVG and javascript to animate a text loading with a gradient.

Live Demo

Requirements

  • Vue.js ^2.0.0 (Compatible with Vue 1.0 or 2.0)
  • A module bundler such as webpack or use the minified version on its own.

Installation

$ npm install --save vue-text-loading

Usage

<template>
  <text-loading
    :height="height"
    :width="width"
    :animate-time="animateTime"
    :start-color="startColor"
    :stop-color="stopColor"
    :inner-text-color="innerTextColor"
    :timing-func="timingFunc"
    :showText="showTxt"
    :text="text"
    :animateDirection="animateDirection"
  ></text-loading>
</template>

<script>
  import ProgressBar from "vue-text-loading";

  export default {
    data() {
      return {
        animateTime: 5,
        height: 300,
        width: 300,
        text: "github",
        animateDirection: "right",
        startColor: "#bbff42",
        stopColor: "#0413dc",
        innerTextColor: "#ccc",
        timingFunc: "linear",
        showTxt: false
      };
    },
    components: {
      ProgressBar
    },
    methods: {
      showLoading() {
        this.showTxt = true;
        const duration = (this.animateTime * 3 + 2) * 1000;
        setTimeout(() => {
          this.showTxt = false;
        }, duration);
      }
    }
  };
</script>

Props

NameDefault valueDescription
height100Height of the text loading in pixels.
width100Width of the text loading in pixels.
text""Text show in loading.
showTextfalseShow or hide the text loading.
startColor#73cbfeThe color of the leading edge of the text loading gradient.
stopColor#158efdThe secondary color of the text loading gradient.
innerStrokeColor#cccBackground color of the text loading.
animateDirectionrightThe direction of animate.
animateTime3The duration time(second) of animate.
timingFunclinearThe transition timing function to use for the CSS transition. See
transition-timing-function.

Slot

none

Dev

npm run dev

📒 ChangeLog

ChangeLog

License

The MIT License