@damusix/floating-share
v2.0.0
Published
A simple and stylish floating share button for web pages, designed to integrate seamlessly and provide a fallback for browsers that do not support the Web Share API.
Readme
Floating Share Button
A simple and stylish floating share button for web pages, designed to integrate seamlessly and provide a fallback for browsers that do not support the Web Share API.
Installation
To use the Floating Share Button via CDN, include the following script tag in your HTML:
<script src="https://cdnjs.cloudflare.com/ajax/libs/floating-share-button/1.0.0/share.min.js"></script>Usage
Initialize the FloatingShareButton class to create a floating button on the bottom right corner of the page, which allows users to share the current page using the Web Share API or a fallback dialog.
new FloatingShareButton({
primaryColor: '#0f6d9c',
secondaryColor: '#19b2ff',
position: { bottom: '50px', right: '50px' }
});Customization
You can customize the appearance of the button by overriding the CSS variables or by passing options to the class constructor:
primaryColor: The primary color of the button.secondaryColor: The secondary color of the button.position: An object specifying thebottomandrightposition of the button.
Development
To develop or modify the Floating Share Button, clone the repository and make changes to share.js. You can then build and test your changes locally.
License
This project is licensed under the ISC License.
