Giter Site home page Giter Site logo

turkyden / vue-typical Goto Github PK

View Code? Open in Web Editor NEW
174.0 1.0 15.0 3.92 MB

๐Ÿก Vue Animated typing in ~400 bytes of JavaScript

Home Page: https://vue-typical.vercel.app/

License: MIT License

Vue 17.89% TypeScript 46.86% JavaScript 35.25%
typing animated typical components vue vuejs

vue-typical's Introduction

English | ็ฎ€ไฝ“ไธญๆ–‡

Vue Typical

Vue Animated typing in ~400 bytes ๐Ÿก of JavaScript. Preview โ†’

npm npm license vitepress jsdelivr

Live Demo โœจ https://vue-typical.vercel.app

๐Ÿ“ฆ Installation

Install with yarn

yarn add vue-typical

Or you can

npm install vue-typical

Or inject the script at your page by jsdelivr CDN

<script src="https://cdn.jsdelivr.net/npm/vue-typical@latest/dist/vue-typical.umd.js"></script>

๐Ÿ’ก This library Just support Vue 3 now

If you are Vue 2, please see the branch v1 and install [email protected]

๐Ÿš€ Usage

1. Component

You can import it as a custom component.

<template>
  <v-typical
    class="blink"
    :steps="['Hello', 1000, 'Hello World !', 500, 'Hello World ! ๐Ÿ‘‹', 1000]"
    :loop="Infinity"
    :wrapper="'h2'"
  ></v-typical>
</template>

<script lang="ts">
import VTypical from 'vue-typical';

export default {
  components: {
    VTypical,
  },
};
</script>

2. Plugin API

If you want to configure default options, you can register this plugin through the use API of Vue.js.

// main.js or index.js
import VTypical from 'vue-typical';

Vue.use(VTypical, {
  /* options */
});

If you use the plugin API, the VTypical component will be registered as a global component just like when including it with the script tag, but you won't need to re-register it through the components property in your own components.

3. Composition API

You can also create typical animation by the composition API useTypical.

const ref = useTypical(options);

Coming Soon ...

๐Ÿ“‘ Properties

Prop Required Type Eg.
steps True Array<String | Number | Function> ['Hello', 1000, () => alert('Word')]
loop False Number 1 or 'Infinity'
wrapper False String 'div'

โœจ Style

Add the blink cursor effect with blink classname.

.blink::after {
  content: '|';
  animation: blink 1s infinite step-start;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

๐Ÿ”ข Coming Soon

  • The demo of composition API in Vue 3.0
  • Supported Vue 2 & 3

๐Ÿ”จ Contribute

Install dependencies,

$ npm i

Start the dev server,

$ npm start

Build documentation,

$ npm run docs:build

Build library via father-build,

$ npm run build

โค๏ธ Contributors

Thanks goes to these people:

Contributors

Please Feel free to enjoy and participate in open source!

โญ Stargazers

Thanks for your star!

Stargazers repo roster for @Turkyden/vue-typical

๐Ÿ”– License

This library is based on @camwiegert/typical work and it currently is just a wrapper for vue.

Inspired by @catalinmiron/react-typical.

MIT ยฉ Turkyden

vue-typical's People

Contributors

dependabot[bot] avatar knowscount avatar lizhi334 avatar turkyden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue-typical's Issues

4 warnings in demo project

Hello, I am trying to test your package (vue2) but getting error with a sample from your readme file ...

WARNING Compiled with 4 warnings 9:07:59 AM

warning in ./node_modules/vue-typical/dist/vue-typical.es.js

"export 'defineComponent' (imported as 't') was not found in 'vue'

warning in ./node_modules/vue-typical/dist/vue-typical.es.js

"export 'h' (imported as 'e') was not found in 'vue'

warning in ./node_modules/vue-typical/dist/vue-typical.es.js

"export 'onMounted' (imported as 'o') was not found in 'vue'

warning in ./node_modules/vue-typical/dist/vue-typical.es.js

"export 'ref' (imported as 'n') was not found in 'vue'

pen link down

To put it as simply as possible: I cannot visit your pen.

event

Hi!

Is it possible to emit an event once the animation is done?

Thank you!

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.