File tree Expand file tree Collapse file tree 5 files changed +129
-0
lines changed
view-transitions/mpa-example-2 Expand file tree Collapse file tree 5 files changed +129
-0
lines changed Original file line number Diff line number Diff line change
1
+ @view-transition {
2
+ navigation : auto;
3
+ }
4
+
5
+ @keyframes slide-from-right {
6
+ from {
7
+ transform : translateX (100vw );
8
+ }
9
+
10
+ to {
11
+ transform : translateX (0 );
12
+ }
13
+ }
14
+
15
+ ::view-transition-old (root ),
16
+ ::view-transition-new (root ) {
17
+ mix-blend-mode : normal;
18
+ }
19
+
20
+ ::view-transition-old (root ) {
21
+ animation : none;
22
+ }
23
+
24
+ ::view-transition-new (root ) {
25
+ animation : slide-from-right 0.3s ;
26
+ }
Original file line number Diff line number Diff line change
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 > Cross-document view transition example 2: Page 2</ title >
7
+ < link rel ="stylesheet " href ="style.css " />
8
+ < link rel ="stylesheet " href ="hobbies.css " />
9
+ </ head >
10
+ < body class ="hobbies ">
11
+ < section >
12
+ < h1 > 🧶 My Hobbies</ h1 >
13
+ < p >
14
+ When I'm not busy napping, I love to play with yarn and chase laser
15
+ pointers. I'm also an avid bird watcher.
16
+ </ p >
17
+ < p >
18
+ Thank you for your interest!
19
+ You can return to the < a href ="index.html "> homepage</ a > now.
20
+ </ p >
21
+ </ section >
22
+ </ body >
23
+ </ html >
Original file line number Diff line number Diff line change
1
+ @view-transition {
2
+ navigation : auto;
3
+ }
4
+
5
+ @keyframes slide-to-right {
6
+ from {
7
+ transform : translateX (0 );
8
+ z-index : 2 ;
9
+ }
10
+
11
+ to {
12
+ transform : translateX (100vw );
13
+ z-index : 2 ;
14
+ }
15
+ }
16
+
17
+ ::view-transition-old (root ),
18
+ ::view-transition-new (root ) {
19
+ mix-blend-mode : normal;
20
+ }
21
+
22
+ ::view-transition-old (root ) {
23
+ animation : slide-to-right 0.3s ;
24
+ }
25
+
26
+ ::view-transition-new (root ) {
27
+ animation : none;
28
+ }
Original file line number Diff line number Diff line change
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 > Cross-document view transition example 2: Page 1</ title >
7
+ < link rel ="stylesheet " href ="index.css " />
8
+ < link rel ="stylesheet " href ="style.css " />
9
+ </ head >
10
+ < body class ="index ">
11
+ < section >
12
+ < h1 > 🏡 Homepage</ h1 >
13
+ < p >
14
+ Hello, my name is Mrs. Whiskers. Welcome to my personal website!
15
+ </ p >
16
+ < p >
17
+ < div >
18
+ Everyone needs a place on the web, even a cat.
19
+ </ div >
20
+ < div >
21
+ If you're curious, you can find out more about my < a href ="hobbies.html "> hobbies</ a > .
22
+ </ div >
23
+ </ p >
24
+ </ section >
25
+ </ body >
26
+ </ html >
Original file line number Diff line number Diff line change
1
+ * ,
2
+ * : before ,
3
+ * : after {
4
+ box-sizing : border-box;
5
+ }
6
+
7
+ body {
8
+ font-family : system-ui;
9
+ max-inline-size : 400px ;
10
+ padding : 20px ;
11
+ text-align : center;
12
+ margin : auto;
13
+ line-height : 1.5 ;
14
+
15
+ & .index {
16
+ background-color : oklch (0.9529 0.0444 332 );
17
+ }
18
+
19
+ & .hobbies {
20
+ background-color : oklch (0.9588 0.0617 184.24 );
21
+ }
22
+ }
23
+
24
+ a {
25
+ color : oklch (0.0867 0.0419 261.53 );
26
+ }
You can’t perform that action at this time.
0 commit comments