• Stars
    star
    223
  • Rank 178,458 (Top 4 %)
  • Language Astro
  • License
    MIT License
  • Created over 1 year ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Astro starter powered by MPA view transitions

Morphull - Astro Starter Kit

A morphing or full page transition enabled slide creation starter kit that uses View Transitions to do all the work.

Until View Transitions are supported across all browsers, this API and starter kit only works in Chrome Canary with chrome://flags/#view-transition-on-navigation enabled.

๐Ÿš€ Project Structure

Inside the /pages folder you create your slides, each slide is it's own Astro component that uses the /src/layouts/Slide.astro layout.

There's one component called Controls.astro that handles making and placing the next arrow.

How to get morphing slide pages

It's all generally handled for you! Just use <h1> elements, or images or links. Inside the /src/styles/transitions.css you'll find the unique names given to the elements that tells the browser which shared elements should morph. Like if you have a code snippet on one page, and the next page also has one, the browser will transition between those snippets.

Enabling page transitions

Full page transitions can be enabled on a per slide basis, by simply passing animation="page" as a property to the Layout / Slide component. This will on the other hand will automatically disable slide page morphing.

Writing custom page transitions

To write custom page transitions, you can simply hook into the functionality already provided by morphull. Currently, there are two data attributes that are written to the <html> when the page is initialized that form the basis for all animations.

Attribute Values Description
data-view-transition-direction 'forward', 'back', 'reload' The direction of navigation. Reload means that a page refresh is initiated.
data-view-transition 'page', 'element', Custom Default: 'element'.
Animation identifier used within CSS

With the help of these attributes and open-props custom page transitions can be written as easy as:

  html:not([data-view-transition-direction="reload"])[data-view-transition="slide"] {
    &::view-transition-new(root) {
      animation: var(--animation-slide-in-left) forwards;
    }

    &::view-transition-old(root) {
      animation: var(--animation-slide-out-left) forwards;
    }

    &[data-view-transition-direction="back"] {
      &::view-transition-new(root) {
        animation: var(--animation-slide-in-right) forwards;
      }

      &::view-transition-old(root) {
        animation: var(--animation-slide-out-right) forwards;
      }
    }
  }

In particular, we use :not([data-view-transition-direction="reload"]) in this example to prevent transitions from being replayed on page refresh. There is currently an ongoing discussion about this behavior right here. A working example identical to the code above can be found in src/pages/example-3.astro.

More Repositories

1

open-props

CSS custom properties to help accelerate adaptive and consistent design.
HTML
4,744
star
2

gui-challenges

Components from the YouTube show GUI Challenges: accessible, responsive, adaptive and cross browser components.
HTML
2,781
star
3

transition.css

:octocat: Drop-in CSS transitions
CSS
1,831
star
4

ragrid

:octocat: Intrinsic first auto-layout flexbox grid
CSS
252
star
5

blingblingjs

๐Ÿ’ฒ Micro-library of shorthands for DOM selection, events, and attribute manipulation
JavaScript
232
star
6

conic.css

nice'n simple conic gradients ๐ŸŽจ
JavaScript
209
star
7

shortstack

๐Ÿฅž minimal Rollup + PostCSS modern syntax starter template
JavaScript
168
star
8

roving-ux

stateful roving index for web ui
JavaScript
129
star
9

scrollyfills

grab and go polyfill functions for web scroll features
JavaScript
102
star
10

ScrollSnapExplainers

89
star
11

slyd

Snappy, responsive, touch optimized, bi-directional presentation framework
CSS
73
star
12

twop

tailwind += open props
TypeScript
51
star
13

vite-postcss-preset-env

HTML
41
star
14

Kung-Fury-Theme

80's dark retro theme for VS Code and Sublime Text
35
star
15

Bolt

โšก is a fast grunt based, data driven, static site seed project, for rapid web development of PWA's or JAMstack projects
HTML
34
star
16

2022-css-day_oh-snap

Astro
28
star
17

Google-IO-2021-Workshop_User-Adaptive-Interfaces

HTML
27
star
18

chat-ui

๐Ÿ’ฌ rich message handling chat interface for bot projects
JavaScript
19
star
19

snowpack-template-preset-env

babel and postcss at latest with browserlist powered preset-env
JavaScript
18
star
20

slyd-starter

clone and go Slyd starter kit
HTML
17
star
21

css-at-cds

links to demo's and docs from our talk at Chrome Dev Summit 2019
HTML
15
star
22

scrollend-explainer

12
star
23

argyleink

11
star
24

houdini-tabs

WIP: scroll-snap-points + ScrollTimeline + Houdini AnimationWorklet
JavaScript
11
star
25

css-n-js

JavaScript
10
star
26

houdini-static-gradient

a houdini paint worklet with a retro static gradient effect
JavaScript
9
star
27

HTML5-ClearUI

Node, Mongo, Zepto, HTML5
JavaScript
8
star
28

Android-Webapp-Boilerplate

The project code needed to make a single webview android app
7
star
29

coinsafe

PWototype demo for JScamp 2019 presentation
HTML
6
star
30

london-css-2020

CSS ๐ŸŽ‰
HTML
5
star
31

jscamp

talk for JScamp 2019 in Barcelona
HTML
5
star
32

NintendoSwitch.tmTheme

๐ŸŽฎ dark theme with bubble gum code highlighting and subdued machine characters for optimal dev focus and nostalgia
4
star
33

JS-Web-App-Starter

Vagrant/Nginx/Express/MySQL/Grunt/Jade/Stylus
CSS
4
star
34

app-img

<app-image> a lazy image loading custom element for considerate user experiences
HTML
4
star
35

Node--Express--and-Socket.io-Starter-Kit

Get started right way with a socket node app. I made this for me, but you can use it too!
JavaScript
4
star
36

iOS-Webview-Boilerplate

Objective-C
3
star
37

browserify-babel

Quickstart for playing with ES6 Babel and Browserify
JavaScript
2
star
38

prefers-reduced-data-explainer

2
star
39

surfin

JavaScript
2
star
40

RxState

๐Ÿ’Š Turn any object or array into a reactive store
JavaScript
2
star
41

2021-csscamp-css-color

HTML
2
star
42

Leap-Motion---Finger-Tracking

JavaScript gesture and pointer following mechanism with CSS
JavaScript
1
star
43

DieAntsDie

ActionScript 3.0 port to Lua
Lua
1
star
44

csscamp

HTML
1
star
45

Greensock-Touch-Carousel

JavaScript
1
star
46

jack

repo for local wordpress build
PHP
1
star
47

N-Gon

Virtualized infinite sided cube, touch enabled bi-directional rotation
JavaScript
1
star
48

adobe-dreamweaver-fun-cs6-demo

JavaScript
1
star
49

hd-color-bugs

a stash of issues and bugs found while using new HD color functions in CSS
1
star
50

jQuery-Mobile-Ratio-Boilerplate

JavaScript
1
star
51

Android-Full-Screen-Webview-Seed

Use this for a quick android project that points to your dev environment
Java
1
star
52

affilicats

๐Ÿˆ Progressive Web App demo that showcases flaky network resilience measures (๐Ÿ“ถ or ๐Ÿšซ๐Ÿ“ถ).
JavaScript
1
star
53

parcel-cssNext-esNext

โšก๏ธ Hot load CSS and JS with no state loss, build a site with the powers of Jade
CSS
1
star
54

Parallax-JS

Sideways! Parallax page generator from simple HTML & CSS
JavaScript
1
star
55

bash_profile

Shell
1
star
56

jade-cssnext-babel-webpacked

โšก๏ธ Build a multipage site with Jade and Webpack, where each page is created from a bundle entry file
HTML
1
star