wip: init

This commit is contained in:
KirisameVanilla 2025-07-18 00:31:39 +08:00 committed by KirisameVanilla
commit 79a950ca68
34 changed files with 2526 additions and 0 deletions

25
.gitignore vendored Normal file
View File

@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.vscode/

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

2089
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "vue-dicts",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.11",
"tailwindcss": "^4.1.11",
"vue": "^3.5.17",
"vue-router": "^4.5.1"
},
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.0",
"@vue/tsconfig": "^0.7.0",
"typescript": "~5.8.3",
"vite": "^7.0.4",
"vue-tsc": "^2.2.12"
}
}

BIN
public/fonts/Deserta.woff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 KiB

BIN
public/images/AI_money.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
public/images/LOGO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
public/images/bell.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
public/images/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

1
public/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

14
src/App.vue Normal file
View File

@ -0,0 +1,14 @@
<script setup lang="ts">
</script>
<template>
<router-view />
</template>
<style>
.font-deserta {
font-family: 'Deserta', sans-serif;
}
.font-inter {
font-family: 'Inter', sans-serif;
}
</style>

1
src/assets/vue.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@ -0,0 +1,5 @@
<template>
<a href="#" class="fixed right-0 top-1/2 -translate-y-1/2 w-[137px] h-[56px] bg-gradient-to-l from-primary to-white rounded-l-full flex items-center pl-[58px] pr-4 text-white text-xl bg-[url('/images/AI_money.png')] bg-no-repeat bg-[left_12px_center] bg-[length:40px]">
AI助手
</a>
</template>

View File

@ -0,0 +1,22 @@
<template>
<footer class="bg-gradient-to-t from-[#005ae0] to-transparent h-[570px] flex justify-center items-start">
<div class="max-w-[1030px] mx-auto flex space-x-[190px] pt-[195px]">
<div v-for="col in columns" :key="col.title">
<h3 class="text-primary font-bold mb-8">{{ col.title }}</h3>
<ul class="space-y-2">
<li v-for="link in col.links" :key="link">
<a href="#" class="text-[16px] text-[#666] opacity-45 hover:opacity-100">{{ link }}</a>
</li>
</ul>
</div>
</div>
</footer>
</template>
<script setup>
const columns = [
{ title: '关于我们', links: ['团队介绍','发展计划','联系我们'] },
{ title: '问题解决', links: ['客服','帮助','常见问题'] },
{ title: '快速入口', links: ['查词','翻译','写作指导'] },
]
</script>

View File

@ -0,0 +1,57 @@
<template>
<header class="bg-white h-[174px] flex items-center">
<div class="max-w-[1030px] mx-auto flex items-center w-full">
<!-- Logo -->
<router-link to="/" class="block w-[237px] h-[61px] bg-[url('/images/LOGO.png')] bg-contain bg-no-repeat pl-[100px] leading-[60px] font-deserta text-5xl text-blue-700">
CiDian
</router-link>
<!-- Nav -->
<nav class="ml-[187px] flex space-x-[53px] text-xl">
<router-link v-slot="{ isActive }" to="/dict">
<a
:class="[
'w-[87px] text-center py-2 border-b-4 transition-colors duration-300 font-inter',
isActive ? 'border-b-blue-700' : 'border-b-transparent',
'hover:border-b-blue-700'
]"
>
查词
</a>
</router-link>
<router-link v-slot="{ isActive }" to="/trans">
<a
:class="[
'w-[87px] text-center py-2 border-b-4 transition-colors duration-300 font-inter',
isActive ? 'border-b-blue-700' : 'border-b-transparent',
'hover:border-b-blue-700'
]"
>
翻译
</a>
</router-link>
<router-link v-slot="{ isActive }" to="/write">
<a
:class="[
'w-[87px] text-center py-2 border-b-4 transition-colors duration-300 font-inter',
isActive ? 'border-b-blue-700' : 'border-b-transparent hover:border-b-blue-700'
]"
>
写作指导
</a>
</router-link>
</nav>
<!-- User -->
<div class="flex space-x-4 ml-auto">
<a href="#" class="w-[42px] h-[42px] bg-gray-300 rounded-full border-2 border-primary block" />
<a href="#" class="w-[25px] h-[32px] bg-[url('/images/bell.png')] bg-cover" />
<a href="#" class="w-[42px] h-[42px] bg-[url('/images/icon_任务栏收缩.png')] bg-cover" />
</div>
</div>
</header>
</template>
<script setup lang="ts">
</script>

View File

@ -0,0 +1,15 @@
<template>
<section class="bg-white h-[88px] flex justify-center items-center">
<div class="relative w-[804px]">
<span class="absolute left-0 top-1/2 -translate-y-1/2 bg-primary bg-blue-700 text-white rounded-full px-8 py-3 z-10">
/
</span>
<input
type="text"
placeholder="请输入单词"
class="w-full h-[56px] pl-[207px] pr-[70px] border-[5px] border-primary border-blue-700 rounded-full text-xl outline-none"
/>
<button class="absolute right-0 top-1/2 -translate-y-1/2 w-[56px] h-[56px] bg-primary rounded-full bg-[url('/images/search.png')] bg-no-repeat bg-center bg-[length:60%]" />
</div>
</section>
</template>

6
src/main.ts Normal file
View File

@ -0,0 +1,6 @@
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
createApp(App).use(router).mount('#app')

10
src/router/index.ts Normal file
View File

@ -0,0 +1,10 @@
import { createRouter, createWebHistory } from 'vue-router'
export default createRouter({
history: createWebHistory(),
routes: [
{ path: '/', name: 'Home', component: () => import('../views/HomePage.vue') },
{ path: '/dict', name: 'Dict', component: () => import('../views/DictPage.vue') },
{ path: '/login', name: 'Login', component: () => import('../views/LoginPage.vue') },
],
})

6
src/shims-vue.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
// src/shims-vue.d.ts
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}

19
src/style.css Normal file
View File

@ -0,0 +1,19 @@
@import "tailwindcss";
/* Deserta */
@font-face {
font-family: 'Deserta';
src: url(../public/fonts/Deserta.woff) format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
/* Inter Variable */
@font-face {
font-family: 'Inter';
src: url(../public/fonts/Inter-VariableFont_opsz_wght.woff) format('woff-variations'),
url(../public/fonts/Inter-VariableFont_opsz,wght.ttf) format('truetype-variations');
font-weight: 100 900;
font-style: normal;
font-display: swap;
}

60
src/views/DictPage.vue Normal file
View File

@ -0,0 +1,60 @@
<template>
<div>
<AppHeader active="dict" />
<SearchBar />
<AiAssist />
<!-- upper -->
<section class="bg-[url('/images/french-learning-illustration.png')] bg-no-repeat bg-center pt-[95px]">
<div class="max-w-[1030px] mx-auto px-4">
<ul class="font-deserta text-[56px] leading-[76px]">
<li>YOUR ELEGANT</li>
<li class="text-primary">COMPANION</li>
<li>IN FRENCH LEARNING</li>
</ul>
<router-link to="/dict" class="inline-block mt-[67px] w-[268px] h-[64px] bg-primary bg-blue-700 text-white text-2xl rounded-full text-center leading-[64px]">
SEARCH NOW
</router-link>
<div class="mt-[139px]">
<h3 class="text-[40px] font-deserta">INTRODUCTION</h3>
<p class="mt-[59px] text-xl leading-8">
本站致力于打造一款高质量实用而优雅的法语词典工具集词义查询例句拓展词根分析于一体助力学习者深入理解每一个法语单词背后的文化与语境不止查词更是探索语言之美的旅程
</p>
<p class="mt-4 text-xl leading-8 text-gray-500">
A refined and practical French dictionary designed for learners and enthusiasts. Discover accurate definitions, contextual examples, and deep linguistic insights because learning French is more than memorizing words, it's exploring a world of meaning.
</p>
</div>
</div>
</section>
<!-- lower -->
<section class="bg-[url('/images/lower.png')] bg-contain bg-no-repeat h-[437px] w-full">
<div class="max-w-[1030px] mx-auto flex items-center justify-between h-full">
<ul class="font-deserta text-[35px] leading-[53px]">
<li>CUMULATIVE <span class="text-primary">WORD</span></li>
<li>LOOKUP COUNT</li>
</ul>
<div>
<p class="text-muted mb-3 text-lg">累计</p>
<div class="flex items-end gap-2">
<span v-for="i in 11" :key="i" class="w-[34px] h-[60px] rounded-[17px] bg-gradient-to-b from-white to-[#d5e2f8] border border-transparent flex items-center justify-center text-2xl text-muted shadow">
0
</span>
<span class="text-primary text-[35px] ml-2">TIMES</span>
</div>
</div>
</div>
</section>
<AppFooter />
</div>
</template>
<script setup>
import AppHeader from '../components/AppHeader.vue'
import SearchBar from '../components/SearchBar.vue'
import AiAssist from '../components/AiAssist.vue'
import AppFooter from '../components/AppFooter.vue'
</script>

60
src/views/HomePage.vue Normal file
View File

@ -0,0 +1,60 @@
<template>
<div>
<AppHeader active="dict" />
<SearchBar />
<AiAssist />
<!-- upper -->
<section class="bg-[url('/images/french-learning-illustration.png')] bg-no-repeat bg-center pt-[95px]">
<div class="max-w-[1030px] mx-auto px-4">
<ul class="font-deserta text-[56px] leading-[76px]">
<li>YOUR ELEGANT</li>
<li class="text-blue-700">COMPANION</li>
<li>IN FRENCH LEARNING</li>
</ul>
<router-link to="/dict" class="font-deserta inline-block mt-[67px] w-[268px] h-[64px] bg-primary bg-blue-700 text-white text-2xl rounded-full text-center leading-[64px]">
SEARCH NOW
</router-link>
<div class="mt-[139px]">
<h3 class="text-[40px] font-deserta">INTRODUCTION</h3>
<p class="font-inter mt-[59px] text-xl leading-8">
本站致力于打造一款高质量实用而优雅的法语词典工具集词义查询例句拓展词根分析于一体助力学习者深入理解每一个法语单词背后的文化与语境不止查词更是探索语言之美的旅程
</p>
<p class="font-serif mt-4 text-xl leading-8 text-gray-500">
A refined and practical French dictionary designed for learners and enthusiasts. Discover accurate definitions, contextual examples, and deep linguistic insights because learning French is more than memorizing words, it's exploring a world of meaning.
</p>
</div>
</div>
</section>
<!-- lower -->
<section class="bg-[url('/images/lower.png')] bg-contain bg-no-repeat h-[437px] w-full">
<div class="max-w-[1030px] mx-auto flex items-center justify-between h-full">
<ul class="font-deserta text-[35px] leading-[53px]">
<li>CUMULATIVE <span class="text-primary">WORD</span></li>
<li>LOOKUP COUNT</li>
</ul>
<div>
<p class="text-muted mb-3 text-lg">累计</p>
<div class="flex items-end gap-2">
<span v-for="i in 11" :key="i" class="w-[34px] h-[60px] rounded-[17px] bg-gradient-to-b from-white to-[#d5e2f8] border border-transparent flex items-center justify-center text-2xl text-muted shadow">
0
</span>
<span class="font-deserta text-primary text-[35px] ml-2">TIMES</span>
</div>
</div>
</div>
</section>
<AppFooter />
</div>
</template>
<script setup>
import AppHeader from '../components/AppHeader.vue'
import SearchBar from '../components/SearchBar.vue'
import AiAssist from '../components/AiAssist.vue'
import AppFooter from '../components/AppFooter.vue'
</script>

38
src/views/LoginPage.vue Normal file
View File

@ -0,0 +1,38 @@
<template>
<div>
<header class="bg-white h-[174px] flex items-center">
<div class="max-w-[1030px] mx-auto">
<router-link to="/" class="block w-[237px] h-[61px] bg-[url('/images/LOGO.png')] bg-contain bg-no-repeat pl-[100px] leading-[31px] font-deserta text-2xl">
CiDian
</router-link>
</div>
</header>
<main class="relative overflow-visible">
<div class="max-w-[1030px] mx-auto pt-10">
<ul class="flex flex-col items-end font-deserta text-5xl leading-[76px]">
<li class="font-inter text-lg text-muted">BONJOUR</li>
<li class="text-primary">WELCOME BACK</li>
<li>LET'S GET STARTED</li>
</ul>
<form class="mt-[77px] max-w-[401px]">
<label class="block mb-6 text-muted text-xl">手机号</label>
<input type="text" class="w-full h-[63px] border border-primary rounded-full px-8 text-2xl outline-none" />
<label class="block mt-8 mb-6 text-muted text-xl">密码</label>
<input type="password" class="w-full h-[63px] border border-primary rounded-full px-8 text-2xl outline-none" />
<button type="submit" class="mt-[72px] w-[268px] h-[63px] bg-primary text-white text-2xl rounded-full">
LOG IN
</button>
</form>
</div>
<!-- 背景图伪元素 -->
<div class="absolute top-4 -right-[200px] w-[1200px] h-[800px] bg-[url('/images/8ba41f...png')] bg-no-repeat bg-auto bg-[position:-100px_0] -z-10" />
</main>
<footer class="h-[465px] bg-gradient-to-t from-[#4284e8] to-transparent" />
</div>
</template>

1
src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="vite/client" />

15
tsconfig.app.json Normal file
View File

@ -0,0 +1,15 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}

7
tsconfig.json Normal file
View File

@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

25
tsconfig.node.json Normal file
View File

@ -0,0 +1,25 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2023",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

8
vite.config.ts Normal file
View File

@ -0,0 +1,8 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue(), tailwindcss()],
})