Coder Social home page Coder Social logo

onatcer / vue-picture-sharesheet Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 3.0 117 KB

A Vue Picture Sharesheet Component heavily inspired by the Image Sharesheet in Apple's Newsroom

Home Page: https://onatcer.github.io/vue-picture-sharesheet/

License: MIT License

JavaScript 16.94% Vue 83.06%

vue-picture-sharesheet's Introduction

Vue Picture Sharesheet Compoenent

image

vue-picture-sharesheet provides an easy and beautiful sharesheet when hovering over images. Currently supported main features are:

  • sharing to Twitter/Facebook
  • copying the current URL to the Clipboard
  • Downloading the Image

Demo ๐Ÿ˜ป

with cute cats ๐Ÿ˜ป (The Download in the Demo will just download random cat images as the image changes with every request)

Getting Started

(Vue CLI Usage recommended)

Install

npm install vue-picture-sharesheet --save

Import locally

import PictureSharesheet  from 'vue-picture-sharesheet';

export default {
  name: 'HelloWorld',
  components: {
    PictureSharesheet
  }
}

OR import globally (f.e. in the Main.js)

import PictureSharesheet from 'vue-picture-sharesheet'
Vue.component('picture-sharesheet',PictureSharesheet);

Properties

Native image attributes ๐Ÿ› 

  • src: String : URL, Specifies the URL of an image
  • alt: String : text, Specifies an alternate text for an image
  • height: String : pixels/%, Specifies the height of an image
  • width: String : pixels/%, Specifies the width of an image
  • ismap: boolean : ismap, Specifies an image as a server-side image-map
  • longdesc: String : URL, Specifies a URL to a detailed description of an image
  • usemap: String : #mapname, Specifies an image as a client-side image-map
  • crossorigin : String: anonymous | use-credentials, Allow images from third-party sites that allow cross-origin access to be used with canvas

Component attributes ๐ŸŽจ

  • sheetcolor: String : Color, Specifies the Background-color of the Sharesheet
  • iconcolor: String : Color, Specifies the Background-color of the Sharesheet
  • position: String : bottom | top | left| right, Position of the Sharesheet
  • size: String : pixels/%, height/width of the Sharesheet
  • sharemessage: String : Will be shared in addition to the link. Per Default Website Title. In Facebook Share Dialog as Quote.
  • fixed: Boolean : if set Sharesheet is visible all the time

Examples

Showing the Sharesheet all the time (not only while :hover) and set the background-color of the sharesheet to white and the icon color to black.

<picture-sharesheet src="https://source.unsplash.com/800x500/?cat" sheetcolor="#FFF" iconcolor="#000" fixed/>

Set the position of the sharesheet to top, the height of the Sharesheet to 100px and the message that will be shared via the Social Media Buttons to "YAY!"

<picture-sharesheet src="https://source.unsplash.com/600x550/?cat" position="top" size="100px" sharemessage="YAY!"/>

Commands

  • npm start - Starting a Server to run the demos/examples
  • npm run-script demo - Building the demos/examples in /docs

Roadmap

  • Multiple Image Source (srcset .. )
  • Mobile optimized
  • different overlay modes
  • custom icons

vue-picture-sharesheet's People

Contributors

huangxizhou avatar onatcer 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

Watchers

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