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

camera-poster

v1.3.7

Published

一个应用与 h5 活动页的拍照合成海报 Vue 组件, 使用简单、操作方便、兼容性好.

Downloads

5

Readme

camera-poster

一个应用与 h5 活动页的拍照合成海报 Vue 组件, 使用简单、操作方便、兼容性好.

Watch the demo

特点

  • 支持相机拍照, 兼容性好无图片旋转 bug.
  • 支持配置并, 增加删除装饰 icon.
  • 支持缩放、旋转、移动等手势操作图片.
  • 支持配置前景图、背景图.
  • 支持配置切换前景图, 适应于换皮肤等场景.

安装

npm install camera-poster

使用

import { CameraInput, CameraPoster } from "camera-poster";
...

  components: {
    CameraInput,
    CameraPoster
  },
<!-- 插入相机 -->
<CameraPoster
  class="poster"
  ref="cameraposter"
  :styleObject="styleObject"
  :frontImg="front1"
  :backImg="back"
  frontImgPos="CB"
  background="transparent"
/>

<!-- 插入按钮 -->
<div class="button">
  <CameraInput />
  上 传
</div>
const cameraposter = this.$refs.cameraposter

// 添加icon , 两种方式
/// 1. require
cameraposter.addIcon(require(`./assets/${id}.png`))
/// 2. import
import img from './assets/front2.png'
cameraposter.addIcon(require(img))

// 修改前景图
const img = this.index % 2 == 0 ? front1 : front2
cameraposter.changeFrontImg(img)

// 获取截图图片
const img = cameraposter.toImage(200)

// 获取截图dataurl
const dataUrl = cameraposter.toDataURL()

组件属性

  • styleObject - 组件样式, 可以包含宽高
  • width - 组件宽-同上宽, 非必填
  • height - 组件高-同上高, 非必填
  • quality - 保存图片品质, 非必填
  • photoWidth - 图片宽度设置, 非必填
  • background - 组件背景色, 透明为transparent, 非必填
  • frontImg - 前景图片 url, 非必填
  • frontImgPos - 前景图片位置, 默认为CC, 其他可填LTRTLBRB
  • backImg - 背景图片 url, 非必填
  • backImgPos - 背景图片位置, 默认为CC, 其他可填LTRTLBRB
  • backImgSize - 背景图片尺寸, 默认为cover
  • ratio - 显示比率, 默认为 2

License

https://opensource.org/licenses/MIT