{"id":16525916,"url":"https://github.com/thetarnav/vue-glitched-writer","last_synced_at":"2025-03-21T09:30:51.304Z","repository":{"id":40644098,"uuid":"354328866","full_name":"thetarnav/vue-glitched-writer","owner":"thetarnav","description":"Glitched Writer Component for Vue 3.","archived":false,"fork":false,"pushed_at":"2022-04-30T20:11:28.000Z","size":2595,"stargazers_count":19,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T23:41:27.361Z","etag":null,"topics":["animation","glitch","html","text","vue","vue-component","web","writer"],"latest_commit_sha":null,"homepage":"https://glitched-writer.site","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thetarnav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-03T15:39:03.000Z","updated_at":"2025-03-02T01:57:28.000Z","dependencies_parsed_at":"2022-08-09T23:50:51.721Z","dependency_job_id":null,"html_url":"https://github.com/thetarnav/vue-glitched-writer","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thetarnav%2Fvue-glitched-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thetarnav%2Fvue-glitched-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thetarnav%2Fvue-glitched-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thetarnav%2Fvue-glitched-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thetarnav","download_url":"https://codeload.github.com/thetarnav/vue-glitched-writer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244771402,"owners_count":20507797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","glitch","html","text","vue","vue-component","web","writer"],"created_at":"2024-10-11T17:07:56.989Z","updated_at":"2025-03-21T09:30:51.031Z","avatar_url":"https://github.com/thetarnav.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Glitched Writer Vue Component\n\n[![npm](https://img.shields.io/npm/v/vue-glitched-writer)](https://www.npmjs.com/package/vue-glitched-writer) [![npm type definitions](https://img.shields.io/npm/types/vue-glitched-writer)](https://www.npmjs.com/package/vue-glitched-writer) [![NPM](https://img.shields.io/npm/l/vue-glitched-writer)](https://www.npmjs.com/package/vue-glitched-writer)\n\n[![glitched-writer-preview](https://user-images.githubusercontent.com/24491503/67164275-06ab6900-f379-11e9-81ac-cab76dbc8dcd.gif)](https://glitched-writer.site)\n\n### What is [Glitched Writer](https://glitched-writer.site):\n\n\u003e **A lightweight npm module for writing text to HTML elements. Highly customizable settings. Decoding, decrypting, scrambling, and simply spelling out text.**\n\n### Vue component\n\n\u003e This is a **Vue.js Single File Component**, serving as a wrapper for [**Glitched Writer**](https://www.npmjs.com/package/glitched-writer) to simplify it's usage in Vue.\n\n---\n\n### \u003e\u003e\u003e [PLAYGROUND](https://glitched-writer.site) \u003c\u003c\u003c | \u003e\u003e\u003e [EXAMPLES](https://codepen.io/collection/XWVEEa) \u003c\u003c\u003c | \u003e\u003e\u003e [VUE DEMO](https://codepen.io/thetarnav/pen/ExWgYer) \u003c\u003c\u003c | \u003e\u003e\u003e [JS Module](https://www.npmjs.com/package/glitched-writer) \u003c\u003c\u003c\n\n---\n\n## Installation\n\nDownload and install with npm. For **Vue 3**:\n\n```bash\nnpm i vue-glitched-writer\n```\n\n**Vue 2**:\n```bash\nnpm i vue-glitched-writer@1.0.8\n```\n\nImport inside the script tag.\n\n```js\nimport GlitchedWriter from 'vue-glitched-writer'\n```\n\nOr use [Skypack](https://www.skypack.dev/view/vue-glitched-writer) to import without installing the package.\n\n```js\nimport GlitchedWriter from 'https://cdn.skypack.dev/vue-glitched-writer'\n```\n\n## Usage:\n\n### Declare component\n\n```html\n\u003cscript\u003e\nexport default { \n   components: {\n      GlitchedWriter, \n   },\n}\n\u003c/script\u003e\n```\n\n### Animate text instantly after load\n\nWill animate blank -\u003e passed text property\n\n```html\n\u003cglitched-writer text=\"Your Content\" appear /\u003e\n```\n\n### Write text dynamically\n\nAnimate each time the txt prop changes.\n_Previous text -\u003e new text_\n\n```html\n\u003cglitched-writer :text=\"text\" /\u003e\n```\n\n### Queue Writing\n\nIf you want to write texts for prepared array, then you can pass that array to as `text` and glitched writer will turn it into a working queue.\n\n```js\ndata() {\n   return {\n      phrases: [\n         'Hello and Welcome', \n         'What is this?!',\n         'It appears i\\'m in some queue...',\n      ]\n   }\n}\n```\n\n```html\n\u003cglitched-writer :text=\"phrases\" /\u003e\n\n\u003c!-- add prop \"queue\" to controll the queue --\u003e\n\u003cglitched-writer \n      :text=\"phrases\"\n      :queue=\"{\n      interval: 1200, // [ms]\n      loop: true\n      // false -\u003e stop (default)\n      // true -\u003e continue looping\n      // Function -\u003e stop and fire the function.\n      // Number -\u003e wait number ms and continue looping\n   }\"\n/\u003e\n```\n\n### Using Presets\n\n[List of available presets](https://github.com/thetarnav/glitched-writer#presets).\n\n```html\n\u003cglitched-writer text=\"Your Text\" preset=\"zalgo\" /\u003e\n\n\u003c!-- Passing options prop will extend the preset --\u003e\n\u003cglitched-writer text=\"Your Text\" preset=\"zalgo\" :options=\"{ html: true }\" /\u003e\n```\n\n### Custom Options\n\nSee [Glitched Writer's Option List](https://github.com/thetarnav/glitched-writer#customizing-behavior).\n\n#### **Passing options object to component.**\n\n```js\n{\n   data() {\n      return {\n         text: 'Your Text',\n         options: {\n            html: true,\n            letterize: true,\n            steps: [0, 10],\n            delay: [500, 2000],\n            glyphs: 'QWERTYUIOPASDFGHJKLZXCVBNM!@#$%^\u0026*()1234567890'\n         },\n      }\n   },\n}\n```\n\n```html\n\u003cglitched-writer :text=\"text\" :options=\"options\" /\u003e\n```\n\n#### **Changing options later**\n\nWhen changing options object (passed to the component), you need to remember to reassign the object property, instead of modifying it.\n\n```js\n{\n   methods: {\n      changeOptions(){\n         // RIGHT\n         this.options = {\n            steps: [2, 15],\n            html: false,\n            ...this.options\n         }\n\n         // WRONG: this.options.steps = [2, 15]\n      }\n   }\n}\n```\n\n### Pausing the animation\n\nThe \"pause\" boolean property is responsible for programatic pausing.\nSimply set \"pause\" property to true if you want the animation to stop.\n\n```js\ndata() {\n   return {\n      pause: true\n   }\n}\n```\n\n```html\n\u003cglitched-writer :text=\"text\" :pause=\"pause\" /\u003e\n```\n\n### Component Events\n\nGlitched Writer emits 3 events:\n\n-  **start** - when writer starts writing\n-  **step** - on every step of writing process\n-  **finish** - when writer finishes writing\n\n```html\n\u003cglitched-writer @start=\"method\" @step=\"callback\" @finish=\"callback\" /\u003e\n```\n\n```ts\n{\n   methods: {\n      callback(text, data){\n         console.log(text, data.options)\n      }\n   }\n}\n\n// WriterDataResponse: {\n// \tstring: string\n// \twriter: GlitchedWriter\n// \toptions: Options\n// \tstate: State\n// \tstatus?: 'ERROR' | 'SUCCESS'\n// \tmessage?: string\n// \terror?: any\n// }\n```\n\n### Accessing GlitchedWriter Instance\n\nIf you want to do something custom with the component, you can use GlitchedWriter class instance attached to the html element.\n\n```html\n\u003cglitched-writer :text=\"text\" ref=\"el\" /\u003e\n```\n\n```js\nmounted(){\n   console.log(this.$refs.el.$writer)\n}\n```\n\n## More Information\n\n\u003e If you are curious about further customization of animation effect and behavior, then please visit the original [Glitched Writer Readme](https://github.com/thetarnav/glitched-writer#table-of-contents). There you'll find description of every option and some use cases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthetarnav%2Fvue-glitched-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthetarnav%2Fvue-glitched-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthetarnav%2Fvue-glitched-writer/lists"}