We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70dd08f commit 6e649ceCopy full SHA for 6e649ce
1 file changed
src/layouts/Layout.astro
@@ -45,13 +45,17 @@ const currentPath = Astro.url.pathname;
45
</div>
46
47
<script>
48
- document.addEventListener('DOMContentLoaded', () => {
+ const initPage = () => {
49
document.body.style.opacity = '0';
50
document.body.style.transition = 'opacity 150ms ease-out';
51
52
requestAnimationFrame(() => {
53
document.body.style.opacity = '1';
54
});
55
+ };
56
+
57
+ document.addEventListener('DOMContentLoaded', () => {
58
+ initPage();
59
60
const links = document.querySelectorAll('a[href^="/"], a[href^="./"], a[href^="../"]');
61
@@ -77,6 +81,12 @@ const currentPath = Astro.url.pathname;
77
81
78
82
79
83
84
85
+ window.addEventListener('pageshow', (event) => {
86
+ if (event.persisted) {
87
88
+ }
89
+ });
80
90
</script>
91
</body>
92
</html>
0 commit comments