Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ 📖 [AMP Story Audio Sticker] Documentation and validator tests #39184

Merged
merged 76 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a7979f2
Audio sticker skeleton code: clicking on the element would unmute the…
ychsieh Mar 17, 2023
f0b0612
Merge branch 'main' into audio-sticker
ychsieh Mar 17, 2023
3fbe438
Remove validator test and spaces in css file
ychsieh Mar 17, 2023
00b9666
Add dependency
ychsieh Mar 18, 2023
74705de
Update z-index
ychsieh Mar 18, 2023
e973034
Update extensions/amp-story-audio-sticker/0.1/amp-story-audio-sticker…
ychsieh Apr 7, 2023
8628d81
Cleaning up extension and css code
ychsieh Apr 7, 2023
5fc5067
fix
ychsieh Apr 7, 2023
6566f8f
Remove unnecessary CSS and update the example.
ychsieh Apr 7, 2023
9c86e49
Merge branch 'main' into audio-sticker
ychsieh Apr 7, 2023
a506279
Fix z-index
ychsieh Apr 7, 2023
32b83c1
Remove validator
ychsieh Apr 7, 2023
8cced0c
Add the sticker container and tap hint
ychsieh Apr 11, 2023
8c6de32
Merge branch 'main' into audio-sticker
ychsieh Apr 11, 2023
256f86d
Merge branch 'audio-sticker' into sticker-size
ychsieh Apr 11, 2023
2c544cf
Fix whitespace
ychsieh Apr 11, 2023
b412c1f
lint
ychsieh Apr 11, 2023
5f0051d
String concat in jsx
ychsieh Apr 18, 2023
789f763
Merge branch 'main' into sticker-size
ychsieh Apr 18, 2023
b6fd4e7
Default stickers and switching between different states
ychsieh Apr 21, 2023
669ce06
Merge branch 'main' into premade-sticker
ychsieh Apr 21, 2023
f60a3a0
Remove duplicate buildCallback
ychsieh Apr 21, 2023
a3db379
Use CSS to execute animation delay instead. Have a new helper functio…
ychsieh Apr 24, 2023
718090a
Change default size to small
ychsieh Apr 24, 2023
01cc606
Fix lint
ychsieh Apr 24, 2023
cadeba4
Fix unit test
ychsieh Apr 24, 2023
ce98195
Merge branch 'main' into premade-sticker
ychsieh Apr 25, 2023
27b6da9
Merge branch 'main' into premade-sticker
ychsieh Apr 26, 2023
1109824
refactors
ychsieh Apr 27, 2023
cc0a4c4
Move amp-img src setting to buildcallback
ychsieh Apr 27, 2023
f08c248
Fixes
ychsieh Apr 27, 2023
a202bed
Merge branch 'main' into premade-sticker
ychsieh Apr 27, 2023
50a2824
Fix
ychsieh Apr 27, 2023
397d98b
Update extensions/amp-story-audio-sticker/0.1/amp-story-audio-sticker.js
ychsieh May 3, 2023
0ffd036
lint
ychsieh May 3, 2023
83b53c3
Merge branch 'main' into premade-sticker
ychsieh May 3, 2023
5a78a8e
Merge branch 'main' into premade-sticker
ychsieh May 15, 2023
ec01ac7
Merge branch 'main' into premade-sticker
ychsieh May 15, 2023
ddec7d6
Add animation and styles to sticker
ychsieh May 15, 2023
f9061e0
Rename css variable
ychsieh May 15, 2023
3b995ee
Replace borders with box-shadow.
ychsieh May 23, 2023
707a8a6
Merge branch 'main' into premade-sticker
ychsieh May 23, 2023
8501ff1
Fix unit test and merge with main.
ychsieh May 23, 2023
cc73ec1
Replace unnecessary classes and event listeners with CSS selectors.
ychsieh May 24, 2023
e21837b
Allow developers to set the CSS variables directly,
ychsieh May 25, 2023
41dcb5f
Replace box-shadow with filter drop-shadow
ychsieh May 25, 2023
db2cc92
Ensure transitions work on both scaling down and up.
ychsieh May 25, 2023
853ee17
minor fixes
ychsieh May 26, 2023
409ba71
Make color variables global.
ychsieh May 26, 2023
2a71c88
Remove comment
ychsieh May 26, 2023
e5239cf
Use inset: 0 instead.
ychsieh May 30, 2023
1c20bb2
Highlight mute button only when the sticker is clicked
ychsieh Jun 2, 2023
d88b676
unit test
ychsieh Jun 2, 2023
372f8f1
Merge branch 'main' into premade-sticker
ychsieh Jun 2, 2023
cb97143
Merge branch 'main' into premade-sticker
ychsieh Jun 12, 2023
fec72ed
Get system UI in the click handler instead of layout callback to prev…
ychsieh Jun 12, 2023
4dc216f
Trivial simplification
ychsieh Jun 13, 2023
13887ae
Update extensions/amp-story/1.0/amp-story-system-layer.css
ychsieh Jun 13, 2023
a4391e1
Update extensions/amp-story-audio-sticker/0.1/amp-story-audio-sticker.js
ychsieh Jun 13, 2023
9895638
Fix lint
ychsieh Jun 13, 2023
ab50569
Merge branch 'main' into sticker-doc
ychsieh Jun 14, 2023
9802b26
Sticker documentation and validator
ychsieh Jun 21, 2023
d9beb4c
Merge branch 'main' into sticker-doc
ychsieh Jun 21, 2023
66d3802
Try validator
ychsieh Jun 21, 2023
b3e0de3
Update with validator-generated .out file.
ychsieh Jun 22, 2023
c784856
Merge branch 'main' into sticker-doc
ychsieh Jul 12, 2023
0a2285b
Manually fix validator
ychsieh Jul 12, 2023
f54bd15
Simplify validators
ychsieh Jul 13, 2023
a641d5c
Merge branch 'main' into sticker-doc
ychsieh Jul 19, 2023
5074d73
Remove player tags
ychsieh Jul 19, 2023
2d0ca8e
Fix validator rules
ychsieh Jul 20, 2023
2dd62b6
Change sticker name and disallow most child tags
ychsieh Jul 21, 2023
4a1d870
Fix unit test
ychsieh Jul 21, 2023
4970b08
Add validator test case for not in grid layer
ychsieh Jul 26, 2023
dd54119
Merge branch 'main' into sticker-doc
ychsieh Jul 26, 2023
23cbdec
Merge branch 'main' into sticker-doc
ychsieh Aug 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions examples/amp-story/amp-story-audio-sticker.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<script async src="https://cdn.ampproject.org/v0.js"></script>
<title>Key Highlights of AMP Conf 2018</title>

<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-latest.js"></script>
<script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
<script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script>
<script async custom-element="amp-story-audio-sticker" src="https://cdn.ampproject.org/v0/amp-story-audio-sticker-0.1.js"></script>
Expand Down Expand Up @@ -127,7 +126,7 @@
<h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<p class="byline">By The AMP team</p>
</amp-story-grid-layer>
<amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker sticker="audio-cloud"></amp-story-audio-sticker>
</amp-story-grid-layer>>
</amp-story-page>
Expand All @@ -147,7 +146,7 @@ <h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<p class="byline">By The AMP team</p>
</amp-story-grid-layer>
<amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker size="large" sticker="cat-sticker"></amp-story-audio-sticker>
</amp-story-grid-layer>>
</amp-story-page>
Expand All @@ -167,9 +166,9 @@ <h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<p class="byline">By The AMP team</p>
</amp-story-grid-layer>
<amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker sticker="loud-speaker"></amp-story-audio-sticker>
</amp-story-grid-layer>>
</amp-story-grid-layer>
</amp-story-page>

<amp-story-page id="page-4" title="Lorem ipsum dolor sit amet">
Expand All @@ -187,9 +186,9 @@ <h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<p class="byline">By The AMP team</p>
</amp-story-grid-layer>
<amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker size="large" sticker="tape-player"></amp-story-audio-sticker>
</amp-story-grid-layer>>
</amp-story-grid-layer>
</amp-story-page>

<amp-story-page id="page-5" title="Lorem ipsum dolor sit amet">
Expand All @@ -207,7 +206,7 @@ <h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<p class="byline">By The AMP team</p>
</amp-story-grid-layer>
<amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker sticker-style="outline">
<amp-story-audio-sticker-pretap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
Expand All @@ -234,7 +233,7 @@ <h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<h1 class="bold">Key Highlights of AMP Conf 2018</h1>
<p class="byline">By The AMP team</p>
</amp-story-grid-layer>
<amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker size="large" sticker-style="dropshadow">
<amp-story-audio-sticker-pretap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!doctype html>
<html ⚡ lang="en">
<head>
<meta charset="utf-8">
<link rel="canonical" href="ampconf.html">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<title>Key Highlights of AMP Conf 2018</title>

<script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
<script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script>
<script async custom-element="amp-story-audio-sticker" src="https://cdn.ampproject.org/v0/amp-story-audio-sticker-0.1.js"></script>

<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
</head>
<body>
<amp-story standalone id="cats"
title="Key Highlights of AMP Conf 2018" publisher="The AMP team"
publisher-logo-src="./img/amplogo.png"
poster-portrait-src="./img/overview.jpg">

<amp-story-page id="page-1" title="Lorem ipsum dolor sit amet">
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker sticker="audio-cloud"></amp-story-audio-sticker>
</amp-story-grid-layer>>
</amp-story-page>

<amp-story-page id="page-2" title="Lorem ipsum dolor sit amet">
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker size="large" sticker="cat-sticker"></amp-story-audio-sticker>
</amp-story-grid-layer>>
</amp-story-page>

<amp-story-page id="page-3" title="Lorem ipsum dolor sit amet">
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker sticker="loud-speaker"></amp-story-audio-sticker>
</amp-story-grid-layer>
</amp-story-page>

<amp-story-page id="page-4" title="Lorem ipsum dolor sit amet">
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker size="large" sticker="tape-player"></amp-story-audio-sticker>
</amp-story-grid-layer>
</amp-story-page>

<amp-story-page id="page-5" title="Lorem ipsum dolor sit amet">
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker sticker-style="outline">
<amp-story-audio-sticker-pretap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
</amp-story-audio-sticker-pretap>
<amp-story-audio-sticker-posttap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
</amp-story-audio-sticker-posttap>
</amp-story-audio-sticker>
</amp-story-grid-layer>
</amp-story-page>

<amp-story-page id="page-6" title="Lorem ipsum dolor sit amet">
<amp-story-grid-layer template="vertical">
<amp-story-audio-sticker size="large" sticker-style="dropshadow">
<amp-story-audio-sticker-pretap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
</amp-story-audio-sticker-pretap>
<amp-story-audio-sticker-posttap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
</amp-story-audio-sticker-posttap>
</amp-story-audio-sticker>
</amp-story-grid-layer>
</amp-story-page>
</amp-story>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
PASS
erwinmombay marked this conversation as resolved.
Show resolved Hide resolved
| <!doctype html>
| <html ⚡ lang="en">
| <head>
| <meta charset="utf-8">
| <link rel="canonical" href="ampconf.html">
| <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
| <script async src="https://cdn.ampproject.org/v0.js"></script>
| <title>Key Highlights of AMP Conf 2018</title>
|
| <script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
| <script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script>
| <script async custom-element="amp-story-audio-sticker" src="https://cdn.ampproject.org/v0/amp-story-audio-sticker-0.1.js"></script>
|
| <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
| </head>
| <body>
| <amp-story standalone id="cats"
| title="Key Highlights of AMP Conf 2018" publisher="The AMP team"
| publisher-logo-src="./img/amplogo.png"
| poster-portrait-src="./img/overview.jpg">
|
| <amp-story-page id="page-1" title="Lorem ipsum dolor sit amet">
| <amp-story-grid-layer template="vertical">
| <amp-story-audio-sticker sticker="audio-cloud"></amp-story-audio-sticker>
| </amp-story-grid-layer>>
| </amp-story-page>
|
| <amp-story-page id="page-2" title="Lorem ipsum dolor sit amet">
| <amp-story-grid-layer template="vertical">
| <amp-story-audio-sticker size="large" sticker="cat-sticker"></amp-story-audio-sticker>
| </amp-story-grid-layer>>
| </amp-story-page>
|
| <amp-story-page id="page-3" title="Lorem ipsum dolor sit amet">
| <amp-story-grid-layer template="vertical">
| <amp-story-audio-sticker sticker="loud-speaker"></amp-story-audio-sticker>
| </amp-story-grid-layer>
| </amp-story-page>
|
| <amp-story-page id="page-4" title="Lorem ipsum dolor sit amet">
| <amp-story-grid-layer template="vertical">
| <amp-story-audio-sticker size="large" sticker="tape-player"></amp-story-audio-sticker>
| </amp-story-grid-layer>
| </amp-story-page>
|
| <amp-story-page id="page-5" title="Lorem ipsum dolor sit amet">
| <amp-story-grid-layer template="vertical">
| <amp-story-audio-sticker sticker-style="outline">
| <amp-story-audio-sticker-pretap>
| <amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
| </amp-story-audio-sticker-pretap>
| <amp-story-audio-sticker-posttap>
| <amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
| </amp-story-audio-sticker-posttap>
| </amp-story-audio-sticker>
| </amp-story-grid-layer>
| </amp-story-page>
|
| <amp-story-page id="page-6" title="Lorem ipsum dolor sit amet">
| <amp-story-grid-layer template="vertical">
| <amp-story-audio-sticker size="large" sticker-style="dropshadow">
| <amp-story-audio-sticker-pretap>
| <amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
| </amp-story-audio-sticker-pretap>
| <amp-story-audio-sticker-posttap>
| <amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
| </amp-story-audio-sticker-posttap>
| </amp-story-audio-sticker>
| </amp-story-grid-layer>
| </amp-story-page>
| </amp-story>
| </body>
| </html>
104 changes: 104 additions & 0 deletions extensions/amp-story-audio-sticker/amp-story-audio-sticker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,112 @@ formats:
- stories
teaser:
text: A sticker for users to click and unmute the story.
tags:
- audio
- sticker
author: ychsieh
$title: amp-story-audio-sticker
version: '0.1'
versions:
- '0.1'
latest_version: '0.1'
$path: /documentation/components/amp-story-audio-sticker.html
$scripts:
- >-
<script async custom-element="amp-story"
src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
<script async custom-element="amp-story-audio-sticker" src="https://cdn.ampproject.org/v0/amp-story-audio-sticker-0.1.js"></script>
---

# amp-story-audio-sticker

<amp-video autoplay loop
width="400"
height="750"
layout="fill">

<source src="https://github-production-user-asset-6210df.s3.amazonaws.com/1697814/245924556-e953c54a-0a09-4f15-8134-be6a0ac758ab.mp4" type="video/mp4">
</amp-video>

# Summary

An audio sticker component for publishers to put anywhere on their story for users to click to unmute the story.

Developers can choose to either choose one of the 4 default stickers or provide custom stickers. The sticker should be put inside an `<amp-story-grid-layer>`.

# Attributes

### `size` {string} optional

Size of the sticker. Accepted values:

- “large”: 180 x 180 px
- “small”: 120 x 120 px

Default value: “small”, which would be used if the input value is invalid or is not provided.

### `sticker` {string} optional

Default value: “cat-sticker”, which would be used if the input value is invalid or is not provided.

A list of premade stickers to use:

| Accepted Value | Pre-tap Image | Post-tap Image |
| -------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| “cat-sticker” | ![Cat Pre-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/cat-sticker-pretap.png) | ![Cat Post-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/cat-sticker-posttap.gif) |
erwinmombay marked this conversation as resolved.
Show resolved Hide resolved
| “tape-player” | ![Player Pre-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/tape-player-pretap.png) | ![Player Post-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/tape-player-posttap.gif) |
| “loud-speaker” | ![Speaker Pre-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/loud-speaker-pretap.png) | ![Speaker Post-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/loud-speaker-posttap.png) |
| “audio-cloud” | ![Cloud Pre-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/audio-cloud-pretap.png) | ![Cloud Post-tap](https://www.gstatic.com/amphtml/stamp/audio-sticker/audio-cloud-posttap.png) |

### `sticker-style` {string} optional

Default value: none

Extra premade styles of the sticker to use:

| Accepted Value | Description | Header 3 |
| -------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| “outline” | Adds a border around the provided sticker image. | ![Image 2](https://github.com/ampproject/amphtml/assets/1697814/c7996424-c810-40d3-a28f-09e7c76742d1) |
| “dropshadow” | Adds a dropshadow around the opaque part of the provided sticker image. | ![Image 4](https://github.com/ampproject/amphtml/assets/1697814/2f5b6c5d-ea86-4345-80b8-3b2c20c92e58) |

#### Customize Sticker Style via CSS Variables

- `--story-audio-sticker-outline-color`: Color of the sticker outline.
- `--story-audio-sticker-dropshadow-color`: Color of the sticker drop shadow.

If the CSS variables are set on story level, the color would be applied to all stickers in the story. If the CSS variables are set on story page or sticker level, it would only be applied to the sticker on specific story page or the specific sticker.
erwinmombay marked this conversation as resolved.
Show resolved Hide resolved

If not set, the color of either style would be white.

# Children Nodes

### `<amp-story-audio-sticker-pretap>` optional

Sticker shown before a user tap. Takes any html code that can be rendered as a sticker, e.g. `<amp-img>`, `<svg>`, general elements with CSS animation, etc.

### `<amp-story-audio-sticker-posttap>` optional

Sticker shown after a user tap. Takes any html code that can be rendered as a sticker, e.g. `<amp-img>`, `<svg>`, general elements with CSS animation, etc.

# Example: Premade Stickers

```html
<amp-story-grid-layer>
<amp-story-audio-sticker size="large" sticker="tape-player"></amp-story-audio-sticker>
</amp-story-grid-layer>
```

# Example: Custom Stickers

```html
<amp-story-grid-layer>
<amp-story-audio-sticker size="large" sticker-style="dropshadow">
<amp-story-audio-sticker-pretap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
</amp-story-audio-sticker-pretap>
<amp-story-audio-sticker-posttap>
<amp-img width="100" height="100" layout="responsive" src="https://d1k5j68ob7clqb.cloudfront.net/thumb/480/processed/thumb/5zK5d91jK0gLkv1AMa.png"></amp-img>
</amp-story-audio-sticker-posttap>
</amp-story-audio-sticker>
</amp-story-grid-layer>
```
Loading