Skip to content

Commit

Permalink
Merge pull request #11 from micahilbery/position-url-fix
Browse files Browse the repository at this point in the history
Big Code Cleanup
  • Loading branch information
micahilbery committed Feb 9, 2024
2 parents 2e4e231 + 8b5e87c commit c78f0c0
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 145 deletions.
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To install this component all you need to do is add this script tag
to the bottom of your page:

```html
<script defer type="module" src="https://cdn.jsdelivr.net/npm/@micahilbery/share-on-mastodon@1.1.0/share-on-mastodon.min.js"></script>
<script defer type="module" src="https://cdn.jsdelivr.net/npm/@micahilbery/share-on-mastodon@1.2.0/share-on-mastodon.min.js"></script>
```

## Usage
Expand All @@ -27,11 +27,11 @@ to customize the markup and shared message you can use the custom attributes.
For example:

```html
<share-on-mastodon share_title="Your Title"
share_description="This is a really descriptive description."
hashtags="#gottaHaveThoseHashtags #hashtag #mastodon"
author="@yourusername@yourinstance.social"
default_url="https://yourinstance.social">
<share-on-mastodon data-share-title="Your Title"
data-share-description="This is a really descriptive description."
data-hashtags="#gottaHaveThoseHashtags #hashtag #mastodon"
data-author="@yourusername@yourinstance.social"
data-default-url="https://yourinstance.social">
</share-on-mastodon>
```

Expand All @@ -49,25 +49,26 @@ class and set the css variables in it. Then give the custom element that class.

```html
<share-on-mastodon class="your-custom-class"
share_title="Your Title"
share_description="This is a really descriptive description."
hashtags="#gottaHaveThoseHashtags #hashtag #mastodon"
author="@yourusername@yourinstance.social"
default_url="https://yourinstance.social">
data-share-title="Your Title"
data-share-description="This is a really descriptive description."
data-hashtags="#gottaHaveThoseHashtags #hashtag #mastodon"
data-author="@yourusername@yourinstance.social"
data-default-url="https://yourinstance.social">
</share-on-mastodon>
```

## Custom Attributes

- `share_title` - Adds a title to the shared message body.
- `share_description` - Adds a description to the shared message body.
- `hashtags` - Adds hashtags to the shared message body. space separated (ex: `hashtags="#hashtag1 #hashtag2"`)
- `author` - Adds a mastodon username to the shared message body.
- `default_url` - The url used for the placeholder text of the modal input.
- `button_text` = Sets the text of the main button.
- `modal_heading` - Sets the text of the modal heading.
- `modal_text` - Sets the modal's text.
- `share_text` - Sets the text of the modal button.
- `data-share-title` - Adds a title to the shared message body.
- `data-share-description` - Adds a description to the shared message body.
- `data-hashtags` - Adds hashtags to the shared message body. space separated (ex: `data-hashtags="#hashtag1 #hashtag2"`)
- `data-author` - Adds a mastodon username to the shared message body.
- `data-default-url` - The url used for the placeholder text of the modal input.
- `data-button-text` = Sets the text of the main button.
- `data-modal-heading` - Sets the text of the modal heading.
- `data-modal-text` - Sets the modal's text.
- `data-jargon-text` - Set the text under the input explaining what an instance is.
- `data-share-text` - Sets the text of the modal button.

## Custom slots

Expand Down Expand Up @@ -99,3 +100,4 @@ class and set the css variables in it. Then give the custom element that class.
- `--mastodon-close-bg` - Sets the modal close button;s background color.
- `--mastodon-close-border` - Sets the modal close button's border.
- `--mastodon-close-rad` - Sets the modal close button's border radius.
- `--mastodon-backdrop-blur` - Sets the blur of the content behind the modal.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@micahilbery/share-on-mastodon",
"version": "1.1.0",
"version": "1.2.0",
"description": "A web component to add a customizeable \"Share on Mastodon\" button to your pages.",
"main": "share-on-mastodon.js",
"module": "share-on-mastodon.js",
Expand Down
Loading

0 comments on commit c78f0c0

Please sign in to comment.