├── .gitignore ├── .npmrc ├── .vscode ├── extensions.json └── launch.json ├── README.md ├── astro.config.mjs ├── babel.config.json ├── netlify.toml ├── package-lock.json ├── package.json ├── public ├── covers │ ├── first-impressions-of-earth.jpg │ └── hot-fuss.jpg ├── favicon.svg ├── logomark-light.svg ├── mp3 │ ├── song1.mp3 │ ├── song2.mp3 │ ├── song3.mp3 │ └── song4.mp3 └── vynil-lp.webp ├── screenshot.png ├── src ├── components │ ├── Card.astro │ ├── Footer.astro │ ├── Header.astro │ ├── PlayButton.tsx │ ├── Player.tsx │ ├── Record.tsx │ ├── TrackList.tsx │ └── state.ts ├── env.d.ts ├── layouts │ └── Layout.astro ├── pages │ ├── album │ │ └── [id].astro │ └── index.astro └── styles │ └── transitions.css ├── tailwind.config.cjs └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | .output/ 4 | 5 | # dependencies 6 | node_modules/ 7 | 8 | # logs 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | pnpm-debug.log* 13 | 14 | 15 | # environment variables 16 | .env 17 | .env.production 18 | 19 | # macOS-specific files 20 | .DS_Store 21 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Expose Astro dependencies for `pnpm` users 2 | shamefully-hoist=true 3 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Astro View Transitions + Persistent Island Demo 2 | 3 | ### 👉🏽 [Live Demo](https://astro-records.pages.dev/) 4 | 5 |  6 | 7 | ## 🚀 Getting Started 8 | 9 | 1. Clone this repository and install dependencies with `npm install`. 10 | 2. Start the project locally with npm run dev, or deploy it to your favorite server. 11 | 3. Have fun! ✨ 12 | 13 | ## 🧞 Commands 14 | 15 | All commands are run from the root of the project, from a terminal: 16 | 17 | | Command | Action | 18 | | :--------------------- | :----------------------------------------------- | 19 | | `npm install` | Installs dependencies | 20 | | `npm run dev` | Starts local dev server at `localhost:3000` | 21 | | `npm run build` | Build your production site to `./dist/` | 22 | | `npm run preview` | Preview your build locally, before deploying | 23 | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | 24 | | `npm run astro --help` | Get help using the Astro CLI | 25 | 26 | ## 👀 Want to learn more? 27 | 28 | Check out [Astro's documentation](https://docs.astro.build) or jump into their [Discord server](https://astro.build/chat). 29 | 30 | You can also reach out to [Maxi on Twitter](https://twitter.com/charca). 31 | -------------------------------------------------------------------------------- /astro.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'astro/config' 2 | import tailwind from '@astrojs/tailwind' 3 | import preact from '@astrojs/preact' 4 | 5 | import cloudflare from '@astrojs/cloudflare' 6 | 7 | // https://astro.build/config 8 | export default defineConfig({ 9 | integrations: [tailwind(), preact()], 10 | output: 'server', 11 | adapter: cloudflare(), 12 | }) 13 | -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@babel/plugin-transform-react-jsx-source"] 3 | } 4 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [[redirects]] 2 | from = "/*" 3 | to = "https://astro-records.pages.dev/:splat" 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/basics", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "dev": "astro dev", 8 | "start": "astro dev", 9 | "build": "astro build", 10 | "preview": "astro preview", 11 | "astro": "astro" 12 | }, 13 | "dependencies": { 14 | "@astrojs/cloudflare": "^7.0.1", 15 | "@astrojs/preact": "^3.0.0", 16 | "@astrojs/tailwind": "^5.0.0", 17 | "@preact/signals": "^1.2.1", 18 | "astro": "^3.0.7", 19 | "preact": "^10.17.1", 20 | "tailwindcss": "^3.3.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /public/covers/first-impressions-of-earth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/covers/first-impressions-of-earth.jpg -------------------------------------------------------------------------------- /public/covers/hot-fuss.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/covers/hot-fuss.jpg -------------------------------------------------------------------------------- /public/favicon.svg: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /public/logomark-light.svg: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /public/mp3/song1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/mp3/song1.mp3 -------------------------------------------------------------------------------- /public/mp3/song2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/mp3/song2.mp3 -------------------------------------------------------------------------------- /public/mp3/song3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/mp3/song3.mp3 -------------------------------------------------------------------------------- /public/mp3/song4.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/mp3/song4.mp3 -------------------------------------------------------------------------------- /public/vynil-lp.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/public/vynil-lp.webp -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Charca/astro-records/71516db25608f8500e6df7e2453054bb66d48a56/screenshot.png -------------------------------------------------------------------------------- /src/components/Card.astro: -------------------------------------------------------------------------------- 1 | --- 2 | type Props = { 3 | id: string 4 | name: string 5 | artist: string 6 | image_url: string 7 | } 8 | 9 | const { id, name, artist, image_url } = Astro.props 10 | --- 11 | 12 |
40 | -------------------------------------------------------------------------------- /src/components/Footer.astro: -------------------------------------------------------------------------------- 1 | 32 | -------------------------------------------------------------------------------- /src/components/Header.astro: -------------------------------------------------------------------------------- 1 | 69 | -------------------------------------------------------------------------------- /src/components/PlayButton.tsx: -------------------------------------------------------------------------------- 1 | import { currentTrack, isPlaying, type Track } from './state' 2 | 3 | type Props = { 4 | tracks: Track[] 5 | albumId: string 6 | albumName: string 7 | artist: string 8 | imageUrl: string 9 | } 10 | 11 | export default function PlayButton({ 12 | tracks, 13 | albumId, 14 | albumName, 15 | artist, 16 | imageUrl, 17 | }: Props) { 18 | return ( 19 | 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /src/components/Player.tsx: -------------------------------------------------------------------------------- 1 | import { currentTrack, isPlaying } from './state' 2 | 3 | import { useEffect, useState, useRef } from 'preact/hooks' 4 | 5 | const PlayIcon = ( 6 | 20 | ) 21 | 22 | const PauseIcon = ( 23 | 37 | ) 38 | 39 | // This app doesn't have real songs, it only has a few songs 40 | // that we will play over and over as the user uses the app. 41 | const MAX_SONGS = 4 42 | 43 | export default function Player() { 44 | const audioPlayer = useRef