Skip to content

Instantly share code, notes, and snippets.

@nha
Last active January 30, 2018 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nha/3f0e51cebf5838350301a378e99998d5 to your computer and use it in GitHub Desktop.
Save nha/3f0e51cebf5838350301a378e99998d5 to your computer and use it in GitHub Desktop.
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
<link rel="canonical" href="https://ampbyexample.com/components/amp-lightbox/">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<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>
<style amp-custom>
.lightbox {
background: rgba(0,0,0,0.8);
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
}
.lightbox h1 {
color: white;
}
button {background-color: tomato;}
.close {
float:right;
margin-top:-30px;
margin-right:-30px;
cursor:pointer;
color: #fff;
border: 1px solid #AEAEAE;
border-radius: 30px;
background: tomato;
font-size: 31px;
font-weight: bold;
display: inline-block;
line-height: 0px;
padding: 11px 3px;
}
</style>
</head>
<body>
<amp-lightbox id="my-lightbox" layout="nodisplay">
<div class="lightbox">
<h1>Close me -->>
<a class="close" href="" on="tap:my-lightbox.close" role="button">X</a>
</h1>
</div>
</amp-lightbox>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<p> Some content </p>
<button class="ampstart-btn caps m2" on="tap:my-lightbox" role="button" tabindex="0">
Open lightbox
</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment