/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/amp-tiktok-cls-example.html
47 строк
2 KB
rebeccanthomas
🐛[`amp-tiktok`] Fix CLS bug. (#35850)
31 авг 2021, 23:26
Не верифицирован
31 авг 2021, 23:26
679a3af
Код
Авторство
О чём код?
<!DOCTYPE html> <html ⚡ lang="en"> <head> <meta charset="utf-8" /> <title>amp-tiktok example</title> <link rel="canonical" href="amps.html" /> <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1" /> <!-- prettier-ignore --> <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-tiktok { color: red; border-style: solid; } </style> <script async custom-element="amp-tiktok" src="https://cdn.ampproject.org/v0/amp-tiktok-0.1.js" ></script> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body> <h2>Should not show CLS because `height` attr is equal to the final height of the iframe</h2> <amp-tiktok height="721" layout="fixed-height" data-src="https://www.tiktok.com/@countingprimes/video/6988237085899574533"></amp-tiktok> </break> <h2>Does show cls because the initial height is larger than the final size of the iframe</h2> <amp-tiktok width="700" height="800" data-src="https://www.tiktok.com/@scout2015/video/6943753342808034566" ></amp-tiktok> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </body> </html>