0.7.3 • Published 8 months ago

@dotpostcard/postcards-html v0.7.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

postcards-html

Web components for displaying Postcards in the .postcard file format in HTML.

Usage

See this example at dotpostcard.github.io/postcards-html.

<script type="module" src="https://unpkg.com/@dotpostcard/postcards-html?module"></script>
<p>Hello from Madrid:</p>
<postcard-display name="hello" src="https://raw.githubusercontent.com/dotpostcard/postcards-go/main/fixtures/hello.postcard"></postcard-display>

<postcard-info for="hello"></postcard-info>

Events

Two CustomEvents are dispatched from a postcard-display element during its lifetime. The postcard-info element hooks into them automatically, but you can attach directly if you'd like more control over what data is displayed.

postcard-loaded: fired once the metadata has loaded, the detail property contains the name of the postcard display element, metadata which is a Metadata object (as specified by postcards-ts), and the showingSide (which is either front or back, and can be used to get metadata for the currently showing side of the postcard with metadata[showingSide]).

postcard-flipped: fired each time the postcard is flipped over. The detail property contains the name and showingSide keys, as described above.

0.7.2

8 months ago

0.7.1

8 months ago

0.7.3

8 months ago

0.7.0

9 months ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.6

2 years ago