Merge pull request #8 from Northrop-Grumman-Collaboration-Project/navbar

Navbar
This commit is contained in:
Steven C 2024-03-03 00:52:20 -08:00 committed by GitHub
commit 7875f44982
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 199 additions and 4 deletions

View File

@ -4,11 +4,14 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

View File

@ -12,7 +12,8 @@
},
"dependencies": {
"@tauri-apps/api": "^1.4.0",
"vue": "^3.2.45"
"vue": "^3.2.45",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@tauri-apps/cli": "^1.4.0",

View File

@ -11,6 +11,9 @@ dependencies:
vue:
specifier: ^3.2.45
version: 3.2.45
vue-router:
specifier: ^4.3.0
version: 4.3.0(vue@3.2.45)
devDependencies:
'@tauri-apps/cli':
@ -1320,6 +1323,10 @@ packages:
- whiskers
dev: true
/@vue/devtools-api@6.6.1:
resolution: {integrity: sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA==}
dev: false
/@vue/reactivity-transform@3.2.45:
resolution: {integrity: sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==}
dependencies:
@ -8899,6 +8906,15 @@ packages:
webpack: 5.90.1
dev: true
/vue-router@4.3.0(vue@3.2.45):
resolution: {integrity: sha512-dqUcs8tUeG+ssgWhcPbjHvazML16Oga5w34uCUmsk7i0BcnskoLGwjpa15fqMr2Fa5JgVBrdL2MEgqz6XZ/6IQ==}
peerDependencies:
vue: ^3.2.0
dependencies:
'@vue/devtools-api': 6.6.1
vue: 3.2.45
dev: false
/vue-style-loader@4.1.3:
resolution: {integrity: sha512-sFuh0xfbtpRlKfm39ss/ikqs9AbKCoXZBpHeVZ8Tx650o0k0q/YCM7FRvigtxpACezfq6af+a7JeqVTWvncqDg==}
dependencies:

View File

@ -1,11 +1,30 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
// import Greet from "./components/Greet.vue";
import Greet from "./components/Greet.vue";
import Navbar from "./components/Navbar.vue";
import Camera from "./components/Camera.vue";
</script>
<template>
<div class="container">
<div>
<Navbar/>
</div>
<div class="grid">
<div>
<Camera/>
</div>
<div>
<Camera/>
</div>
<div>
<Camera/>
</div>
<div>
<Camera/>
</div>
</div>
<!-- <div class="container">
<h1>Welcome to Tauri!</h1>
<div class="row">
<a href="https://vitejs.dev" target="_blank">
@ -36,7 +55,7 @@
>
</p>
</div>
</div> -->
</template>
<style scoped>
@ -47,4 +66,11 @@
.logo.vue:hover {
filter: drop-shadow(0 0 2em #249b73);
}
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr); /* 2 columns */
grid-template-rows: repeat(2, 46vh); /* 2 rows */
max-width: 100vw; /* Limit width to viewport width */
max-height: 100vh; /* Limit height to viewport height */
}
</style>

14
src/assets/NGCP.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 54 KiB

57
src/components/Camera.vue Normal file
View File

@ -0,0 +1,57 @@
<script>
export default {
data() {
return {
};
},
mounted() {
this.initCam();
},
methods: {
async initCam() {
try {
const constraints = { video: true };
const stream = await navigator.mediaDevices.getUserMedia(constraints);
this.streams.push(stream);
} catch (error) {
console.error('Error accessing camera:', error);
}
}
}
};
</script>
<template>
<!-- <div class="app">
<div class="video-section" v-for="(stream, index) in streams" :key="index">
<video ref="videoPlayer" :srcObject="stream" controls></video>
</div>
</div> -->
<div class="box video-section">
<video ref="videoPlayer" :srcObject="stream" controls></video>
</div>
</template>
<style scoped>
.app {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.video-section {
width: 100%; /* Adjust according to your layout */
height: 100%; /* Adjust according to your layout */
box-sizing: border-box;
border: 2px solid #ccc; /* Adding a small border */
}
.video-section video {
width: 100%;
height: 100%;
}
.box{
border: 2px solid #030303; /* Adding a small border */
}
</style>

78
src/components/Navbar.vue Normal file
View File

@ -0,0 +1,78 @@
<script>
export default {
data() {
return {
isNavbarOpen: false,
misson_one_status: "Done",
misson_two_status: "In Progress",
misson_three_status: "initiated",
};
},
methods: {
toggleNavbar() {
this.isNavbarOpen = !this.isNavbarOpen;
}
}
};
</script>
<template>
<nav style="background-color: #011949; padding: 10px;">
<div style="display: flex; align-items: center;">
<a href="#" style="text-decoration: none;">
<img src="../assets/NGCP.svg" alt="" width="40" height="24">
<span style="font-weight: bold; font-size: 1.2rem; margin-left: 10px;">NG</span>
<span style="font-weight: bold; font-size: 1.2rem; color: white">CP</span>
</a>
<div style="width: 12rem; height:4rem;border: 2px solid rgb(52, 49, 49); background-color: rgb(255, 255, 255); margin-left: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;">
<div>
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Mission 1</span>
<button style="border: 2px solid rgb(0, 0, 0); margin-left: 1.2rem; color: rgb(0, 0, 0); padding: 3px 6px; font-size: 0.8rem;" type="button" @click="">
<span style="font-weight: bold; font-size: 0.8rem;">OPEN</span>
</button>
</div>
<div>
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Status: {{ misson_one_status }}</span>
</div>
</div>
<div style="width: 12rem; height:4rem;border: 2px solid rgb(52, 49, 49); background-color: rgb(255, 255, 255); margin-left: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;">
<div>
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Mission 2</span>
<button style="border: 2px solid rgb(0, 0, 0); margin-left: 1.2rem; color: rgb(0, 0, 0); padding: 3px 6px; font-size: 0.8rem;" type="button" @click="">
<span style="font-weight: bold; font-size: 0.8rem;">OPEN</span>
</button>
</div>
<div>
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Status: {{ misson_two_status }}</span>
</div>
</div>
<div style="width: 12rem; height:4rem;border: 2px solid rgb(52, 49, 49); background-color: rgb(255, 255, 255); margin-left: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;">
<div>
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Mission 3</span>
<button style="border: 2px solid rgb(0, 0, 0); margin-left: 1.2rem; color: rgb(0, 0, 0); padding: 3px 6px; font-size: 0.8rem;" type="button" @click="">
<span style="font-weight: bold; font-size: 0.8rem;">OPEN</span>
</button>
</div>
<div>
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Status: {{ misson_three_status }}</span>
</div>
</div>
<button style="border: 2px solid rgb(255, 0, 0); background-color: rgba(255, 0, 0); margin-left: auto; color: rgb(255, 255, 255);" type="button" @click="">
<span style="font-size: 18px;">STOP ALL</span>
</button>
<button style="border: 2px solid rgb(52, 49, 49); background-color: rgba(38, 36, 36, 0.25); margin-left: auto; color: rgb(52, 49, 49);" type="button" @click="toggleNavbar">
<span style="font-size: 18px;">&#9776;</span>
</button>
</div>
<div v-if="isNavbarOpen" style="margin-top: 10px;">
<ul style="list-style-type: none; padding-left: 0;">
<!-- Insert your menu items here -->
<li><a href="#" style="text-decoration: none;">Home</a></li>
<li><a href="#" style="text-decoration: none;">Link</a></li>
<li><a href="#" style="text-decoration: none;">Disabled</a></li>
</ul>
</div>
</nav>
</template>