Skip to content

Commit

Permalink
website base
Browse files Browse the repository at this point in the history
  • Loading branch information
msartore committed Jul 10, 2024
1 parent 74d655a commit 1ff597f
Show file tree
Hide file tree
Showing 38 changed files with 734 additions and 24 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "14.x"

- name: Install Dependencies
run: npm install

- name: Build
run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
force_orphan: true
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Install Dependencies
run: npm install

- name: Type Check
run: npm run typecheck
35 changes: 13 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
.vite-ssg-temp

node_modules
.DS_Store
dist
dist-*
cabal-dev
*.o
*.hi
*.hie
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
dist-ssr
*.local

# lock
yarn.lock
package-lock.json
pnpm-lock.yaml

*.log
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

{
"recommendations": ["Vue.volar"]
}
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,42 @@
# www2

# element-plus-vite-starter

> A starter kit for Element Plus with Vite
- Preview: <https://vite-starter.element-plus.org>

This is an example of on-demand element-plus with [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components).

> If you want to import all, it may be so simple that no examples are needed. Just follow [quickstart | Docs](https://element-plus.org/zh-CN/guide/quickstart.html) and import them.
If you just want an on-demand import example `manually`, you can check [unplugin-element-plus/examples/vite](https://github.com/element-plus/unplugin-element-plus/tree/main/examples/vite).

## Project setup

```bash
npm install
```

### Compiles and hot-reloads for development

```bash
npm run dev
```

### Compiles and minifies for production

```bash
npm run build
```

## Usage

```bash
git clone https://github.com/element-plus/element-plus-vite-starter
cd element-plus-vite-starter
npm i
npm run dev
```

### Custom theme

See `src/styles/element/index.scss`.
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Element Plus Vite Starter</title>
<!-- element css cdn, if you use custom theme, remove it. -->
<!-- <link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/element-plus/dist/index.css"
/> -->
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "element-plus-vite-starter",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"generate": "vite-ssg build",
"preview": "vite preview",
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"element-plus": "^2.6.2",
"vue": "^3.4.21",
"vue-router": "^4.4.0"
},
"devDependencies": {
"@iconify-json/ep": "^1.1.15",
"@types/node": "^20.11.30",
"@vitejs/plugin-vue": "^5.0.4",
"sass": "^1.72.0",
"typescript": "^5.4.3",
"unocss": "^0.58.6",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.5",
"vite-ssg": "^0.23.6",
"vue-tsc": "^2.0.7"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vite-starter.element-plus.org
1 change: 1 addition & 0 deletions public/element-plus-logo-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<template>
<el-config-provider namespace="ep">
<el-container>
<el-header>
<BaseHeader
:currentPage="currentPage"
:pages="pages"
@navigate-to="navigateTo"
/>
</el-header>
<el-container style="max-width: 100em">
<el-main>
<RouterView :projects="pages[0].items" />
</el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
</el-config-provider>
</template>

<script setup>
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";
const router = useRouter();
const currentPage = ref("0");
const pages = ref([
{
index: "1",
label: "Projects",
items: [
{
label: "ATA-GUI",
path: "/projects/ata-gui",
index: "0",
img: "/src/assets/banner3.png",
},
{
label: "Ares",
path: "/projects/ares",
index: "1",
img: "/src/assets/banner3.png",
},
{
label: "ATA",
path: "/projects/ata",
index: "2",
img: "/src/assets/banner3.png",
},
],
},
{ index: "2", label: "Contact", path: "/contact" },
]);
function navigateHome() {
router.push("/");
}
function navigateTo(index) {
if (index === "0") navigateHome();
else if (index.includes("-")) {
let iS = index.split("-");
router.push(
pages.value
.find((it) => it.index == iS[0])
?.items.find((it) => it.index == iS[1]).path
);
} else router.push(pages.value.find((it) => it.index == index).path);
}
</script>
<style>
#app {
text-align: center;
color: var(--ep-text-color-primary);
}
.main-container {
height: calc(100vh - var(--ep-menu-item-height) - 3px);
}
</style>
Binary file added src/assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/banner1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/banner2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/banner3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/banner4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

declare module 'vue' {
export interface GlobalComponents {
BaseHeader: typeof import('./components/BaseHeader.vue')['default']
BaseSide: typeof import('./components/BaseSide.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside']
ElButton: (typeof import("element-plus/es"))["ElButton"]
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: (typeof import("element-plus/es"))["ElDatePicker"]
ElFooter: typeof import('element-plus/es')['ElFooter']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: (typeof import("element-plus/es"))["ElInput"]
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTag: (typeof import("element-plus/es"))["ElTag"]
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
Loading

0 comments on commit 1ff597f

Please sign in to comment.