GithubHelp home page GithubHelp logo

andybobro / vue3-pixelify Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

Vue 3 implementation of React-pixelify component

Home Page: https://www.npmjs.com/package/vue3-pixelify

HTML 7.70% Vue 75.82% TypeScript 16.48%

vue3-pixelify's Introduction

vue3-pixelify

Vue 3 implementation of react component by nikoferro pixelizes image using html5 canvas

Install:

npm install vue3-pixelify

# OR

yarn add vue3-pixelify

Usage:

<script setup lang="ts">
import { Vue3Pixelify } from 'vue3-pixelify';
</script>


<template>
  <div>
    vue3-pixelify
    <Vue3Pixelify :src="'https://cdn2.thecatapi.com/images/egs.jpg'" />
  </div>
</template>

Props:

Property Type Default Value Description Required
src String Source of the image Yes
pixelSize Int 4 Size of the pixel in the new pixelated image. if no value is set, the original image is displayed with no pixelated effect No
width Int image original width You can use this prop to override the original width No
height Int image original height You can use this prop to override the original height No
centered Bool false If true, the pixels grid will be centered vertically and horizontally. Example: You choose a pixelSize of 10, but your image width or height cant be divided by an exact grid of 10x10 pixels. Setting this prop as true will set an offset that keeps the grid centered No
fillTransparencyColor String white For images with transparency, you can set a value for the places where the image is transparent. Think of it as a background color for your pixelated image No

Recommended IDE Setup

Type Support For .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

vue3-pixelify's People

Contributors

andybobro 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.