Skip to content

Commit 1a7ea6b

Browse files
committed
transition
1 parent 346bef5 commit 1a7ea6b

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

elements/clean-portfolio-theme/clean-portfolio-theme.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class CleanPortfolioTheme extends DDDSuper(HAXCMSLitElementTheme) {
4444
this.copyrightYear = 0; // for footer copyright year
4545

4646
// MobX variables/listeners
47-
this.location = null;
4847
this.categoryTags = [];
4948
this.allTags = [];
5049
this.items = [];
@@ -80,18 +79,6 @@ export class CleanPortfolioTheme extends DDDSuper(HAXCMSLitElementTheme) {
8079
}
8180
this.__disposer.push(reaction);
8281
});
83-
84-
autorun(() => {
85-
let location = toJS(store.location);
86-
if (globalThis.document && globalThis.document.startViewTransition) {
87-
globalThis.document.startViewTransition(() => {
88-
this.location = location;
89-
});
90-
}
91-
else {
92-
this.location = location;
93-
}
94-
});
9582

9683
// determines active layout based on following conditions:
9784
// - if the current page has no child, it's Text
@@ -262,7 +249,6 @@ export class CleanPortfolioTheme extends DDDSuper(HAXCMSLitElementTheme) {
262249
activeItem: { type: Object },
263250
activeParent: { type: Object },
264251
ancestorItem: { type: Object },
265-
location: { type: Object },
266252
topItems: { type: Array },
267253
items: { type: Array },
268254
activeTags: { type: Array },
@@ -731,6 +717,7 @@ export class CleanPortfolioTheme extends DDDSuper(HAXCMSLitElementTheme) {
731717
flex-wrap: wrap;
732718
gap: 12px;
733719
margin-bottom: 20px;
720+
view-transition-name: location;
734721
}
735722
736723
#listing-select {
@@ -756,6 +743,7 @@ export class CleanPortfolioTheme extends DDDSuper(HAXCMSLitElementTheme) {
756743
display: grid;
757744
gap: 24px;
758745
width: 100%;
746+
view-transition-name: location;
759747
grid-template-columns: repeat(4, 1fr);
760748
}
761749

elements/haxcms-elements/demo/site.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"tags": ""
3333
},
3434
"theme": {
35-
"element": "journey-theme",
35+
"element": "clean-portfolio-theme",
3636
"path": "@haxtheweb/journey-theme/journey-theme.js",
3737
"name": "Polaris - Invent",
3838
"thumbnail": "build/es6/node_modules/@haxtheweb/app-hax/lib/assets/images/PartyStyle.svg",

0 commit comments

Comments
 (0)