Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gsoc'24): Mobile view Implementation for vue simulator #361

Merged
merged 48 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
43dd830
feat(gsoc'24): Mobile view Circuit Elements panel component Implemented
niladrix719 Aug 3, 2024
dec5ce1
Merge branch 'main' into circuit-ele-mobile
niladrix719 Aug 3, 2024
57cf754
feat(gsoc'24): Quick button mobile component implemented
niladrix719 Aug 5, 2024
b5860de
mobile touch implemented
niladrix719 Aug 6, 2024
d02d5d4
updated
niladrix719 Aug 7, 2024
f0554bb
feat: timming diagram implemented for mobile view
niladrix719 Aug 9, 2024
c348665
added toggle button and horizontal scroll for btns
niladrix719 Aug 9, 2024
dfe1183
Merge branch 'quick-btn-mobile' of https://github.com/niladrix719/cv-…
niladrix719 Aug 10, 2024
8119af4
Merge branch 'circuit-ele-mobile' of https://github.com/niladrix719/c…
niladrix719 Aug 10, 2024
b7bc2d2
Merge branch 'main' into touch-mobile
niladrix719 Aug 11, 2024
7c0bd25
updated
niladrix719 Aug 11, 2024
b017954
added selection tool
niladrix719 Aug 13, 2024
1e00dbe
Merge branch 'circuit-ele-mobile' of https://github.com/niladrix719/c…
niladrix719 Aug 13, 2024
5be3e9a
Removed bug from previous commit
niladrix719 Aug 13, 2024
29ac3b8
Merge branch 'touch-mobile' of https://github.com/niladrix719/cv-fron…
niladrix719 Aug 13, 2024
331b3e6
Enable touch for embed simulator
niladrix719 Aug 13, 2024
7b79d2f
Double tap implemented
niladrix719 Aug 13, 2024
649e8cf
Merge branch 'touch-mobile' of https://github.com/niladrix719/cv-fron…
niladrix719 Aug 13, 2024
e6049ab
Romoving clarity error
niladrix719 Aug 13, 2024
a276ce6
updated to latest (listeners.js file)
niladrix719 Aug 14, 2024
94b550a
Merge branch 'touch-mobile' of https://github.com/niladrix719/cv-fron…
niladrix719 Aug 14, 2024
a165915
fixed event bug
niladrix719 Aug 14, 2024
385937e
copy paste implementation
niladrix719 Aug 14, 2024
0ca120b
Merge branch 'circuit-ele-mobile' of https://github.com/niladrix719/c…
niladrix719 Aug 14, 2024
94d71bf
copy paste fixed
niladrix719 Aug 14, 2024
522a513
properties panel mobile implemented
niladrix719 Aug 14, 2024
734ec5b
updated
niladrix719 Aug 14, 2024
a817719
Merge branch 'main' into mobile-view
niladrix719 Aug 14, 2024
9210f3d
layout mode components for mobile view
niladrix719 Aug 22, 2024
2752bbb
Merge branch 'mobile-view' of https://github.com/niladrix719/cv-front…
niladrix719 Aug 22, 2024
1458ec2
added sidebar and upated the navbar layout, and other refactoring
niladrix719 Aug 24, 2024
eebcb4b
small bug fixes and responsiveness
niladrix719 Aug 25, 2024
d83f2b4
verilog editor panel implemented with some navbar ui fixes
niladrix719 Aug 25, 2024
0d49e55
verilog mode toggle fix
niladrix719 Aug 30, 2024
5d7030a
tabs for verilog fixed
niladrix719 Aug 30, 2024
ee9fcb7
Merge branch 'main' into mobile-view
niladrix719 Sep 1, 2024
5d81b42
removed some used code
niladrix719 Sep 1, 2024
1887640
updated
niladrix719 Sep 1, 2024
945b499
fixed
niladrix719 Sep 1, 2024
024f043
fixed
niladrix719 Sep 1, 2024
c24b5fe
Update src/components/Panels/ElementsPanel/ElementsPanel.ts
niladrix719 Sep 1, 2024
b4730bf
Update src/store/simulatorMobileStore.ts
niladrix719 Sep 1, 2024
fa6fbf1
Update src/components/Panels/TimingDiagramPanel/TimingDiagramPanel.ts
niladrix719 Sep 1, 2024
9ae4324
Update src/components/Panels/PropertiesPanel/PropertiesPanel.ts
niladrix719 Sep 1, 2024
713371a
Update src/simulator/src/Verilog2CV.js
niladrix719 Sep 1, 2024
31798ef
fixed
niladrix719 Sep 1, 2024
5606ad1
updated
niladrix719 Sep 1, 2024
27421f3
Merge branch 'main' into mobile-view
niladrix719 Sep 1, 2024
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
176 changes: 168 additions & 8 deletions src/components/Extra.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<QuickButtonMobile v-if="simulatorMobileStore.showMobileView" />
<TimingDiagramMobile v-if="simulatorMobileStore.showMobileView" v-show="simulatorMobileStore.showTimingDiagram" />
<!-- --------------------------------------------------------------------------------------------- -->
<!-- TabsBar -->
<TabsBar />
Expand All @@ -11,12 +13,13 @@

<!-- --------------------------------------------------------------------------------------------- -->
<!-- Circuit Elements Panel -->
<ElementsPanel />
<ElementsPanel v-if="!simulatorMobileStore.showMobileView"/>
<!-- --------------------------------------------------------------------------------------------- -->

<!-- --------------------------------------------------------------------------------------------- -->
<!-- Layout Element Panel -->
<div
v-if="!simulatorMobileStore.showMobileView"
class="noSelect defaultCursor layoutElementPanel draggable-panel draggable-panel-css"
ref="layoutElementPanelRef"
>
Expand All @@ -34,14 +37,14 @@

<!-- --------------------------------------------------------------------------------------------- -->
<!-- Timing Diagram Panel -->
<TimingDiagramPanel />
<TimingDiagramPanel v-if="!simulatorMobileStore.showMobileView" />
<!-- --------------------------------------------------------------------------------------------- -->

<!-- --------------------------------------------------------------------------------------------- -->
<!-- Testbench -->
<TestBenchPanel />
<TestBenchPanel v-if="!simulatorMobileStore.showMobileView" />
<!-- --------------------------------------------------------------------------------------------- -->
<TestBenchCreator />
<TestBenchCreator v-if="!simulatorMobileStore.showMobileView" />
<!-- --------------------------------------------------------------------------------------------- -->

<!-- --------------------------------------------------------------------------------------------- -->
Expand All @@ -59,7 +62,7 @@

<!-- --------------------------------------------------------------------------------------------- -->
<!-- Element Properties Panel -->
<PropertiesPanel />
<PropertiesPanel v-if="!simulatorMobileStore.showMobileView" />
<!-- --------------------------------------------------------------------------------------------- -->

<!-- --------------------------------------------------------------------------------------------- -->
Expand Down Expand Up @@ -99,14 +102,41 @@
width: 100%;
height: 100%;
"></canvas>
<canvas id="simulationArea" style="
<canvas
id="simulationArea"
style="
position: absolute;
left: 0;
top: 0;
z-index: 1;
width: 100%;
height: 100%;
"></canvas>
"
@touchstart="(e) => {
simulationArea.touch = true;
panStart(e)
}"
@touchend="(e) => {
simulationArea.touch = true;
panStop(e)
}"
@touchmove="(e) => {
simulationArea.touch = true;
panMove(e)
}"
@mousedown="(e) => {
simulationArea.touch = false;
panStart(e)
}"
@mousemove="(e) => {
simulationArea.touch = false;
panMove(e)
}"
@mouseup="(e) => {
simulationArea.touch = false;
panStop(e)
}"
niladrix719 marked this conversation as resolved.
Show resolved Hide resolved
></canvas>
<div id="miniMap">
<canvas id="miniMapArea" style="position: absolute; left: 0; top: 0; z-index: 3"></canvas>
</div>
Expand Down Expand Up @@ -156,6 +186,62 @@
<!---issue reporting-system----->
<ReportIssue />
<!-- --------------------------------------------------------------------------------------------- -->

<v-btn
class="cir-ele-btn"
@mousedown="simulatorMobileStore.showElementsPanel = !simulatorMobileStore.showElementsPanel"
:style="{bottom: simulatorMobileStore.showElementsPanel ? '10rem' : '2rem'}"
v-if="simulatorMobileStore.showMobileView"
>
<i class="fas fa-bezier-curve"></i>
</v-btn>

<v-btn
class="select-mul-btn"
@mousedown="(e: React.MouseEvent) => {
if(simulationArea.shiftDown == false) {
simulationArea.shiftDown = true;
}
else {
simulationArea.shiftDown = false;
e.preventDefault();
}
}"
:style="{bottom: simulatorMobileStore.showElementsPanel ? '10rem' : '2rem'}"
v-if="simulatorMobileStore.showMobileView"
>
<i class="fa-solid fa-vector-square"></i>
</v-btn>

<v-btn
class="select-mul-btn"
@mousedown="copyBtnClick()"
:style="{bottom: simulatorMobileStore.showElementsPanel ? '16rem' : '8rem'}"
v-if="simulatorMobileStore.showMobileView && !simulatorMobileStore.isCopy"
>
<i class="fa-solid fa-copy"></i>
</v-btn>

<v-btn
class="select-mul-btn"
@mousedown="pasteBtnClick()"
:style="{bottom: simulatorMobileStore.showElementsPanel ? '16rem' : '8rem'}"
v-if="simulatorMobileStore.showMobileView && simulatorMobileStore.isCopy"
>
<i class="fa-solid fa-paste"></i>
</v-btn>

<v-btn
class="select-mul-btn"
@mousedown="propertiesBtnClick()"
:style="{bottom: simulatorMobileStore.showElementsPanel ? '22rem' : '14rem'}"
v-if="simulatorMobileStore.showMobileView"
>
<i class="fa-solid fa-sliders"></i>
</v-btn>

<ElementsPanelMobile v-if="simulatorMobileStore.showMobileView" />
<PropertiesPanelMobile v-if="simulatorMobileStore.showMobileView" />
</template>

<script lang="ts" setup>
Expand All @@ -176,5 +262,79 @@ import ReportIssue from './ReportIssue/ReportIssue.vue'
import TestBenchPanel from './Panels/TestBenchPanel/TestBenchPanel.vue'
import TestBenchCreator from './Panels/TestBenchPanel/TestBenchCreator.vue'
import TestBenchValidator from './Panels/TestBenchPanel/TestBenchValidator.vue'
import QuickButtonMobile from './Navbar/QuickButton/QuickButtonMobile.vue'
import TimingDiagramMobile from './Panels/TimingDiagramPanel/TimingDiagramMobile.vue'
import ElementsPanelMobile from './Panels/ElementsPanel/ElementsPanelMobile.vue'
import PropertiesPanelMobile from './Panels/PropertiesPanel/PropertiesPanelMobile.vue'
import { simulationArea } from '#/simulator/src/simulationArea'
import { paste } from '#/simulator/src/events'
import { useLayoutStore } from '#/store/layoutStore'
import { panStart, panMove, panStop } from '#/simulator/src/listeners'
import { useSimulatorMobileStore } from '#/store/simulatorMobileStore'
import { useState } from '#/store/SimulatorStore/state'
</script>
import { onMounted, ref } from 'vue'

const layoutStore = useLayoutStore()
const simulatorMobileStore = useSimulatorMobileStore()

const layoutElementPanelRef = ref<HTMLElement | null>(null);

onMounted(() => {
layoutStore.layoutElementPanelRef = layoutElementPanelRef.value
})

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
niladrix719 marked this conversation as resolved.
Show resolved Hide resolved
}
</script>

<style scoped>
.cir-ele-btn{
position: absolute;
right: 1.5rem;
bottom: 15rem;
z-index: 100;
background-color: var(--bg-toggle-btn-primary);
color: white;
border-radius: 100%;
font-size: 20px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
transition: 0.3s;
padding: 1rem;
height: 4rem;
width: 4rem;
}

.select-mul-btn{
position: absolute;
left: 1.5rem;
bottom: 2rem;
z-index: 100;
background-color: var(--bg-toggle-btn-primary);
color: white;
border-radius: 100%;
font-size: 20px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
transition: 0.3s;
padding: 1rem;
height: 4rem;
width: 4rem;
}
</style>
4 changes: 3 additions & 1 deletion src/components/Navbar/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
<User :user-data="userDropdownItems" />
</div>
</nav>
<QuickButton />
<QuickButton v-if="!simulatorMobileStore.showMobileView" />
</template>

<script lang="ts" setup>
import QuickButton from '@/Navbar/QuickButton/QuickButton.vue'
import User from '@/Navbar/User/User.vue'
import NavbarLinks from '@/Navbar/NavbarLinks/NavbarLinks.vue'
import { useSimulatorMobileStore } from '#/store/simulatorMobileStore'

import navbarData from '#/assets/constants/Navbar/NAVBAR_DATA.json'
import userDropdownItems from '#/assets/constants/Navbar/USER_DATA.json'
Expand All @@ -35,6 +36,7 @@ const navbarLogo = ref('logo')
const minWidthToShowSidebar = ref(992)
const showSidebar = ref(false)
const projectStore = useProjectStore()
const simulatorMobileStore = useSimulatorMobileStore()
showSidebar.value =
window.innerWidth < minWidthToShowSidebar.value ? true : false
onMounted(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/QuickButton/QuickButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="quick-btn" @ondragover="dragover">
<div class="quick-btn" id='quick-btn-id' @ondragover="dragover">
<div id="dragQPanel" class="panel-drag">
<!-- <DragSvgDots /> -->
<div class="drag-dot-svg"></div>
Expand Down
Loading
Loading