1
8
.editorconfig
普通文件
@ -0,0 +1,8 @@
|
||||
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
|
||||
charset = utf-8
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
max_line_length = 100
|
||||
1
.gitattributes
vendored
普通文件
@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
36
.gitignore
vendored
普通文件
@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
6
.prettierrc.json
普通文件
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/prettierrc",
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100
|
||||
}
|
||||
8
.vscode/extensions.json
vendored
普通文件
@ -0,0 +1,8 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
48
README.md
普通文件
@ -0,0 +1,48 @@
|
||||
# XRD
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||
|
||||
## Recommended Browser Setup
|
||||
|
||||
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
|
||||
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
||||
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
|
||||
- Firefox:
|
||||
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
||||
- [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vite.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
yarn
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
yarn dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
yarn lint
|
||||
```
|
||||
22
eslint.config.ts
普通文件
@ -0,0 +1,22 @@
|
||||
import { globalIgnores } from 'eslint/config'
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
||||
|
||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
||||
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
||||
|
||||
export default defineConfigWithVueTs(
|
||||
{
|
||||
name: 'app/files-to-lint',
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
},
|
||||
|
||||
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
||||
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
skipFormatting,
|
||||
)
|
||||
22
index.html
普通文件
@ -0,0 +1,22 @@
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<!-- <base href="https://appassets.androidplatform.net/assets/www/" /> -->
|
||||
<title>Vite App</title>
|
||||
<style>
|
||||
body {
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
39
package.json
普通文件
@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "xrd",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build",
|
||||
"lint": "eslint . --fix --cache",
|
||||
"format": "prettier --write src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.5.22",
|
||||
"vue-router": "^4.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node22": "^22.0.2",
|
||||
"@types/node": "^22.18.11",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@vue/eslint-config-prettier": "^10.2.0",
|
||||
"@vue/eslint-config-typescript": "^14.6.0",
|
||||
"@vue/tsconfig": "^0.8.1",
|
||||
"eslint": "^9.37.0",
|
||||
"eslint-plugin-vue": "~10.5.0",
|
||||
"jiti": "^2.6.1",
|
||||
"npm-run-all2": "^8.0.4",
|
||||
"prettier": "3.6.2",
|
||||
"typescript": "~5.9.0",
|
||||
"vite": "^7.1.11",
|
||||
"vite-plugin-vue-devtools": "^8.0.3",
|
||||
"vue-tsc": "^3.1.1"
|
||||
}
|
||||
}
|
||||
二进制
public/favicon.ico
普通文件
|
之后 宽度: | 高度: | 大小: 4.2 KiB |
58
src/App.vue
普通文件
@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { RouterView } from 'vue-router'
|
||||
import router from './router'
|
||||
|
||||
const container = ref<HTMLDivElement | null>(null)
|
||||
const footer = ref<HTMLDivElement | null>(null)
|
||||
onMounted(() => {
|
||||
container.value?.setAttribute(
|
||||
'style',
|
||||
`height:${document.body.clientHeight - (footer.value ? footer.value?.clientHeight : 0)}px`,
|
||||
)
|
||||
})
|
||||
const go2index = () => {
|
||||
router.push('/index')
|
||||
}
|
||||
const go2common = () => {
|
||||
router.push('/common')
|
||||
}
|
||||
const go2info = () => {
|
||||
router.push('/Info')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="container" ref="container">
|
||||
<RouterView :is="router" />
|
||||
</div>
|
||||
|
||||
<div id="footer" ref="footer">
|
||||
<img src="/src/assets/icons/Home.svg" @click="go2index" />
|
||||
<img src="/src/assets/icons/Image.svg" @click="go2common" />
|
||||
<img src="/src/assets/icons/More.svg" @click="go2info" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
* {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
#container {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
height: 5rem;
|
||||
background: #4c85f688;
|
||||
width: 100vw;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
justify-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
二进制
src/assets/XRD.mp4
普通文件
10
src/assets/Xrayintroduction.svg
普通文件
|
之后 宽度: | 高度: | 大小: 445 KiB |
9
src/assets/cell.svg
普通文件
|
之后 宽度: | 高度: | 大小: 51 KiB |
24
src/assets/com1.svg
普通文件
|
之后 宽度: | 高度: | 大小: 1.8 MiB |
21
src/assets/common/方解石.svg
普通文件
|
之后 宽度: | 高度: | 大小: 1.9 MiB |
21
src/assets/common/橄榄石.svg
普通文件
|
之后 宽度: | 高度: | 大小: 889 KiB |
21
src/assets/common/正长石.svg
普通文件
|
之后 宽度: | 高度: | 大小: 2.0 MiB |
21
src/assets/common/氯化钠.svg
普通文件
|
之后 宽度: | 高度: | 大小: 333 KiB |
21
src/assets/common/白云母.svg
普通文件
|
之后 宽度: | 高度: | 大小: 1.8 MiB |
21
src/assets/common/石膏.svg
普通文件
|
之后 宽度: | 高度: | 大小: 2.4 MiB |
21
src/assets/common/石英.svg
普通文件
|
之后 宽度: | 高度: | 大小: 946 KiB |
21
src/assets/common/萤石.svg
普通文件
|
之后 宽度: | 高度: | 大小: 1.4 MiB |
21
src/assets/common/赤铁矿.svg
普通文件
|
之后 宽度: | 高度: | 大小: 2.1 MiB |
21
src/assets/common/高岭石.svg
普通文件
|
之后 宽度: | 高度: | 大小: 2.1 MiB |
21
src/assets/common/黄铁矿.svg
普通文件
|
之后 宽度: | 高度: | 大小: 1.6 MiB |
4
src/assets/icons/Home.svg
普通文件
@ -0,0 +1,4 @@
|
||||
<svg width="115" height="64" viewBox="0 0 115 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M53.1667 29.3333V16H61.1667V29.3333M45.1667 12L57.1667 2.66663L69.1667 12V26.6666C69.1667 27.3739 68.8857 28.0521 68.3856 28.5522C67.8855 29.0523 67.2072 29.3333 66.5 29.3333H47.8333C47.1261 29.3333 46.4478 29.0523 45.9477 28.5522C45.4476 28.0521 45.1667 27.3739 45.1667 26.6666V12Z" stroke="#1E1E1E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M44.3424 54V46.77H45.2674V49.85H49.1674V46.77H50.0924V54H49.1674V50.665H45.2674V54H44.3424ZM53.8103 54.1C53.3336 54.1 52.9169 53.9983 52.5603 53.795C52.2069 53.5883 51.9319 53.2867 51.7353 52.89C51.5386 52.4933 51.4403 52.0083 51.4403 51.435C51.4403 50.895 51.5319 50.4217 51.7153 50.015C51.8986 49.6083 52.1669 49.2933 52.5203 49.07C52.8736 48.8433 53.3053 48.73 53.8153 48.73C54.2919 48.73 54.7053 48.835 55.0553 49.045C55.4053 49.2517 55.6769 49.5567 55.8703 49.96C56.0669 50.3633 56.1653 50.855 56.1653 51.435C56.1653 51.9617 56.0753 52.425 55.8953 52.825C55.7153 53.225 55.4503 53.5383 55.1003 53.765C54.7536 53.9883 54.3236 54.1 53.8103 54.1ZM53.8153 53.37C54.1219 53.37 54.3819 53.2917 54.5953 53.135C54.8086 52.9783 54.9703 52.7533 55.0803 52.46C55.1936 52.1667 55.2503 51.8183 55.2503 51.415C55.2503 51.045 55.2003 50.7133 55.1003 50.42C55.0036 50.1233 54.8503 49.8883 54.6403 49.715C54.4303 49.5417 54.1553 49.455 53.8153 49.455C53.5019 49.455 53.2369 49.5333 53.0203 49.69C52.8036 49.8433 52.6386 50.0667 52.5253 50.36C52.4153 50.6533 52.3603 51.005 52.3603 51.415C52.3603 51.7783 52.4086 52.1083 52.5053 52.405C52.6053 52.7017 52.7619 52.9367 52.9753 53.11C53.1919 53.2833 53.4719 53.37 53.8153 53.37ZM57.3946 54V48.83H58.2846V49.58C58.4279 49.3533 58.6246 49.155 58.8746 48.985C59.1246 48.815 59.4496 48.73 59.8496 48.73C60.0362 48.73 60.2262 48.7617 60.4196 48.825C60.6162 48.8883 60.7962 48.9833 60.9596 49.11C61.1229 49.2367 61.2496 49.3917 61.3396 49.575C61.4996 49.3217 61.7162 49.1183 61.9896 48.965C62.2629 48.8083 62.5712 48.73 62.9146 48.73C63.0946 48.73 63.2829 48.7583 63.4796 48.815C63.6762 48.8683 63.8579 48.965 64.0246 49.105C64.1946 49.2417 64.3329 49.4333 64.4396 49.68C64.5462 49.9233 64.5996 50.2367 64.5996 50.62V54H63.6696V50.71C63.6696 50.3967 63.6196 50.155 63.5196 49.985C63.4196 49.8117 63.2879 49.69 63.1246 49.62C62.9646 49.55 62.7929 49.515 62.6096 49.515C62.4496 49.515 62.2796 49.5467 62.0996 49.61C61.9196 49.6733 61.7662 49.78 61.6396 49.93C61.5129 50.08 61.4496 50.285 61.4496 50.545V54H60.5296V50.44C60.5296 50.2367 60.4746 50.0667 60.3646 49.93C60.2579 49.7933 60.1229 49.69 59.9596 49.62C59.7996 49.55 59.6396 49.515 59.4796 49.515C59.3029 49.515 59.1246 49.55 58.9446 49.62C58.7679 49.69 58.6179 49.8017 58.4946 49.955C58.3746 50.105 58.3146 50.3017 58.3146 50.545V54H57.3946ZM68.2319 54.1C67.7519 54.1 67.3286 53.995 66.9619 53.785C66.5952 53.575 66.3086 53.2733 66.1019 52.88C65.8952 52.4867 65.7919 52.015 65.7919 51.465C65.7919 50.9217 65.8852 50.445 66.0719 50.035C66.2586 49.625 66.5286 49.305 66.8819 49.075C67.2386 48.845 67.6669 48.73 68.1669 48.73C68.6536 48.73 69.0652 48.835 69.4019 49.045C69.7386 49.255 69.9936 49.5517 70.1669 49.935C70.3436 50.315 70.4319 50.7667 70.4319 51.29V51.63H66.7269C66.7269 51.9567 66.7802 52.2533 66.8869 52.52C66.9969 52.7833 67.1619 52.9933 67.3819 53.15C67.6019 53.3067 67.8802 53.385 68.2169 53.385C68.5469 53.385 68.8302 53.3083 69.0669 53.155C69.3069 53.0017 69.4602 52.78 69.5269 52.49H70.3969C70.3369 52.84 70.1969 53.135 69.9769 53.375C69.7602 53.615 69.4986 53.7967 69.1919 53.92C68.8886 54.04 68.5686 54.1 68.2319 54.1ZM66.7319 51.005H69.5419C69.5419 50.7083 69.4919 50.4417 69.3919 50.205C69.2919 49.965 69.1386 49.7767 68.9319 49.64C68.7286 49.5 68.4719 49.43 68.1619 49.43C67.8386 49.43 67.5702 49.5083 67.3569 49.665C67.1436 49.8183 66.9852 50.0167 66.8819 50.26C66.7786 50.5 66.7286 50.7483 66.7319 51.005Z" fill="black"/>
|
||||
</svg>
|
||||
|
之后 宽度: | 高度: | 大小: 3.8 KiB |
4
src/assets/icons/Image.svg
普通文件
|
之后 宽度: | 高度: | 大小: 6.6 KiB |
4
src/assets/icons/More.svg
普通文件
@ -0,0 +1,4 @@
|
||||
<svg width="115" height="80" viewBox="0 0 115 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M53.2866 20C53.6001 19.1089 54.2188 18.3574 55.0333 17.8788C55.8477 17.4002 56.8052 17.2252 57.7362 17.3849C58.6673 17.5446 59.5117 18.0287 60.1201 18.7513C60.7284 19.474 61.0614 20.3887 61.06 21.3333C61.06 24 57.06 25.3333 57.06 25.3333M57.1666 30.6666H57.18M70.5 24C70.5 31.3638 64.5304 37.3333 57.1666 37.3333C49.8028 37.3333 43.8333 31.3638 43.8333 24C43.8333 16.6362 49.8028 10.6666 57.1666 10.6666C64.5304 10.6666 70.5 16.6362 70.5 24Z" stroke="#1E1E1E" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M46.1539 62V54.77H47.4339L49.6139 60.74L51.8239 54.77H53.0989V62H52.1439V56.155L50.0489 62H49.1839L47.1039 56.21V62H46.1539ZM56.823 62.1C56.3463 62.1 55.9296 61.9983 55.573 61.795C55.2196 61.5883 54.9446 61.2867 54.748 60.89C54.5513 60.4933 54.453 60.0083 54.453 59.435C54.453 58.895 54.5446 58.4217 54.728 58.015C54.9113 57.6083 55.1796 57.2933 55.533 57.07C55.8863 56.8433 56.318 56.73 56.828 56.73C57.3046 56.73 57.718 56.835 58.068 57.045C58.418 57.2517 58.6896 57.5567 58.883 57.96C59.0796 58.3633 59.178 58.855 59.178 59.435C59.178 59.9617 59.088 60.425 58.908 60.825C58.728 61.225 58.463 61.5383 58.113 61.765C57.7663 61.9883 57.3363 62.1 56.823 62.1ZM56.828 61.37C57.1346 61.37 57.3946 61.2917 57.608 61.135C57.8213 60.9783 57.983 60.7533 58.093 60.46C58.2063 60.1667 58.263 59.8183 58.263 59.415C58.263 59.045 58.213 58.7133 58.113 58.42C58.0163 58.1233 57.863 57.8883 57.653 57.715C57.443 57.5417 57.168 57.455 56.828 57.455C56.5146 57.455 56.2496 57.5333 56.033 57.69C55.8163 57.8433 55.6513 58.0667 55.538 58.36C55.428 58.6533 55.373 59.005 55.373 59.415C55.373 59.7783 55.4213 60.1083 55.518 60.405C55.618 60.7017 55.7746 60.9367 55.988 61.11C56.2046 61.2833 56.4846 61.37 56.828 61.37ZM60.4073 62V56.83H61.2873V57.825C61.3739 57.5783 61.4956 57.375 61.6523 57.215C61.8089 57.0517 61.9873 56.93 62.1873 56.85C62.3906 56.77 62.6006 56.73 62.8173 56.73C62.8939 56.73 62.9689 56.735 63.0423 56.745C63.1156 56.755 63.1723 56.7717 63.2123 56.795V57.69C63.1623 57.6667 63.0973 57.6517 63.0173 57.645C62.9406 57.635 62.8756 57.63 62.8223 57.63C62.6156 57.6167 62.4223 57.63 62.2423 57.67C62.0623 57.7067 61.9039 57.7717 61.7673 57.865C61.6306 57.9583 61.5223 58.0817 61.4423 58.235C61.3656 58.385 61.3273 58.5683 61.3273 58.785V62H60.4073ZM66.4204 62.1C65.9404 62.1 65.517 61.995 65.1504 61.785C64.7837 61.575 64.497 61.2733 64.2904 60.88C64.0837 60.4867 63.9804 60.015 63.9804 59.465C63.9804 58.9217 64.0737 58.445 64.2604 58.035C64.447 57.625 64.717 57.305 65.0704 57.075C65.427 56.845 65.8554 56.73 66.3554 56.73C66.842 56.73 67.2537 56.835 67.5904 57.045C67.927 57.255 68.182 57.5517 68.3554 57.935C68.532 58.315 68.6204 58.7667 68.6204 59.29V59.63H64.9154C64.9154 59.9567 64.9687 60.2533 65.0754 60.52C65.1854 60.7833 65.3504 60.9933 65.5704 61.15C65.7904 61.3067 66.0687 61.385 66.4054 61.385C66.7354 61.385 67.0187 61.3083 67.2554 61.155C67.4954 61.0017 67.6487 60.78 67.7154 60.49H68.5854C68.5254 60.84 68.3854 61.135 68.1654 61.375C67.9487 61.615 67.687 61.7967 67.3804 61.92C67.077 62.04 66.757 62.1 66.4204 62.1ZM64.9204 59.005H67.7304C67.7304 58.7083 67.6804 58.4417 67.5804 58.205C67.4804 57.965 67.327 57.7767 67.1204 57.64C66.917 57.5 66.6604 57.43 66.3504 57.43C66.027 57.43 65.7587 57.5083 65.5454 57.665C65.332 57.8183 65.1737 58.0167 65.0704 58.26C64.967 58.5 64.917 58.7483 64.9204 59.005Z" fill="black"/>
|
||||
</svg>
|
||||
|
之后 宽度: | 高度: | 大小: 3.4 KiB |
3
src/assets/icons/Search.svg
普通文件
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z" stroke="#1E1E1E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
之后 宽度: | 高度: | 大小: 328 B |
21
src/assets/intro2.svg
普通文件
|
之后 宽度: | 高度: | 大小: 100 KiB |
32
src/assets/introe.svg
普通文件
|
之后 宽度: | 高度: | 大小: 1.0 MiB |
二进制
src/assets/pdf/Diamond.png
普通文件
|
之后 宽度: | 高度: | 大小: 7.9 MiB |
12
src/assets/star.svg
普通文件
|
之后 宽度: | 高度: | 大小: 36 KiB |
11
src/assets/video.svg
普通文件
|
之后 宽度: | 高度: | 大小: 498 KiB |
9
src/assets/video0.svg
普通文件
|
之后 宽度: | 高度: | 大小: 492 KiB |
9
src/main.ts
普通文件
@ -0,0 +1,9 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(router)
|
||||
|
||||
app.mount('#app')
|
||||
150
src/pages/HomePage.vue
普通文件
@ -0,0 +1,150 @@
|
||||
<script lang="ts" setup>
|
||||
import router from '@/router'
|
||||
import { ref, watch } from 'vue'
|
||||
const searchInput = ref<string>('')
|
||||
interface SearchResultObject {
|
||||
item: string
|
||||
target: string
|
||||
}
|
||||
const searchResult = ref<SearchResultObject[]>([])
|
||||
const AllSearchResult: SearchResultObject[] = [
|
||||
{
|
||||
item: '氯化钠',
|
||||
target: '/common/氯化钠',
|
||||
},
|
||||
{
|
||||
item: '石英',
|
||||
target: '/common/石英',
|
||||
},
|
||||
{
|
||||
item: '方解石',
|
||||
target: '/common/方解石',
|
||||
},
|
||||
{
|
||||
item: '正长石',
|
||||
target: '/common/正长石',
|
||||
},
|
||||
{
|
||||
item: '白云母',
|
||||
target: '/common/白云母',
|
||||
},
|
||||
{
|
||||
item: '黄铁矿',
|
||||
target: '/common/黄铁矿',
|
||||
},
|
||||
{
|
||||
item: '石膏',
|
||||
target: '/common/石膏',
|
||||
},
|
||||
{
|
||||
item: '赤铁矿',
|
||||
target: '/common/赤铁矿',
|
||||
},
|
||||
{
|
||||
item: '萤石',
|
||||
target: '/common/萤石',
|
||||
},
|
||||
{
|
||||
item: '橄榄石',
|
||||
target: '/common/橄榄石',
|
||||
},
|
||||
{
|
||||
item: '高岭石',
|
||||
target: '/common/高岭石',
|
||||
},
|
||||
|
||||
{
|
||||
item: 'X射线',
|
||||
target: '/Video',
|
||||
},
|
||||
{ item: '晶体学基础', target: '/Info' },
|
||||
]
|
||||
const jmp2video = () => {
|
||||
router.push('/Video')
|
||||
}
|
||||
const jmp2info = () => {
|
||||
router.push('/Info')
|
||||
}
|
||||
const jmp2image = () => {
|
||||
router.push('/common')
|
||||
}
|
||||
|
||||
watch(searchInput, (value) => {
|
||||
searchResult.value = AllSearchResult.filter((v) => {
|
||||
return v.item.includes(value)
|
||||
})
|
||||
})
|
||||
|
||||
const jmp = (target: string) => {
|
||||
router.push(target)
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<h1>XRDLearing</h1>
|
||||
<div id="search">
|
||||
<img src="/src/assets/icons/Search.svg" />
|
||||
<input type="text" id="searchinput" v-model="searchInput" placeholder="Search" /><br />
|
||||
</div>
|
||||
<div id="searcharea" v-if="searchInput">
|
||||
<span class="searchitem" v-for="(sr, key) in searchResult" :key="key" @click="jmp(sr.target)">
|
||||
{{ sr.item }}
|
||||
</span>
|
||||
<span v-if="searchResult.length == 0">无搜索结果</span>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
align-content: flex-start;
|
||||
justify-content: space-around;
|
||||
"
|
||||
>
|
||||
<p>
|
||||
Do you know XRD? <br />
|
||||
Let's watch the video.
|
||||
</p>
|
||||
<img src="/src/assets/cell.svg" height="60px" />
|
||||
</div>
|
||||
|
||||
<img src="/src/assets/video.svg" width="100%" @click="jmp2video" />
|
||||
<img src="/src/assets/Xrayintroduction.svg" width="100%" />
|
||||
<img src="/src/assets/intro2.svg" width="100%" @click="jmp2info" />
|
||||
<img src="/src/assets//com1.svg" width="100%" @click="jmp2image" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#search {
|
||||
/* width: 100%; */
|
||||
height: 3rem;
|
||||
background-color: #c8b8d4;
|
||||
border-radius: 30px;
|
||||
padding-left: 1rem;
|
||||
border: none;
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
}
|
||||
#searchinput {
|
||||
background: none;
|
||||
border: none;
|
||||
height: 100%;
|
||||
font-size: 24px;
|
||||
width: calc(calc(100%) - 3rem);
|
||||
}
|
||||
#searcharea {
|
||||
/* width: 100%; */
|
||||
font-size: 1.5rem;
|
||||
border-radius: 5px;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
.searchitem {
|
||||
background-color: #c8b8d4;
|
||||
/* width: 100%; */
|
||||
display: block;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
90
src/pages/ImagePage.vue
普通文件
@ -0,0 +1,90 @@
|
||||
<script lang="ts">
|
||||
import router from '@/router'
|
||||
import { defineComponent } from 'vue'
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
targetId: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
router.back()
|
||||
},
|
||||
scrollToImage() {
|
||||
const id = this.$route.params.id as string
|
||||
if (id && id !== 'none') {
|
||||
this.targetId = id
|
||||
this.$nextTick(() => {
|
||||
this.scrollToTarget()
|
||||
})
|
||||
}
|
||||
},
|
||||
scrollToTarget() {
|
||||
const imgs = document.getElementsByTagName('img')
|
||||
for (let i = 0; i < imgs.length; i++) {
|
||||
const img = imgs[i] as HTMLImageElement
|
||||
const dataName = img.getAttribute('data-name')
|
||||
if (dataName?.includes(this.targetId)) {
|
||||
// 添加平滑滚动和行为控制
|
||||
img.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start',
|
||||
inline: 'nearest',
|
||||
})
|
||||
// 添加高亮效果以便确认
|
||||
img.style.transition = 'box-shadow 0.3s'
|
||||
img.style.boxShadow = '0 0 0 3px #007bff'
|
||||
setTimeout(() => {
|
||||
img.style.boxShadow = ''
|
||||
}, 2000)
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.scrollToImage()
|
||||
},
|
||||
// 监听路由变化
|
||||
watch: {
|
||||
'$route.params.id': {
|
||||
handler(newId) {
|
||||
if (newId && newId !== 'none') {
|
||||
this.targetId = newId as string
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => this.scrollToTarget(), 100) // 额外延迟确保渲染完成
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="back" @click="back"><</div>
|
||||
<h2>常见矿物的衍射图谱</h2>
|
||||
<img src="/src/assets/common/氯化钠.svg" data-name="氯化钠" width="100%" />
|
||||
<img src="/src/assets/common/石英.svg" data-name="石英" width="100%" />
|
||||
<img src="/src/assets/common/方解石.svg" data-name="方解石" width="100%" />
|
||||
<img src="/src/assets/common/正长石.svg" data-name="正长石" width="100%" />
|
||||
<img src="/src/assets/common/白云母.svg" data-name="白云母" width="100%" />
|
||||
<img src="/src/assets/common/黄铁矿.svg" data-name="黄铁矿" width="100%" />
|
||||
<img src="/src/assets/common/石膏.svg" data-name="石膏" width="100%" />
|
||||
<img src="/src/assets/common/赤铁矿.svg" data-name="赤铁矿" width="100%" />
|
||||
<img src="/src/assets/common/萤石.svg" data-name="萤石" width="100%" />
|
||||
<img src="/src/assets/common/橄榄石.svg" data-name="橄榄石" width="100%" />
|
||||
<img src="/src/assets/common/高岭石.svg" data-name="高岭石" width="100%" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#back {
|
||||
width: 100%;
|
||||
font-size: x-large;
|
||||
background-color: #76a0f4;
|
||||
padding: 1rem;
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
||||
16
src/pages/InfoPage.vue
普通文件
@ -0,0 +1,16 @@
|
||||
<script lang="ts" setup>
|
||||
import router from '@/router'
|
||||
|
||||
const back = () => {
|
||||
router.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="pdf-viewer">
|
||||
<div id="back" @click="back">< 返回</div>
|
||||
<img src="/src/assets/introe.svg" width="100%" />
|
||||
<h2>相关软件操作指南</h2>
|
||||
<img src="/src/assets/pdf/Diamond.png" width="100%" />
|
||||
</div>
|
||||
</template>
|
||||
59
src/pages/VideoPage.vue
普通文件
@ -0,0 +1,59 @@
|
||||
<script lang="ts">
|
||||
import router from '@/router'
|
||||
export default {
|
||||
methods: {
|
||||
onVideoLoaded() {
|
||||
// 确保视频控件完全显示
|
||||
const video = this.$refs.videoPlayer as HTMLVideoElement
|
||||
video.controls = true
|
||||
},
|
||||
back: () => {
|
||||
router.back()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div id="back" @click="back"><</div>
|
||||
<h1>视频播放</h1>
|
||||
<video
|
||||
ref="videoPlayer"
|
||||
src="/src/assets/XRD.mp4"
|
||||
poster="/src/assets/video0.svg"
|
||||
controls
|
||||
controlsList="nodownload"
|
||||
@loadedmetadata="onVideoLoaded"
|
||||
width="100%"
|
||||
>
|
||||
您的浏览器不支持视频播放
|
||||
</video>
|
||||
<h1>互动问答</h1>
|
||||
<p>经过学习,你了解到了哪些知识?</p>
|
||||
<textarea class="answer"></textarea>
|
||||
<p>你认为未来XRD还能应用在哪些领域?</p>
|
||||
<textarea class="answer"></textarea>
|
||||
<a>请给我们的视频打个分吧~</a>
|
||||
<img src="/src/assets/star.svg" width="100%" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
#back {
|
||||
width: 100%;
|
||||
font-size: x-large;
|
||||
background-color: #76a0f4;
|
||||
padding: 1rem;
|
||||
color: #000000;
|
||||
}
|
||||
* {
|
||||
color: #2a4c71;
|
||||
}
|
||||
.answer {
|
||||
height: 8rem;
|
||||
background: #afc8da55;
|
||||
width: 100%;
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
38
src/router/index.ts
普通文件
@ -0,0 +1,38 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import HomePage from '@/pages/HomePage.vue'
|
||||
import ImagePage from '@/pages/ImagePage.vue'
|
||||
import VideoPage from '@/pages/VideoPage.vue'
|
||||
import InfoPage from '@/pages/InfoPage.vue'
|
||||
|
||||
const router = createRouter({
|
||||
// history: createWebHistory(import.meta.env.BASE_URL),
|
||||
history: createWebHashHistory(),
|
||||
routes: [
|
||||
{
|
||||
path: '/index',
|
||||
component: HomePage,
|
||||
},
|
||||
{
|
||||
path: '/common',
|
||||
redirect: '/common/none',
|
||||
},
|
||||
{
|
||||
path: '/common/:id',
|
||||
component: ImagePage,
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirect: '/index',
|
||||
},
|
||||
{
|
||||
path: '/Video',
|
||||
component: VideoPage,
|
||||
},
|
||||
{
|
||||
path: '/Info',
|
||||
component: InfoPage,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
export default router
|
||||
12
tsconfig.app.json
普通文件
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
||||
"exclude": ["src/**/__tests__/*"],
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
11
tsconfig.json
普通文件
@ -0,0 +1,11 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.node.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
19
tsconfig.node.json
普通文件
@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": "@tsconfig/node22/tsconfig.json",
|
||||
"include": [
|
||||
"vite.config.*",
|
||||
"vitest.config.*",
|
||||
"cypress.config.*",
|
||||
"nightwatch.conf.*",
|
||||
"playwright.config.*",
|
||||
"eslint.config.*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"types": ["node"]
|
||||
}
|
||||
}
|
||||
16
vite.config.ts
普通文件
@ -0,0 +1,16 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue(), vueDevTools()],
|
||||
base: './',
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
})
|
||||