Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lvyunqi committed Feb 17, 2024
0 parents commit b43d3a3
Show file tree
Hide file tree
Showing 633 changed files with 53,092 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:nuxt/recommended",
"plugin:vue/vue3-recommended",
],
parserOptions: {
ecmaVersion: "latest",
parser: "@typescript-eslint/parser",
sourceType: "module",
},
plugins: ["@typescript-eslint"],
rules: {
"max-len": [2, { code: 210, tabWidth: 4, ignoreUrls: true }],
"vue/prop-name-casing": ["error"],
"vue/multi-word-component-names": 0,
},
};
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
*.log*
.nuxt
.nitro
.cache
.output
.env
dist
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 160,
"vueIndentScriptAndStyle": true
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"nuxt.isNuxtApp": false
}
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# yarn
yarn install

# npm
npm install

# pnpm
pnpm install --shamefully-hoist
```

## Development Server

Start the development server on http://localhost:3000

```bash
npm run dev
```

## Production

Build the application for production:

```bash
npm run build
```

Locally preview production build:

```bash
npm run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
87 changes: 87 additions & 0 deletions app-setting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { $themeConfig } from './theme.config';
import { useAppStore } from '@/stores/index';

export default {
init(setLocale: any) {
const store = useAppStore();

// set default styles
let val: any = localStorage.getItem('theme'); // light, dark, system
val = val || $themeConfig.theme;
store.toggleTheme(val);

val = localStorage.getItem('menu'); // vertical, collapsible-vertical, horizontal
val = val || $themeConfig.menu;
store.toggleMenu(val);

val = localStorage.getItem('layout'); // full, boxed-layout
val = val || $themeConfig.layout;
store.toggleLayout(val);

val = localStorage.getItem('i18n_locale'); // en, da, de, el, es, fr, hu, it, ja, pl, pt, ru, sv, tr, zh

val = val || $themeConfig.locale;

const list = store.languageList;
const item = list.find((item: any) => item.code === val);
if (item) {
this.toggleLanguage(item, setLocale);
}

val = localStorage.getItem('rtlClass'); // rtl, ltr
val = val || $themeConfig.rtlClass;
store.toggleRTL(val);

val = localStorage.getItem('animation'); // animate__fadeIn, animate__fadeInDown, animate__fadeInUp, animate__fadeInLeft, animate__fadeInRight, animate__slideInDown, animate__slideInLeft, animate__slideInRight, animate__zoomIn
val = val || $themeConfig.animation;
store.toggleAnimation(val);

val = localStorage.getItem('navbar'); // navbar-sticky, navbar-floating, navbar-static
val = val || $themeConfig.navbar;
store.toggleNavbar(val);

val = localStorage.getItem('semidark');
val = val === 'true' ? true : $themeConfig.semidark;
store.toggleSemidark(val);
},

toggleLanguage(item: any, setLocale: any) {
const store = useAppStore();

let lang: any = null;
if (item) {
lang = item;
} else {
let code = store.locale || null;
if (!code) {
code = localStorage.getItem('i18n_locale');
}

item = store.languageList.find((d: any) => d.code === code);
if (item) {
lang = item;
}
}

if (!lang) {
lang = store.languageList.find((d: any) => d.code === 'en');
}

store.toggleLocale(lang.code, setLocale);
return lang;
},

changeAnimation(type = 'add') {
const store = useAppStore();
if (store.animation) {
const eleanimation: any = document.querySelector('.animation');
if (type === 'add') {
eleanimation?.classList.add('animate__animated');
eleanimation?.classList.add(store.animation);
} else {
eleanimation?.classList.remove('animate__animated');
eleanimation?.classList.remove(store.animation);
}
}
},
};
Loading

0 comments on commit b43d3a3

Please sign in to comment.