3 ms·
Precisely. The exact code is here: https://www.ampproject.org/docs/fundamentals/spec/amp-boilerplate https://www.ampproject.org/docs/fundamentals/spec/amp-boil
by gregable 8y ago
Precisely. The exact code is here:
https://www.ampproject.org/docs/fundamentals/spec/amp-boilerplate https://www.ampproject.org/docs/fundamentals/spec/amp-boiler...
Here it is pretty-printed and simplified to not have the vendor-specific stuff:
<style amp-boilerplate>
body{
animation:-amp-start 8s steps(1,end) 0s 1 normal both
}
@keyframes -amp-start{
from{visibility:hidden}to{visibility:visible}
}
</style>
<noscript>
<style amp-boilerplate>
body{animation:none}
</style>
</noscript>
The first bit is for browsers with javascript, but where the network is poor and can't load the minimal required highly cacheable javascript file within 8 seconds. It uses CSS just in case javascript really isn't working anyway such as being disabled per domain or something. The second bit is for browsers without javascript - the page is unblocked immediately.