-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(amp-live-list): add update feature (#3260)
- Loading branch information
1 parent
9f44c79
commit b1ec91e
Showing
7 changed files
with
435 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<!doctype html> | ||
<html ⚡> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Lorem Ipsum | PublisherName</title> | ||
<link rel="canonical" href="amps.html" > | ||
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | ||
<link href='https://fonts.googleapis.com/css?family=Georgia|Open+Sans|Roboto' rel='stylesheet' type='text/css'> | ||
<style amp-custom> | ||
amp-live-list > [items] { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.amp-live-list-item { | ||
height: 100px; | ||
background-color: #f8f8f8; | ||
border-bottom: 1px solid rgba(0, 0, 0, .12); | ||
} | ||
|
||
.card { | ||
display: flex; | ||
margin: 15px; | ||
padding: 10px; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #fff; | ||
box-shadow: rgba(0, 0, 0, .3) 0 0 5px; | ||
} | ||
|
||
.card > div { | ||
flex-basis: 50%; | ||
} | ||
|
||
.side { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-around; | ||
} | ||
|
||
.content { | ||
font-size: 1.5rem; | ||
} | ||
|
||
header { | ||
font-size: 2rem; | ||
} | ||
</style> | ||
<link href='https://fonts.googleapis.com/css?family=Georgia|Open+Sans|Roboto' rel='stylesheet' type='text/css'> | ||
<script async custom-element="amp-live-list" src="https://cdn.ampproject.org/v0/amp-live-list-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> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
</head> | ||
<body> | ||
<header> | ||
Scoreboard refresh takes 15 seconds. | ||
</header> | ||
<amp-live-list | ||
layout="container" | ||
data-poll-interval="15000" | ||
data-max-items-per-page="5" | ||
id="my-live-list"> | ||
<button id="btn" update on="tap:my-live-list.update">You have updates</button> | ||
<div items> | ||
<div id="list-item-2" data-sort-time="1462814963693"> | ||
<div class="card"> | ||
<div class="side side-left"> | ||
<div class="logo"> | ||
<amp-img src="/examples/img/ampicon.png" | ||
layout="fixed" height="50" width="50"> | ||
</amp-img> | ||
</div> | ||
<div class="content">2</div> | ||
</div> | ||
<div class="side side-right"> | ||
<div class="content">2</div> | ||
<div class="logo"> | ||
<amp-img src="/examples/img/ampicon.png" | ||
layout="fixed" height="50" width="50"> | ||
</amp-img> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="list-item-1" data-sort-time="1462814955597"> | ||
<div class="card"> | ||
<div class="side side-left"> | ||
<div class="logo"> | ||
<amp-img src="/examples/img/ampicon.png" | ||
layout="fixed" height="50" width="50"> | ||
</amp-img> | ||
</div> | ||
<div class="content">2</div> | ||
</div> | ||
<div class="side side-right"> | ||
<div class="content">2</div> | ||
<div class="logo"> | ||
<amp-img src="/examples/img/ampicon.png" | ||
layout="fixed" height="50" width="50"> | ||
</amp-img> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</amp-live-list> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.