Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
905939c
Add view-transitions mpa-example-2 with slide animations
yashrajbharti Sep 17, 2025
c8f74e1
Update view-transitions/mpa-example-2/index.html
yashrajbharti Sep 18, 2025
d0a803b
Update view-transitions/mpa-example-2/index.html
yashrajbharti Sep 18, 2025
4801df2
Update view-transitions/mpa-example-2/page2.html
yashrajbharti Sep 18, 2025
e39c93c
file rename and animations keyframe in kebab case
yashrajbharti Sep 22, 2025
561b603
Format using Prettier
pepelsbey Sep 26, 2025
9e8a8ee
Update view-transitions/mpa-example-2/style.css
yashrajbharti Sep 26, 2025
0608bba
Update view-transitions/mpa-example-2/index.html
yashrajbharti Sep 26, 2025
a9cde7e
Update view-transitions/mpa-example-2/about.html
yashrajbharti Sep 26, 2025
c28d761
Update view-transitions/mpa-example-2/about.html
yashrajbharti Sep 26, 2025
641b729
Update view-transitions/mpa-example-2/about.html
yashrajbharti Sep 26, 2025
1084bb9
Update view-transitions/mpa-example-2/index.html
yashrajbharti Sep 26, 2025
32035f3
Rename files in mpa-example-2: about.html → hobbies.html, page1.css →…
yashrajbharti Sep 26, 2025
74f3092
Update view-transitions/mpa-example-2/hobbies.html
yashrajbharti Sep 29, 2025
1b9dc00
Update view-transitions/mpa-example-2/index.html
yashrajbharti Sep 29, 2025
eb96586
Update view-transitions/mpa-example-2/hobbies.html
yashrajbharti Sep 29, 2025
e84c939
Update view-transitions/mpa-example-2/index.html
yashrajbharti Sep 29, 2025
89471b8
Update view-transitions/mpa-example-2/hobbies.html
yashrajbharti Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions view-transitions/mpa-example-2/hobbies.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@view-transition {
navigation: auto;
}

@keyframes slide-from-right {
from {
transform: translateX(100vw);
}

to {
transform: translateX(0);
}
}

::view-transition-old(root),
::view-transition-new(root) {
mix-blend-mode: normal;
}

::view-transition-old(root) {
animation: none;
}

::view-transition-new(root) {
animation: slide-from-right 0.3s;
}
23 changes: 23 additions & 0 deletions view-transitions/mpa-example-2/hobbies.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Cross-document view transition example 2: Page 2</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="hobbies.css" />
</head>
<body class="hobbies">
<section>
<h1>🧶 My Hobbies</h1>
<p>
When I'm not busy napping, I love to play with yarn and chase laser
pointers. I'm also an avid bird watcher.
</p>
<p>
Thank you for your interest!
You can return to the <a href="index.html">homepage</a> now.
</p>
</section>
</body>
</html>
28 changes: 28 additions & 0 deletions view-transitions/mpa-example-2/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@view-transition {
navigation: auto;
}

@keyframes slide-to-right {
from {
transform: translateX(0);
z-index: 2;
}

to {
transform: translateX(100vw);
z-index: 2;
}
}

::view-transition-old(root),
::view-transition-new(root) {
mix-blend-mode: normal;
}

::view-transition-old(root) {
animation: slide-to-right 0.3s;
}

::view-transition-new(root) {
animation: none;
}
26 changes: 26 additions & 0 deletions view-transitions/mpa-example-2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Cross-document view transition example 2: Page 1</title>
<link rel="stylesheet" href="index.css" />
<link rel="stylesheet" href="style.css" />
</head>
<body class="index">
<section>
<h1>🏡 Homepage</h1>
<p>
Hello, my name is Mrs. Whiskers. Welcome to my personal website!
</p>
<p>
<div>
Everyone needs a place on the web, even a cat.
</div>
<div>
If you're curious, you can find out more about my <a href="hobbies.html">hobbies</a>.
</div>
</p>
</section>
</body>
</html>
26 changes: 26 additions & 0 deletions view-transitions/mpa-example-2/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*,
*:before,
*:after {
box-sizing: border-box;
}

body {
font-family: system-ui;
max-inline-size: 400px;
padding: 20px;
text-align: center;
margin: auto;
line-height: 1.5;

&.index {
background-color: oklch(0.9529 0.0444 332);
}

&.hobbies {
background-color: oklch(0.9588 0.0617 184.24);
}
}

a {
color: oklch(0.0867 0.0419 261.53);
}