Giter VIP home page Giter VIP logo

vue-hacker-text's Introduction

vue-hacker-text

Vue Single File Component to animate text in different decoding styles.

example

Installation (NPM)

npm install --save vue-hacker-text

Basic Usage

<template> 
    <vue-hacker-text text="Hacker Text"/>
<template>

<script>
    import Vue from 'vue';
    import VueHackerText from 'vue-hacker-text';

    export default Vue.extend({
        components: {
            VueHackerText
        },
    });
</script>

where text is the string you wish to finish decoding to.

Props

Prop Type Values Default Description
text String - - Required
mode String hacker, type, stars hacker Choose decoding style
speed String slow, medium, fast medium The speed at which a character changes. slow = 50ms, medium = 25ms, fast = 5ms
probability Number 0.005 - 1.0 0.01 The probability of selecting the correct character.
typeCharacter String - | Flashing character used for Type decoder

Changing the probability can fine tune the speed of which the decoding finishes. Selecting fast speed with a high probability will result in an extremely fast decode. Selecting slow speed with a low probability will result in a very slow decode.

The character set used for decoding is 95 characters. So selecting a probability of less than 5% (0.005) does not make sense as it'll be more likely to choose the correct character randomly.

Events

Event Description
@decodeStart Event emitted before decoding starts
@decodeFinish Event emitted once decoding has completed

Examples

<vue-hacker-text text="Hacker Text" :probability="0.35" speed="slow"/>

<vue-hacker-text text="Hacker Text" mode="stars" speed="fast"/>

<vue-hacker-text text="Hacker Text" mode="type" typeCharacter="#" :probability="0.35" speed="slow"/>

<vue-hacker-text text="Hacker Text" @decodeStart="startFunction" @decodeFinish="finishFunction"/>

Styling

Wrap the component in a styled div. The component is a simple span so it will inherit any styling from its parent div.

<div class="hacker-text">
    <vue-hacker-text text="Hacker Text"/>
</div>

<style>
    .hacker-text {
        font-weight: 600;
        font-size: 2em;
        color: blue;
    }
</style>

License

The MIT License

vue-hacker-text's People

Contributors

simple-hacker avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.