Skip to content

Commit

Permalink
Crossing (#180)
Browse files Browse the repository at this point in the history
* element crossing

* dependencies

* prepare for release

* formatting
  • Loading branch information
martrapp authored Sep 5, 2024
1 parent 3860acc commit 58cd5a1
Show file tree
Hide file tree
Showing 6 changed files with 2,219 additions and 1,692 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-balloons-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro-vtbot': minor
---

Integrates `@vtbag/element-crossing` to transfer selected HTML state to the next page on CSS-only cross-deocument view transitions
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ A current deployment of tech demos and the documentation can be found at https:/

## !!! NEW TRICKS ✨ IN THE BAG 👜 !!!

None. This version includes minor enhancements to stabilize existing features. For details, see the [CHANGELOG](https://github.com/martrapp/astro-vtbot/blob/main/CHANGELOG.md)
This release integrates `@vtbag/element-crossing` as `<ElementCrossing/>` This is a component for those of you who experiment with CSS-only cross-document view transitions and miss a way to preserve state of HTML elements across navigation: Transfer selected element state to the other side!

For details, see the [CHANGELOG](https://github.com/martrapp/astro-vtbot/blob/main/CHANGELOG.md)

## Recently Learned Tricks ##

Expand Down
12 changes: 12 additions & 0 deletions components/ElementCrossing.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
export interface Props {
experimentalFeatures?: boolean;
}
import crossingURL from '@vtbag/element-crossing?url';
import experimentalURL from '@vtbag/element-crossing/experimental?url';
const { experimentalFeatures = false } = Astro.props;
console.log(`"${experimentalFeatures}":${typeof experimentalFeatures}`);
---

{experimentalFeatures && <script is:inline data-astro-rerun src={experimentalURL} />}
<script is:inline data-astro-rerun src={crossingURL}></script>
1 change: 1 addition & 0 deletions components/ElementCrossing.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function ElementCrossing(_props: import('./ElementCrossing.astro').Props): any;
Loading

0 comments on commit 58cd5a1

Please sign in to comment.