npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@matb85/photoeditor

v2.1.0

Published

A fully functional Photo Editor made with Vuejs

Downloads

6

Readme

Photo Editor

A fully functional free online Photo Editor

A working example: https://matb85.github.io/PhotoEditor/

ScreenShot

What's that?

PhotoEditor is a Vue SPA utilizing Element Plus, canvas filters and Cropperjs. You can install the core components via npm and use it in your own project.

Usage - Spa

Go to https://matb85.github.io/PhotoEditor/, upload a photo and start tweaking the sliders! Currently, there are 3 basic editing options:

  • applying canvas filters (same as css filters: brightness,saturation, hue rotate, contrast, grayscale, sepia, invert)
  • applying instagram filters thanks to Instagram.css
  • cropping and rotating thanks to Cropperjs

Usage - Api

Download and import PhotoEditor

Of course you can download the editor via npm as an esm module. Please remember that PhotoEditor requires Vuex!

npm i @matb85/photoeditor
pnpm add @matb85/photoeditor
yarn add @matb85/photoeditor
  • in a no ssr environment (e.g. Vue spa):
<template>
  <div>
    <PhotoEditor />
  </div>
</template>

<script setup>
  import '@matb85/photoeditor/dist/photo-editor.css';
  import PhotoEditor from '@matb85/photoeditor';
</script>
  • in a ssr environment (e.g. Nuxt universal app):
<template>
  <div>
    <client-only placeholder="Loading...">
      <photoEditor />
    </client-only>
  </div>
</template>

<script>
  import '@matb85/photoeditor/dist/photo-editor.css'
  export default {
    name: 'your component',
    components:
      PhotoEditor: () => {
      return import('@matb85/photoeditor').PhotoEditor
        });
      },
    },
  };
</script>

specification

props

  • clearDataOnDestroy - if true, photoEditor's data in vuex and sessionStorage is cleared when the beforeDestroy hook is called
<photoEditor clearDataOnDestroy />

events

you can emit to your photoEditor using this.$root.$emit("photoEditor/event", arguments)

  • alterphoto - tells the photoEditor to update the photo (apply css filters)
window.dispatchEvent(new CustomEvent('photoEditor/alterphoto')); // no arguments
  • cropperchange - calls a cropperjs method (works only when cropperjs is available)
new CustomEvent('photoEditor/cropperchange', detail('cropperjsmethod', [array with arguments]));
new CustomEvent('photoEditor/cropperchange', detail('rotateTo', [20])); //rotates the image to 20 degrees

Vuex - actions

  • updatesettings - changes value of one css filter, in order to see the result call the alterphoto event
this.$store.dispatch('photoEditor/updatesettings', { func: cssfiltername, val: value });

Vuex - mutations

  • resetStore - reset the vuex module to its initial state and clear sessionStorage
store.commit('photoEditor/resetStore');

Cotributing

Certainly, contributions are welcome. So if you'd like to addfunctionality or simply make it better, go ahead, PRs welcome !:fire::fire::fire:

Project setup

pnpm install

Compiles and hot-reloads for development

pnpm run dev

Compiles the example app for production

pnpm run build

Compiles and minifies the library for production

pnpm run build:lib

Lints and fixes files

pnpm run lint