| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 |
<title>Animation duration: native</title> |
| 7 |
<link rel="stylesheet" href="/assets/main.css"> |
| 8 |
<script src="/dist/Swup.umd.js"></script> |
| 9 |
<style> |
| 10 |
html.is-changing .transition-custom { |
| 11 |
view-transition-name: main; |
| 12 |
} |
| 13 |
|
| 14 |
::view-transition-old(main) { |
| 15 |
animation: 0.5s ease-in-out both page-animation; |
| 16 |
} |
| 17 |
|
| 18 |
::view-transition-new(main) { |
| 19 |
animation: 0.5s ease-in-out both reverse page-animation; |
| 20 |
} |
| 21 |
|
| 22 |
@keyframes page-animation { |
| 23 |
from { opacity: 1; } |
| 24 |
to { opacity: 0; } |
| 25 |
} |
| 26 |
|
| 27 |
html.is-changing:not(.swup-native) .transition-custom { |
| 28 |
transition: 0.4s opacity; |
| 29 |
opacity: 1; |
| 30 |
} |
| 31 |
html.is-animating:not(.swup-native) .transition-custom { |
| 32 |
opacity: 0; |
| 33 |
} |
| 34 |
</style> |
| 35 |
</head> |
| 36 |
<body> |
| 37 |
<header class="header"> |
| 38 |
<ul> |
| 39 |
<li><a href="/animation-duration.html">Duration</a></li> |
| 40 |
<li><a href="/animation-complex.html">Complex</a></li> |
| 41 |
<li><a href="/animation-keyframes.html">Keyframes</a></li> |
| 42 |
<li><a href="/animation-native.html">Native</a></li> |
| 43 |
<li><a href="/animation-partial.html">Partial</a></li> |
| 44 |
<li><a href="/animation-none.html">None</a></li> |
| 45 |
</ul> |
| 46 |
</header> |
| 47 |
<main id="swup" class="wrapper transition-custom"> |
| 48 |
<h1>Animation duration: native</h1> |
| 49 |
</main> |
| 50 |
<script> |
| 51 |
window._swup = new Swup({ native: true }); |
| 52 |
</script> |
| 53 |
</body> |
| 54 |
</html> |