Skip to content

Commit

Permalink
feat: add footer copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Feb 4, 2024
1 parent 0587b88 commit c3dee85
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 12 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# AI Couplets - AI 对联/春联

## Todo

- [ ] 分享春联
Powered by [DeepSeek 开发平台](https://platform.deepseek.com/).

## Dev

### Config API Key

```bash
cp .env.example .env

# .env
# you can get free tokens from https://platform.deepseek.com/
OPENAI_API_KEY=your_deepseek_api_key
```

```bash
pnpm i
pnpm dev
Expand Down
4 changes: 4 additions & 0 deletions components/AiPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import consola from 'consola'
const app = useAppStore()
/**
* generate sfc 春联
*/
async function generate() {
app.loading = true
const data = await $fetch('/api/generate', {
Expand Down Expand Up @@ -30,6 +33,7 @@ async function generate() {
class="font-zmx w-full btn" text="black 2xl"
:class="{ 'btn-disabled': app.loading }"
flex items-center justify-center
:disabled="app.loading"
@click="generate"
>
{{ app.loading ? '生成中...' : '生成春联' }}
Expand Down
8 changes: 8 additions & 0 deletions components/BaseFooter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<div text="gray4" m-5 flex="~ col" justify-center>
<SimpleCopyright />
<div mt-2 text-sm>
Powered by <a href="https://chat.deepseek.com/" style="color:rgb(10, 122, 255)" target="_blank">DeepSeek</a>
</div>
</div>
</template>
6 changes: 0 additions & 6 deletions components/Footer.vue

This file was deleted.

26 changes: 26 additions & 0 deletions components/SimpleCopyright.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script lang="ts" setup>
import pkg from '~/package.json'
</script>

<template>
<div text="center sm" my-3>
<CurrentVersion />
<div flex="~" items-center justify-center gap="2">
<a
:href="pkg.repository.url" target="_blank"
class="inline-flex items-center justify-center"
>
<div i-ri-github-line mr-1 />
<span>Code</span>
</a>
by
<a
href="https://space.bilibili.com/1579790" target="_blank"
class="inline-flex items-center justify-center"
>
<div i-ri-bilibili-line mr-1 class="text-pink-400" />
<span>云游君</span>
</a>
</div>
</div>
</template>
2 changes: 1 addition & 1 deletion components/SpringFestivalCouplets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async function shareLink() {
</button>
</div>

<div class="font-zmx mt-4 flex" text="black" gap="2">
<div class="font-zmx mt-2 flex" text="black" gap="2">
<button flex items-center justify-center class="w-full btn" text="black" @click="shareLink">
分享春联链接 <div class="ml-1" i-ri-link />
</button>
Expand Down
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default defineNuxtConfig({

app: {
head: {
viewport: 'width=device-width,initial-scale=1',
// no scale
viewport: 'width=device-width,initial-scale=1,user-scalable=no',
// <link rel="preconnect" href="https://fonts.googleapis.com">
// <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
// <link href="https://fonts.googleapis.com/css2?family=Zhi+Mang+Xing&display=swap" rel="stylesheet">
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"type": "module",
"private": true,
"packageManager": "pnpm@8.15.1",
"repository": {
"url": "https://github.com/YunYouJun/ai-sfc"
},
"scripts": {
"build": "nuxi build",
"dev:pwa": "VITE_PLUGIN_PWA=true nuxi dev",
Expand Down
2 changes: 2 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ const app = useAppStore()
</div>
</template>
</Suspense>

<BaseFooter />
</div>
</template>
2 changes: 1 addition & 1 deletion uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

export default defineConfig({
shortcuts: [
['btn', 'text-xl px-4 py-2 rounded inline-block bg-yellow-500 text-white cursor-pointer active:bg-yellow-600 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
['btn', 'text-xl px-4 py-2 rounded inline-block bg-yellow-500 text-white cursor-pointer active:bg-yellow-600 disabled:cursor-default disabled:bg-yellow-600 disabled:opacity-90'],
['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-red-600'],
],
presets: [
Expand Down

0 comments on commit c3dee85

Please sign in to comment.