Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Criando componentes interativos em páginas AMP ...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Murilo de Siqueira Ferreira
November 12, 2018
Programming
0
23
Criando componentes interativos em páginas AMP com <amp-bind>
Murilo de Siqueira Ferreira
November 12, 2018
Tweet
Share
More Decks by Murilo de Siqueira Ferreira
See All by Murilo de Siqueira Ferreira
html robusto e elegante
muhroots
0
21
Introdução ao AMP (Accelerated Mobile Pages)
muhroots
0
23
Acessibilidade na web
muhroots
0
39
Other Decks in Programming
See All in Programming
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
280
Raku Raku Notion 20260128
hareyakayuruyaka
0
370
AI時代の認知負荷との向き合い方
optfit
0
170
Fluid Templating in TYPO3 14
s2b
0
130
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
620
生成AIを活用したソフトウェア開発ライフサイクル変革の現在値
hiroyukimori
PRO
0
110
AI & Enginnering
codelynx
0
120
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
150
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
230
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
260
Building an army of robots
kneath
306
46k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.4k
New Earth Scene 8
popppiees
1
1.6k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
150
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
340
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Statistics for Hackers
jakevdp
799
230k
Transcript
<amp-bind>
instantaneamente
None
None
JS
None
➔ ➔ ➔ interações complexas
None
➔ ➔ ➔
➔ ➔
<amp-state id="myState"> <script type="application/json"> { myText: "Hello AMP" } </script>
</amp-state>
<amp-state id="myState"> <script type="application/json"> { myText: "Hello AMP" } </script>
</amp-state> <span [text]="myState.myText"> Hello World </span>
None
<amp-state id="myState"> <script type="application/json"> { "myText": "Hello AMP" } </script>
</amp-state> <span [text]="myState.myText">Hello World</span> <button on="tap:AMP.setState({ myState: { myText: 'Hello Binding' } })">SetState</button>
None
<amp-state id="myState"> <script type="application/json"> { "myText": "Hello world AMP" }
</script> </amp-state> <!-- change browser history --> <button on="tap:AMP.pushState({ myState: { myText: 'Browser History' } })">SetState</button>
None
None
➔ ➔
// Returns [1, 2, 3] [3, 2, 1].sort() // Returns
6. [1, 2, 3].reduce((x, y) => x + y) // Object to Array keys(event.speakers).map(x => event.speakers[x])
String charAt charCodeAt concat indexOf lastIndexOf slice split substr substring
toLowerCase toUpperCase Number toExponential toFixed toPrecision toString Objects keys value Array concat filter includes indexOf join lastIndexOf map reduce slice some sort splice Math abs ceil floor max min random round Global encodeURIComponent
<amp-list id="speakers" [src]="keys(speakers).map(x => speakers[x])")> <template type="amp-mustache"> <strong>{{name}}</strong> <span>{{jobTitle}}</span> </template>
</amp-list>
<amp-bind-macro id="circle" arguments="r" expression="3.14 * r * r" />
<amp-bind-macro id="SpeakersBind" arguments="speakers" expression="keys(speakers).map(x => speakers[x])" /> <amp-list id="speakers" [src]="SpeakersBind(event.speakers)")>
<template type="amp-mustache"> <strong>{{name}}</strong> <span>{{jobTitle}}</span> </template> </amp-list>
None
<input type="checkbox" [checked]="creditcard._1177" [disabled]="checkeds == 4">
None
<!-- Add/Remove --> <input type="checkbox" [checked]="creditcards && creditcards._1177" [disabled]="checkeds ==
4 && !creditcards._1177" on="change:AMP.setState({ creditcards: { _1177: event.checked, }, checkeds: (event.checked ? checkeds+1 : checkeds-1), })">
<!-- Change text --> <span [text]="creditcards._1177 ? 'Remover' : 'Comparar'")
Comparar </span> <!-- Remove all --> <button on="tap:AMP.setState({ checkeds: 0, creditcards: null })") Remover tudo </button>
None
None
None
None
None
@muhroots