Skip to content

Commit

Permalink
Merge branch '0.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekobato committed May 2, 2024
2 parents 03113c6 + 71cbb67 commit a904ecd
Show file tree
Hide file tree
Showing 37 changed files with 2,304 additions and 32,674 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vitepress/cache
12 changes: 0 additions & 12 deletions docs/.npmignore

This file was deleted.

19 changes: 19 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from "vitepress";
import path from "node:path";
import vueJsx from "@vitejs/plugin-vue-jsx";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Davneko",
description: "Home Audio Server",
vite: {
resolve: {
alias: {
"@shared": path.join(__dirname, "../../shared"),
"@": path.join(__dirname, "../../src"),
},
},
// @ts-ignore
plugins: [vueJsx()],
},
});
24 changes: 24 additions & 0 deletions docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
import { useData } from "vitepress";
// https://vitepress.dev/reference/runtime-api#usedata
const { site, frontmatter } = useData();
</script>

<template>
<div v-if="frontmatter.home">
<h1>{{ site.title }}</h1>
<p>{{ site.description }}</p>
</div>
<div class="contents" v-else>
<Content />
</div>
</template>

<style scoped>
.contents {
background: var(--color-background);
min-height: 100%;
padding: 40px;
}
</style>
11 changes: 11 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Layout from "./Layout.vue";
import type { Theme } from "vitepress";
import "./style.css";
import "../../../src/assets/styles/index.scss";

export default {
Layout,
enhanceApp({ app, router, siteData }) {
// ...
},
} satisfies Theme;
Empty file added docs/.vitepress/theme/style.css
Empty file.
63 changes: 63 additions & 0 deletions docs/components/Box.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<script lang="ts" setup>
import { computed, defineProps } from "vue";
const props = defineProps({
title: {
type: String,
},
width: {
type: String,
required: false,
default: "400px",
},
height: {
type: String,
required: false,
default: "auto",
},
});
const style = computed(() => ({
width: props.width,
height: props.height,
}));
</script>

<template>
<div class="box" :style="style">
<span class="title">{{ props.title }}</span>
<slot />
</div>
</template>

<style scoped>
.box {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin-top: 40px;
padding: 12px;
background-image: linear-gradient(
45deg,
transparent 25%,
rgba(255, 255, 255, 0.03) 25%,
rgba(255, 255, 255, 0.03) 50%,
transparent 50%,
transparent 75%,
rgba(255, 255, 255, 0.03) 75%,
rgba(255, 255, 255, 0.03) 100%
);
background-size: 28.28px 28.28px;
border: 1px solid rgba(127, 127, 127, 0.5);
border-radius: 8px;
}
.title {
position: absolute;
top: -24px;
left: 0;
font-weight: bold;
font-size: 16px;
}
</style>
133 changes: 133 additions & 0 deletions docs/components/misskey/mfm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<script setup>
import Box from '../Box.vue'
import Mfm from '../../../src/components/misskey/Mfm.vue'

const text = 'Hello, **world**!'
const bold = '**Bold Text**'
const italic = '<i>斜め</i>'
const strike = '~~打ち消し~~'
const inlineCode = '`inline code`'
const codeBlock = `\`\`\`\ncode block\n\`\`\``
const link = 'https://example.com'
const center = '<center>\nCenter\n</center>'

const background = '$[fg.color=f00 赤字]\n$[bg.color=ff0 黄背景]'
const spin = `$[spin 🍮]$[spin.left 🍮]$[spin.alternate 🍮]\n$[spin.x 🍮]$[spin.x,left 🍮]$[spin.x,alternate 🍮]\n$[spin.y 🍮]$[spin.y,left 🍮]$[spin.y,alternate 🍮]\n$[spin.speed=5s 🍮]`
const plain = '<plain>$[x2 plain text]</plain>'
</script>

# Mfm

## Default

<Box>
<Mfm :text="text" />
</Box>

<Box>
<Mfm :text="bold" />
</Box>

<Box>
<Mfm :text="italic" />
</Box>

<Box>
<Mfm :text="strike" />
</Box>

<Box>
<Mfm :text="inlineCode" />
</Box>

<Box>
<Mfm :text="codeBlock" />
</Box>

<Box>
<Mfm :text="link" />
</Box>

<Box>
<Mfm :text="center" />
</Box>

<Box>
<Mfm text="misskey 検索" host="https://misskey.io" />
</Box>

<Box>
<Mfm text="プリンはmisskey開発者の好物<small>だった気がする…</small>" />
</Box>

<Box>
<Mfm :text="background" />
</Box>

<Box>
<Mfm text="もりもり$[blur あ]んこ" />
</Box>

<Box>
<Mfm text="$[font.cursive MisskeyでFediverseの世界が広がります]" />
</Box>

<Box>
<Mfm text="$[flip MisskeyでFediverseの世界が広がります]" />
</Box>

<Box>
<Mfm text="$[rotate.deg=30 misskey]" />
</Box>

<Box>
<Mfm text="$[unixtime 1700000000]" />
</Box>

<Box>
<Mfm text="$[ruby Misskey ミスキー]" />
</Box>

<Box>
<Mfm text="$[position.x=10,y=10 位置変更]" />
</Box>

<Box>
<Mfm text="$[scale.x=2,y=2 拡大]" />
</Box>

<Box>
<Mfm text="$[x2 x2] $[x3 x3] $[x4 x4]" />
</Box>

<Box>
<Mfm text="$[tada 🍮] $[tada.speed=5s 🍮]" />
</Box>

<Box>
<Mfm text="$[jump 🍮] $[jump.speed=5s 🍮]" />
</Box>

<Box>
<Mfm :text="spin" />
</Box>

<Box>
<Mfm text="$[shake 🍮] $[shake.speed=5s 🍮]" />
</Box>

<Box>
<Mfm text="$[twitch 🍮] $[twitch.speed=5s 🍮]" />
</Box>

<Box>
<Mfm text="$[rainbow $[fg.color=f0f 色付き文字]]" />
</Box>

<Box>
<Mfm text="$[sparkle 🍮]" />
</Box>

<Box>
<Mfm :text="plain" />
</Box>
98 changes: 98 additions & 0 deletions docs/components/misskey/note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<script setup lang="ts">
import Box from '../Box.vue'
import MisskeyNote from '../../../src/components/MisskeyNote.vue'
import PostList from '../../../src/components/PostList.vue'

const text =
"Misskeyはフリーかつオープンなプロジェクトで、誰でも自由にMisskeyを使ったサーバーを作成できるため、既に様々なサーバーがインターネット上に公開されています。また重要な特徴として、MisskeyはActivityPubと呼ばれる分散通信プロトコルを実装しているので、どのサーバーを選んでも他のサーバーのユーザーとやりとりすることができます。これが分散型と言われる所以で、単一の運営者によって単一のURLで公開されるような、Twitterなどの他サービスとは根本的に異なっています。サーバーによって主な話題のテーマやユーザー層、言語などは異なり、自分にあったサーバーを探すのも楽しみのひとつです(もちろん自分のサーバーを作るのも一興です)。";

const note = {
id: "1",
createdAt: "2021-07-01T00:00:00.000Z",
text: text,
user: {
id: "1",
name: "User Name",
username: "user",
avatarUrl: "https://picsum.photos/128",
host: null,
avatarBlurhash: null,
avatarDecorations: [],
emojis: {},
onlineStatus: "active",
},
emojis: {},
files: [],
userId: "1",
visibility: "public",
reactionAcceptance: "all",
reactionEmojis: {},
reactions: {},
renoteCount: 0,
repliesCount: 0,
};

const renote = {
...note,
renote: note,
}

const reactions = {
"👍": 10,
"👎": 5,
};

const defaultProps = {
post: note,
emojis: [],
lineStyle: "all",
currentInstanceUrl: "https://misskey.io",
hideCw: true,
note: note,
};
</script>

<Box title="default">
<MisskeyNote v-bind="defaultProps" />
</Box>

<Box title="lineStyle: line-1">
<MisskeyNote v-bind="defaultProps" line-style="line-1" />
</Box>

<Box title="lineStyle: line-2">
<MisskeyNote v-bind="defaultProps" line-style="line-2" />
</Box>

<Box title="lineStyle: line-3">
<MisskeyNote v-bind="defaultProps" line-style="line-3" />
</Box>

<Box title="renote">
<MisskeyNote v-bind="{ ...defaultProps, post: { ...renote, text: '' }}" />
</Box>

<Box title="quote">
<MisskeyNote v-bind="{ ...defaultProps, post: renote }" />
</Box>

<Box title="with cw">
<MisskeyNote v-bind="{ ...defaultProps, post: { ...note, cw: 'cw text' } }" />
</Box>

<Box title="reactions">
<MisskeyNote v-bind="{ ...defaultProps, post: { ...note, reactions: reactions } }" />
</Box>

<Box>
<PostList>
<MisskeyNote v-bind='defaultProps' />
<MisskeyNote v-bind='defaultProps' />
<MisskeyNote v-bind='defaultProps' />
<MisskeyNote v-bind='defaultProps' />
</PostList>
</Box>

<Box>
<PostList status="loading" />
</Box>
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "Davneko"
text: "Home Audio Server"
tagline: My great project tagline
actions:
- theme: brand
text: Markdown Examples
link: /markdown-examples
- theme: alt
text: API Examples
link: /api-examples

features:
- title: Feature A
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature B
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature C
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
---

Loading

0 comments on commit a904ecd

Please sign in to comment.