Skip to content

Commit

Permalink
added blueprint base
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Jan 19, 2025
1 parent 0019746 commit a325c80
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 5 deletions.
36 changes: 36 additions & 0 deletions anubias2/src/ide/assets/svg/background/grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions anubias2/src/ide/components/blue-search.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<template>
<div id="blue-search" :style="blueSearchStyle">
<input type="search" v-model="q" placeholder="Search for a blueprint items...">
<ul id="blue-search-list">
<li v-for="i in 45">
<i class="ri-clipboard-line"></i>
item {{i}}
</li>
</ul>
</div>
</template>

<script>
export default {
name: "blue-search",
components: {},
data: () => {
return {
q:'',
}
},
props: {
x:{
type:Number,
default:0,
},
y:{
type:Number,
default:0,
}
},
mounted() {
},
computed: {
blueSearchStyle(){
return `left: ${this.x}px;top: ${this.y}px;`
}
},
methods: {}
}
</script>

<style scoped>
#blue-search {
position: absolute;
top: 100px;
left: 100px;
background: #282c34;
width: 300px;
color: white;
}
#blue-search input {
background: transparent;
border: 1px solid #191d23;
display: block;
padding: 3px;
width: 100%;
color: white;
font-size: 16px;
text-align: center;
}
#blue-search-list{
padding: .5rem;
height: 15em;
overflow-x: hidden;
overflow-y: auto;
list-style: none;
}
#blue-search-list li{
}
#blue-search-list li:hover{
background: rgba(255, 255, 255, 0.11);
}
</style>
15 changes: 10 additions & 5 deletions anubias2/src/ide/views/anubias.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@
<i class="ri-wifi-line"></i>
</div>
</div>
<div id="main" :style="mainStyle">
<div class="grid" v-if="tabIndex === 0">

<div id="main" :style="mainStyle" v-if="tabIndex === 0">
<div class="grid" >
<sidebar></sidebar>
<div id="device-container">
<device></device>
</div>
</div>

</div>
<div v-if="tabIndex === 1" class="other-tabs">
<blue-print></blue-print>
</div>
<div id="components" :class="componentsClass" :style="componentsStyle" v-if="tabIndex === 0">
<h3 @click="expandComponents">
Expand Down Expand Up @@ -76,6 +79,7 @@
logs here
{{ project.projectFile }}
{{ project.isSave ? 'save' : 'not save' }}
"{{tabIndex}}"
</div>
</div>
</div>
Expand All @@ -91,12 +95,13 @@ import Store from 'electron-store';
import components from "../components/components-panel.vue";
import sidebar from "../components/sidebar.vue";
import anubiasConfirm from "../components/anubias-confirm.vue";
import bluePrint from "./blue-print.vue";
import BluePrint from "./blue-print.vue";
const storage = new Store();
export default {
name: "anubias",
components: {buttons, iconButton: iconButtons, device, components, sidebar, anubiasConfirm},
components: {BluePrint, buttons, iconButton: iconButtons, device, components, sidebar, anubiasConfirm},
data: () => {
return {
tabIndex: 0,
Expand Down
52 changes: 52 additions & 0 deletions anubias2/src/ide/views/blue-print.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<div id="blue-print" @contextmenu="showBlueSearch">
<blue-search v-if="blueSearchVisible" :x="blueSearchX" :y="blueSearchY"></blue-search>
</div>
</template>

<script>
import blueSearch from "../components/blue-search.vue";
export default {
name: "blue-print",
components: {
blueSearch,
},
data: () => {
return {
blueSearchVisible: false,
blueSearchX: 0,
blueSearchY: 0,
}
},
props: {},
mounted() {
},
computed: {},
methods: {
showBlueSearch(e) {
e.preventDefault();
this.blueSearchX = e.layerX;
this.blueSearchY = e.layerY;
this.blueSearchVisible = !this.blueSearchVisible;
}
}
}
</script>

<style scoped>
#blue-print {
background-image: url("../assets/svg/background/grid.svg");
height: 100%;
grid-column: 1 / -1;
position: relative;
}
#blue-print:after {
content: "BLUE PRINT";
position: absolute;
inset-inline-end: 10px;
bottom: 0;
font-size: 35px;
opacity: 0.3;
}
</style>
5 changes: 5 additions & 0 deletions anubias2/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ input {
display: none;
}

.other-tabs{
grid-column: 1 / 20;
grid-row: 2 /5;
}

.r90deg {
transform: rotateZ(90deg);
}
Expand Down

0 comments on commit a325c80

Please sign in to comment.