diff --git a/src/components/Extra.vue b/src/components/Extra.vue index ae8fb107..d1da0ac5 100644 --- a/src/components/Extra.vue +++ b/src/components/Extra.vue @@ -1,4 +1,6 @@ \ No newline at end of file +import { reactive, ref, watch } from 'vue' + +const simulatorMobileStore = useSimulatorMobileStore() +const selectMultiple = ref(false) +const propertiesPanelPos = reactive({ + up: 22, + down: 14 +}); + +watch(() => simulatorMobileStore.isVerilog, (val) => { + if (val) { + propertiesPanelPos.up = 10 + propertiesPanelPos.down = 2 + } else { + propertiesPanelPos.up = 22 + propertiesPanelPos.down = 14 + } +}) + +const copyBtnClick = () => { + window.document.execCommand('copy') + simulationArea.shiftDown = false + simulatorMobileStore.isCopy = true +} + +const pasteBtnClick = () => { + paste(localStorage.getItem('clipboardData')); + simulatorMobileStore.isCopy = false +} + +const propertiesBtnClick = () => { + simulatorMobileStore.showPropertiesPanel = !simulatorMobileStore.showPropertiesPanel +} + + + diff --git a/src/components/Logo/Logo.vue b/src/components/Logo/Logo.vue index 56130b8c..48ef6c97 100644 --- a/src/components/Logo/Logo.vue +++ b/src/components/Logo/Logo.vue @@ -1,7 +1,7 @@ + + \ No newline at end of file diff --git a/src/components/Navbar/Navbar.vue b/src/components/Navbar/Navbar.vue index caeec961..a1a4bcb5 100644 --- a/src/components/Navbar/Navbar.vue +++ b/src/components/Navbar/Navbar.vue @@ -1,9 +1,12 @@ diff --git a/src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue b/src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue new file mode 100644 index 00000000..19455127 --- /dev/null +++ b/src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue @@ -0,0 +1,121 @@ + + + + + + + \ No newline at end of file diff --git a/src/components/Navbar/NavbarLinks/NavbarLinks.vue b/src/components/Navbar/NavbarLinks/NavbarLinks.vue index 3c01a4dc..72241d76 100644 --- a/src/components/Navbar/NavbarLinks/NavbarLinks.vue +++ b/src/components/Navbar/NavbarLinks/NavbarLinks.vue @@ -5,12 +5,12 @@ :key="navbarItem.id" class="navbar-nav navbar-menu noSelect pointerCursor" > - + - diff --git a/src/components/Navbar/QuickButton/QuickButtonMobile.vue b/src/components/Navbar/QuickButton/QuickButtonMobile.vue new file mode 100644 index 00000000..6d9791b1 --- /dev/null +++ b/src/components/Navbar/QuickButton/QuickButtonMobile.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/src/components/Navbar/User/UserMenu.vue b/src/components/Navbar/User/UserMenu.vue new file mode 100644 index 00000000..7914aa62 --- /dev/null +++ b/src/components/Navbar/User/UserMenu.vue @@ -0,0 +1,190 @@ + + + + \ No newline at end of file diff --git a/src/components/Panels/ElementsPanel/ElementsPanel.ts b/src/components/Panels/ElementsPanel/ElementsPanel.ts new file mode 100644 index 00000000..66a6462e --- /dev/null +++ b/src/components/Panels/ElementsPanel/ElementsPanel.ts @@ -0,0 +1,25 @@ +import { simulationArea } from "#/simulator/src/simulationArea" +import modules from "#/simulator/src/modules" +import { uxvar } from "#/simulator/src/ux" + +export function createElement(elementName: string) { + if (simulationArea.lastSelected?.newElement) + simulationArea.lastSelected.delete() + var obj = new modules[elementName]() + simulationArea.lastSelected = obj + uxvar.smartDropXX += 70 + if (uxvar.smartDropXX / globalScope.scale > width) { + uxvar.smartDropXX = 50 + uxvar.smartDropYY += 80 + } +} + +export function getImgUrl(elementName: string) { + try { + const elementImg = new URL(`../../../assets/img/${elementName}.svg`, import.meta.url).href; + return elementImg; + } catch (e) { + console.error("Error loading image:", e); + return ''; + } +} diff --git a/src/components/Panels/ElementsPanel/ElementsPanel.vue b/src/components/Panels/ElementsPanel/ElementsPanel.vue index a157d901..8aac793c 100644 --- a/src/components/Panels/ElementsPanel/ElementsPanel.vue +++ b/src/components/Panels/ElementsPanel/ElementsPanel.vue @@ -142,8 +142,7 @@ -#/simulator/src/metadata + diff --git a/src/components/Panels/ElementsPanel/ElementsPanelMobile.vue b/src/components/Panels/ElementsPanel/ElementsPanelMobile.vue new file mode 100644 index 00000000..bf88db31 --- /dev/null +++ b/src/components/Panels/ElementsPanel/ElementsPanelMobile.vue @@ -0,0 +1,329 @@ + + + + + diff --git a/src/components/Panels/PropertiesPanel/LayoutProperty/LayoutProperty.vue b/src/components/Panels/PropertiesPanel/LayoutProperty/LayoutProperty.vue index 72e27285..a9d3dd5f 100644 --- a/src/components/Panels/PropertiesPanel/LayoutProperty/LayoutProperty.vue +++ b/src/components/Panels/PropertiesPanel/LayoutProperty/LayoutProperty.vue @@ -84,7 +84,7 @@