Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.l2k.tech
9 changes: 8 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"material-design-icons": "^3.0.1",
"material-design-icons-iconfont": "^5.0.1",
"muse-ui": "^3.0.2",
"vue": "^2.5.22"
"vue": "^2.5.22",
"vue-router": "^3.6.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0",
Expand Down
Empty file added public/.nojekyll
Empty file.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- Statically import Sylvester (Matrix math JS library) -->
<script src="sylvester.js"> </script>
<title>kalman</title>
<title>控制算法学习平台 - 卡尔曼滤波器 & PID 控制器</title>
</head>
<body>
<noscript>
Expand Down
15 changes: 11 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<template>
<div id="app">
<Kalman />
<NavBar />
<router-view />
</div>
</template>
<script>
import Kalman from "./components/Kalman.vue";
import NavBar from "./components/NavBar.vue";

export default {
name: "app",
components: {
Kalman
NavBar
}
};
</script>
Expand All @@ -32,6 +33,12 @@ html {
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 20px;
min-height: 100vh;
background: linear-gradient(to bottom, #f5f7fa 0%, #ffffff 100%);
}

body {
margin: 0;
padding: 0;
}
</style>
140 changes: 140 additions & 0 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<template>
<div class="navbar">
<div class="navbar-container">
<div class="navbar-brand">
<span class="brand-icon">🎓</span>
<span class="brand-text">控制算法学习平台</span>
</div>
<nav class="navbar-menu">
<router-link
to="/kalman"
class="nav-item"
active-class="active"
>
<span class="nav-icon">📊</span>
<span class="nav-text">卡尔曼滤波器</span>
</router-link>
<router-link
to="/pid"
class="nav-item"
active-class="active"
>
<span class="nav-icon">🤖</span>
<span class="nav-text">PID 控制器</span>
</router-link>
</nav>
</div>
</div>
</template>

<script>
export default {
name: 'NavBar'
}
</script>

<style scoped>
.navbar {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
position: sticky;
top: 0;
z-index: 1000;
width: 100%;
}

.navbar-container {
max-width: 1400px;
margin: 0 auto;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: space-between;
height: 60px;
}

.navbar-brand {
display: flex;
align-items: center;
gap: 10px;
color: white;
font-weight: 700;
font-size: 1.3rem;
}

.brand-icon {
font-size: 1.8rem;
}

.brand-text {
letter-spacing: -0.02em;
}

.navbar-menu {
display: flex;
gap: 10px;
}

.nav-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 20px;
border-radius: 8px;
color: rgba(255, 255, 255, 0.85);
text-decoration: none;
font-weight: 500;
font-size: 1rem;
transition: all 0.3s ease;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}

.nav-item:hover {
background: rgba(255, 255, 255, 0.2);
color: white;
transform: translateY(-2px);
}

.nav-item.active {
background: white;
color: #667eea;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-icon {
font-size: 1.2rem;
}

.nav-text {
white-space: nowrap;
}

@media (max-width: 768px) {
.navbar-container {
flex-direction: column;
height: auto;
padding: 15px 10px;
gap: 15px;
}

.navbar-brand {
font-size: 1.1rem;
}

.brand-icon {
font-size: 1.4rem;
}

.navbar-menu {
width: 100%;
justify-content: center;
flex-wrap: wrap;
}

.nav-item {
padding: 6px 15px;
font-size: 0.9rem;
}
}
</style>
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
import 'material-design-icons-iconfont'
Expand All @@ -9,5 +10,6 @@ Vue.use(MuseUI);
Vue.config.productionTip = false;

new Vue({
router,
render: h => h(App)
}).$mount("#app");
33 changes: 33 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import KalmanView from '../views/KalmanView.vue'
import PIDView from '../views/PIDView.vue'

Vue.use(VueRouter)

const routes = [
{
path: '/',
redirect: '/kalman'
},
{
path: '/kalman',
name: 'Kalman',
component: KalmanView,
meta: { title: '卡尔曼滤波器' }
},
{
path: '/pid',
name: 'PID',
component: PIDView,
meta: { title: 'PID 控制器' }
}
]

const router = new VueRouter({
mode: 'hash',
base: process.env.BASE_URL,
routes
})

export default router
Loading