Skip to content

Commit

Permalink
🥅
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Apr 16, 2023
1 parent 0de7333 commit 2d392e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 4 additions & 6 deletions examples/anime-adventure/src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
export const getActions = (host: string) => [
{
id: 0,
id: '0',
actionUrl: `https://${host}/actions/${0}`,
imageUrl:
'https://artworks.thetvdb.com/banners/fanart/original/5d8e636ab0d05.jpg',
imageUrl: 'https://storage.googleapis.com/saasify-assets/c0.jpg',
name: 'Go on a crazy adventure with Ed',
description:
'Take a trip with Ed and Ein on a motorycle and a desert planet. Make the story super zany and fun.'
},
{
id: 1,
id: '1',
actionUrl: `https://${host}/actions/${1}`,
imageUrl:
'https://artworks.thetvdb.com/banners/fanart/original/76885-19.jpg',
imageUrl: 'https://storage.googleapis.com/saasify-assets/c1.jpg',
name: 'Visit a bar with Jet',
description:
'Visit a dive bar with Jet in the underbelly of a distant planet. Make the story dark and gritty.'
Expand Down
8 changes: 7 additions & 1 deletion examples/anime-adventure/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ router.get(
'/actions/:id',
(request: Request, env: any, _ctx, data: Record<string, any>) => {
const host = request.headers.get('host')
const id = data.id
const id = request.url.split('/').pop()

// const id = data.id
const actions = getActions(host)
const action = actions.find((a) => a.id === id)
if (!action) {
Expand Down Expand Up @@ -78,6 +80,10 @@ router.get(
align-items: center;
min-height: 100vh;
}
img {
width: 100%;
max-width: 800px;
}
</style>
</head>
Expand Down

0 comments on commit 2d392e1

Please sign in to comment.