From 4a6c8e87d2ba65dc1618ae2811f486aa9ef79d39 Mon Sep 17 00:00:00 2001
From: Adam Procter <adamprocter@researchnot.es>
Date: Fri, 14 Aug 2020 15:42:43 +0100
Subject: [PATCH] updates to fix z-index a little

Should be easier to see first few nodes being created as they don't stack on top of each other until you start add at least 4
---
 .DS_Store                              | Bin 10244 -> 10244 bytes
 app/package.json                       |   2 +-
 app/src/components/NodesLayer.vue      |   4 ++--
 app/src/components/OnBoard.vue         |  11 ++++++---
 app/src/components/OtherNodeslayer.vue |   4 ++--
 app/src/components/UploadLayer.vue     |  20 ++++++++--------
 app/src/experimental/modes/index.js    |  20 ++++++++--------
 app/src/store/index.js                 |  31 ++++++++++++++++++++++---
 8 files changed, 61 insertions(+), 31 deletions(-)

diff --git a/.DS_Store b/.DS_Store
index 88b2cc87a4df9b884b8efac32cfde58a56f1473b..3ae4ff743ba105ee0c7db34aa1f8dfc59444c2e7 100644
GIT binary patch
delta 160
zcmZn(XbIThE?{^vsURn_xWvHVIwKP^3o9Et2L}f?2QNo#a7KQ4a7kiGX|YpcQ8b7b
zkXVwDlsLIpz%zi8laqrpUO=L{+SJfgN5R<Ks8&az+QPy_N5Ry@q_&omLtNF+)-xfu
qvZ}hKwr(Z^7%(zIXa;^L4Wnjlwii6XH?cu)GrPhsmd*O2%*+65*Ctf}

delta 203
zcmZn(XbIThF5vb(sURn_xWvHV1|t(Q3o9Et2PYRN4<{cdXKZjretB?7Vo7PSQ({rP
zfJ|^^N@`MKQFvxbNk&L&o@-8OS!$ktkxybt>f{Om&&+6$hJeJ944@)TWrv&x3?RVC
z!5J?gRb8!XXl!h%qhM@iS*xQ^ZEkL$qhMleR$I%-$swuk78F<7)HiGPlBLU*A2|xv
g$H2%4p&10BG>kg7Sy1o<-)44&Uo4w1i!d_-0I!HPegFUf

diff --git a/app/package.json b/app/package.json
index 70d471c..7e57b54 100644
--- a/app/package.json
+++ b/app/package.json
@@ -1,6 +1,6 @@
 {
   "name": "nodenogg.in",
-  "version": "0.1.19",
+  "version": "0.1.20",
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
diff --git a/app/src/components/NodesLayer.vue b/app/src/components/NodesLayer.vue
index feec636..5ba1b14 100644
--- a/app/src/components/NodesLayer.vue
+++ b/app/src/components/NodesLayer.vue
@@ -172,7 +172,7 @@ export default {
 
   data() {
     return {
-      pickupz: 99,
+      pickupz: 1,
       localreadmode: false,
       mode: '',
     }
@@ -359,7 +359,7 @@ textarea {
 img {
   width: 100%;
 }
-/* .draggable {
+/* .dragging {
   transform: scale(0.7);
 } */
 </style>
diff --git a/app/src/components/OnBoard.vue b/app/src/components/OnBoard.vue
index ef9078e..d860dfc 100644
--- a/app/src/components/OnBoard.vue
+++ b/app/src/components/OnBoard.vue
@@ -6,7 +6,7 @@
       :h="335"
       :x="560"
       :y="50"
-      :z="0"
+      :z="1"
       :draggable="true"
       style="background-color: #6fcf97;"
     >
@@ -45,12 +45,12 @@
       :h="375"
       :x="1100"
       :y="50"
-      :z="0"
+      :z="1"
       :draggable="true"
       style="background-color: #6fcf97;"
     >
       <form>
-        <div>
+        <div class="content">
           <p id="nodeid" :inner-html.prop="nodetext2 | marked"></p>
           <div v-if="microcosm == false">
             <input
@@ -146,6 +146,11 @@ export default {
   padding: 0 0.5em;
 }
 
+.content {
+  overflow: hidden;
+  max-height: 100%;
+}
+
 h1,
 h2,
 h3,
diff --git a/app/src/components/OtherNodeslayer.vue b/app/src/components/OtherNodeslayer.vue
index 3d8c511..f5f49e7 100644
--- a/app/src/components/OtherNodeslayer.vue
+++ b/app/src/components/OtherNodeslayer.vue
@@ -28,7 +28,7 @@
             </p>
           </div>
           <div class="react" v-if="nodeid != undefined">
-            <h2>React</h2>
+            <!-- <h2>React</h2> -->
             <div class="eeee">
               <input :value="nodeid" name="id" readonly hidden />
               <input
@@ -219,7 +219,7 @@ export default {
     return {
       input: '',
       search: '',
-      pickupz: 99,
+      pickupz: 1,
     }
   },
 
diff --git a/app/src/components/UploadLayer.vue b/app/src/components/UploadLayer.vue
index a0f300b..2d53015 100644
--- a/app/src/components/UploadLayer.vue
+++ b/app/src/components/UploadLayer.vue
@@ -9,12 +9,12 @@
         ref="fileInput"
         @change="onFileSelected"
       />
-      <h1>{{ status }}</h1>
+      <!-- <h1>{{ status }}</h1>
       <h2>ID: {{ id }}</h2>
-      <h2>Agent version: {{ agentVersion }}</h2>
+      <h2>Agent version: {{ agentVersion }}</h2> -->
 
-      <button type="button" @click="saveIPFS">Upload</button>
-      <button type="button" @click="getIPFS">Get IPFS</button>
+      <!-- <button type="button" @click="saveIPFS">Upload</button>
+      <button type="button" @click="getIPFS">Get IPFS</button> -->
       <!-- {{ uploadready }} -->
       <textarea id="ipfshash" v-model="copytext"></textarea>
       <div class="btn-row">
@@ -85,11 +85,11 @@ export default {
         // console.log(node)
         // Call ipfs `id` method.
         // Returns the identity of the Peer.
-        const { agentVersion, id } = await node.id()
-        this.agentVersion = agentVersion
-        this.id = id
+        //  const { agentVersion, id } = await node.id()
+        //  this.agentVersion = agentVersion
+        //   this.id = id
         // Set successful status text.
-        this.status = 'Connected to IPFS 😊'
+        //  this.status = 'Connected to IPFS 😊'
       } catch (err) {
         // Set error status text.
         this.status = `Error: ${err}`
@@ -148,7 +148,7 @@ export default {
 </script>
 
 <style lang="css" scoped>
-/* .fileInput {
+.fileInput {
   display: none;
 }
 
@@ -158,5 +158,5 @@ textarea {
   height: 0px;
   width: 0px;
   padding: 0px;
-} */
+}
 </style>
diff --git a/app/src/experimental/modes/index.js b/app/src/experimental/modes/index.js
index a0aed2c..1aad869 100644
--- a/app/src/experimental/modes/index.js
+++ b/app/src/experimental/modes/index.js
@@ -31,16 +31,16 @@ export const move = {
   shortcut: false,
 }
 
-// export const connect = {
-//   name: 'connect',
-//   view: {
-//     pan: false,
-//     zoom: false,
-//   },
-//   icon: 'connection',
-//   cursor: 'crosshair',
-//   shortcut: false,
-// }
+export const connect = {
+  name: 'connect',
+  view: {
+    pan: false,
+    zoom: false,
+  },
+  icon: 'connection',
+  cursor: 'crosshair',
+  shortcut: false,
+}
 
 export const draw = {
   name: 'draw',
diff --git a/app/src/store/index.js b/app/src/store/index.js
index 7b7a22e..7802e0d 100644
--- a/app/src/store/index.js
+++ b/app/src/store/index.js
@@ -13,6 +13,8 @@ import Router from '@/router'
 Vue.use(Vuex)
 Vue.component('vue-draggable-resizable', VueDraggableResizable)
 var myclient = 'firstvisit'
+var localxpos = 50
+var localypos = 50
 
 if (localStorage.getItem('mylastMicrocosm') == null) {
   var microcosm = 'firstvisit'
@@ -361,13 +363,36 @@ const store = new Vuex.Store({
           })
       })
       pouchdb.get(state.global_pos_name).then(function (doc) {
+        //console.log(doc.positions[doc.positions.length - 1].z_index)
+        var i
+        localxpos = 50
+        localypos = 50
+        for (i = 0; i < Object.keys(doc.positions).length; i++) {
+          if (doc.positions[i].x_pos == 50) {
+            localxpos = 70
+            localypos = 70
+          }
+          if (doc.positions[i].x_pos == 70) {
+            localxpos = 90
+            localypos = 90
+          }
+          if (doc.positions[i].x_pos == 90) {
+            localxpos = 110
+            localypos = 110
+          }
+          if (doc.positions[i].x_pos == 110) {
+            localxpos = 50
+            localypos = 50
+          }
+        }
+
         doc.positions.push({
           node_id: uniqueid,
-          x_pos: 50,
-          y_pos: 50,
+          x_pos: localxpos,
+          y_pos: localypos,
           width: 220,
           height: 295,
-          z_index: 1,
+          z_index: 10,
           read_mode: false,
         })
         return pouchdb
-- 
GitLab