update
This commit is contained in:
parent
e30de7d675
commit
31029a9aef
8 changed files with 114 additions and 2 deletions
4
index.ts
4
index.ts
|
@ -1,2 +1,2 @@
|
|||
// export { default as Card } from "./src/Card.astro"
|
||||
// export { default as Header } from "./src/Header.astro"
|
||||
export { default as Dialog } from "./src/Dialog.astro"
|
||||
export { default as VideoItem } from "./src/VideoItem.astro"
|
40
src/Dialog.astro
Normal file
40
src/Dialog.astro
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
// Properties
|
||||
const {
|
||||
Name,
|
||||
Title = 'Dialog Title',
|
||||
Description = 'Description',
|
||||
CloseButton = true,
|
||||
QuestionTooltip = false, // Requires Astro Tooltip: https://code.juliancataldo.com/component/astro-tooltips/#installation
|
||||
Actions = false,
|
||||
BlurryBackdrop = true
|
||||
} = Astro.props
|
||||
---
|
||||
|
||||
<div id={Name} class="fl-dialog-backdrop"></div>
|
||||
<div id={Name} class="fl-dialog">
|
||||
<div class="fl-dialog-header">
|
||||
<div class="fl-dialog-header-start">
|
||||
<h2>{Title}</h2>
|
||||
<p>{Description}</p>
|
||||
</div>
|
||||
<div class="fl-dialog-header-end">
|
||||
{QuestionTooltip ?
|
||||
<button title={QuestionTooltip}><svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#000000"><path d="M7.90039 8.07954C7.90039 3.30678 15.4004 3.30682 15.4004 8.07955C15.4004 11.4886 11.9913 10.8067 11.9913 14.8976" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 19.01L12.01 18.9989" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button>
|
||||
:
|
||||
null
|
||||
}
|
||||
{CloseButton ? <button><svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#000000"><path d="M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> : null}
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl-dialog-content">
|
||||
<slot/>
|
||||
</div>
|
||||
{Actions ?
|
||||
<div class="fl-dialog-actions">
|
||||
<slot name="actions"/>
|
||||
</div>
|
||||
:
|
||||
null
|
||||
}
|
||||
</div>
|
31
src/VideoItem.astro
Normal file
31
src/VideoItem.astro
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
// Properties
|
||||
const {
|
||||
VideoId,
|
||||
CreatorId,
|
||||
Title,
|
||||
Thumbnail,
|
||||
Date,
|
||||
Views,
|
||||
Length,
|
||||
Platform
|
||||
} = Astro.props
|
||||
|
||||
// Components
|
||||
import { Image } from 'astro:assets';
|
||||
---
|
||||
|
||||
<a href={"/watch?=" + VideoId} class="fl-vi">
|
||||
<div class="fl-vi-thumbnail">
|
||||
<Image src={Thumbnail} alt={'Thumbnail'} loading="lazy" format="webp"/>
|
||||
<p>{Platform}</p>
|
||||
<p>{Length}</p>
|
||||
</div>
|
||||
<div class="fl-vi-content">
|
||||
<Image src={CreatorId} alt={'Creator Avatar'} loading="lazy" format="webp"/>
|
||||
<div>
|
||||
<p><strong>{Title}</strong></p>
|
||||
<p>{Date} - {Views}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
4
test/astro.config.mjs
Normal file
4
test/astro.config.mjs
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({});
|
17
test/package.json
Normal file
17
test/package.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "test",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"build": "astro check && astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.2",
|
||||
"@astrojs/check": "^0.9.2",
|
||||
"typescript": "^5.5.4"
|
||||
}
|
||||
}
|
1
test/src/env.d.ts
vendored
Normal file
1
test/src/env.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference path="../.astro/types.d.ts" />
|
16
test/src/pages/index.astro
Normal file
16
test/src/pages/index.astro
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>Astro</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Astro</h1>
|
||||
</body>
|
||||
</html>
|
3
test/tsconfig.json
Normal file
3
test/tsconfig.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/strict"
|
||||
}
|
Loading…
Reference in a new issue