savestate

This commit is contained in:
Yannick7777 2025-04-01 22:26:47 +02:00
parent 64e88c1cad
commit 101754cc43
13 changed files with 3054 additions and 0 deletions

30
.gitignore vendored Normal file
View file

@ -0,0 +1,30 @@
# 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
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo

3
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

20
Notes.md Normal file
View file

@ -0,0 +1,20 @@
Rule 1:
Strings can be simly matched by setting them as a regex Rule
Rule 2:
Dots represent any number of any Character
Rule 3:
Put characters in square brackets to match any of them
Rule 4:
Put a rage of numbers like inside square brackets with a dash in between to match a range
Rule 5:
Use an asterix to match any emount of a specific character
Rule 6:
Use a plus sign to match a specific character if it exists one more more times
Rule 7:
Use a questionmark to match a character that could exists optionally
Rule 8:
To match a specific amount of a specific character use curly braces
Rule 9:
To match a specific amount or a higher amount of a specific character use curly braces with a comma
Rule 10:
To match a number of characters of a specific range of a character use curly curly braces with a the range and a comma in between

13
index.html Normal file
View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

8
jsconfig.json Normal file
View file

@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}

2807
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

21
package.json Normal file
View file

@ -0,0 +1,21 @@
{
"name": "regex-vue",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"pinia": "^3.0.1",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.2.1",
"vite-plugin-vue-devtools": "^7.7.2"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

93
src/App.vue Normal file
View file

@ -0,0 +1,93 @@
<script setup>
import Rule from '@/components/Rule.vue'
import { reactive, computed, ref } from 'vue'
let currentRule = ref(0)
let lang = "eng"
const availableRules = computed(() => {
rules = this.rules.find(rule => rule.lang === this.lang)
if (this.lang === "eng") {
rules.description = rules.engdescription
} else {
rules.description = rules.gerdescription
}
return rules
})
let rules = [
{
name: "Strings can be simply matched by setting them as a regex Rule",
description: "Nothing yet",
id: 0
},
{
name: "Dots represent any number of any Character",
description: "Nothing yet",
id: 1
},
{
name: "Put characters in square brackets to match any of them",
description: "Nothing yet",
id: 2
},
{
name: "Put a range of numbers inside square brackets with a dash in between to match a range",
description: "Nothing yet",
id: 3
},
{
name: "Use an asterisk to match any amount of a specific character",
description: "Nothing yet",
id: 4
},
{
name: "Use a plus sign to match a specific character if it exists one or more times",
description: "Nothing yet",
id: 5
},
{
name: "Use a question mark to match a character that could exist optionally",
description: "Nothing yet",
id: 6
},
{
name: "To match a specific amount of a specific character, use curly braces",
description: "Nothing yet",
id: 7
},
{
name: "To match a specific amount or a higher amount of a specific character, use curly braces with a comma",
description: "Nothing yet",
id: 8
},
{
name: "To match a number of characters within a specific range, use curly braces with the range and a comma in between",
description: "Nothing yet",
id: 9
}
]
</script>
<template>
<select name="RuleSelector" id="RuleSelector" v-model="currentRule">
<option v-for="rule in availableRules" :key="rule.id" :value="rule.id">
{{ rule.name }}
</option>
</select>
{{ currentRule }}
<Rule
:currentRule="currentRule"
:rules="rules"
:lang="lang"
/>
</template>
<style scoped>
</style>

18
src/components/Rule.vue Normal file
View file

@ -0,0 +1,18 @@
<script setup>
import { computed } from 'vue'
const props = defineProps ({
rules: Array,
currentRule: Number,
lang: String
})
const currentRuleObj = computed(() => {
return props.rules.find(rule => rule.id === props.currentRule)
})
</script>
<template>
<h2>Rule: {{ currentRuleObj.name }}</h2>
{{ currentRuleObj.description }}
</template>

12
src/main.js Normal file
View file

@ -0,0 +1,12 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
const app = createApp(App)
app.use(createPinia())
app.use(router)
app.mount('#app')

11
src/router/index.js Normal file
View file

@ -0,0 +1,11 @@
import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
],
})
export default router

18
vite.config.js Normal file
View file

@ -0,0 +1,18 @@
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(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
})