CSS transition... portal.addEventListener('transitionend', evt => { // check if it's the right transition // you want to trigger activation if (evt.propertyName == 'transform') { // Activate the portal portal.activate(); } });
to the portalactivate event // Retrieve the previous page as a <portal> // - The JavaScript state // - UI state // are all saved const portal = evt.adoptPredecessor(); // Append the <portal> to the document document.body.append(portal); } window.addEventListener('portalactivate', evt => {
the portalactivate event window.addEventListener('portalactivate', evt => { // Retrieve the previous page as a <portal> // - The JavaScript state // - UI state // are all saved // Append the <portal> to the document document.body.append(portal); } const portal = evt.adoptPredecessor();
to the portalactivate event window.addEventListener('portalactivate', evt => { // Retrieve the previous page as a <portal> // - The JavaScript state // - UI state // are all saved const portal = evt.adoptPredecessor(); // Append the <portal> to the document }); document.body.append(portal);
on scroll gabungkan dengan Intersection Observer. ◎ Lebih baik memanfaatkan <portal> untuk interaksi user yang kuat seperti click. ◎ Menggunakan skeleton page saat loading content pertama kali. 41
on scroll gabungkan dengan Intersection Observer. ◎ Memanfaatkan <portal> untuk interaksi yang kuat seperti click. ◎ Menggunakan skeleton page saat loading keseluruhan content. 42