/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/google-document-embed.amp.html
67 строк
4 KB
Carlos Vializ
Update amp-bind docs for amp-google-document-embed. Fix example. (#17339)
07 авг 2018, 23:23
Не верифицирован
07 авг 2018, 23:23
322527f
Код
Авторство
О чём код?
<!doctype html> <html amp lang="en"> <head> <meta charset="utf-8"> <script async src="https://cdn.ampproject.org/v0.js"></script> <script async custom-element="amp-google-document-embed" src="https://cdn.ampproject.org/v0/amp-google-document-embed-0.1.js"></script> <script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script> <title>Hello, AMPs</title> <link rel="canonical" href="http://www.example.com/google-document-embed.amp.html" /> <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> amp-google-document-embed { margin: 0 5vw; } </style> </head> <body> <h1>amp-google-document-embed</h1> <h2>PDF document</h2> <amp-google-document-embed src="https://www.gpo.gov/fdsys/pkg/GPO-CONAN-1992/pdf/GPO-CONAN-1992-6.pdf" width="1" height="1" layout="responsive"><div placeholder>Loading document...</div></amp-google-document-embed> <h2>XLS Document</h2> <amp-google-document-embed src="https://www.census.gov/population/www/censusdata/Population_PartII.xls" width="1" height="1" layout="responsive"></amp-google-document-embed> <h2>Google Docs</h2> <amp-google-document-embed src="https://docs.google.com/document/d/e/2PACX-1vQcy6GoJ2yCKMxe4SNALCPCYWV2Ufg-e6D3djyaJluQXubAfKA3toPqVxWaWK-lJFm4Nyxv-swrkvyN/pub" width="1" height="1" layout="responsive"></amp-google-document-embed> <h2>Google Sheets</h2> <amp-google-document-embed src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQoTpScZNIRJY9lPDSIv1kZo1jfs5k_3WV6_orhvd-MrSuWnPo93_uGMWiJ9L5McH0kygBaQpxgWl8A/pubhtml" width="1" height="1" layout="responsive"></amp-google-document-embed> <h2>with amp-bind</h2> <amp-state id="toggle"> <script type="application/json"> { "constitution": true } </script> </amp-state> <button on="tap: AMP.setState({ toggle: {constitution: !toggle.constitution } })" [text]="'Toggle to ' + (toggle.constitution ? 'Sheets' : 'Constitution')" >Toggle to Sheets</button> <amp-google-document-embed src="https://www.gpo.gov/fdsys/pkg/GPO-CONAN-1992/pdf/GPO-CONAN-1992-6.pdf" [src]=" toggle.constitution ? 'https://www.gpo.gov/fdsys/pkg/GPO-CONAN-1992/pdf/GPO-CONAN-1992-6.pdf' : 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQoTpScZNIRJY9lPDSIv1kZo1jfs5k_3WV6_orhvd-MrSuWnPo93_uGMWiJ9L5McH0kygBaQpxgWl8A/pubhtml' " title="The United States Constitution" [title]=" toggle.constitution ? 'The United States Constitution' : 'An amazing spreadsheet' " width="1" height="1" layout="responsive"></amp-google-document-embed> </body> </html>