model-manager 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. package/administration/insert.js +179 -0
  2. package/administration/insert_one.js +33 -0
  3. package/administration/test_data.js +46 -0
  4. package/administration.html +76 -0
  5. package/app-update.yml +0 -0
  6. package/assets/css/admin.css +79 -0
  7. package/assets/css/basic.css +474 -0
  8. package/assets/css/checkout.css +517 -0
  9. package/assets/css/dialog.css +158 -0
  10. package/assets/css/dialog_checkout.css +156 -0
  11. package/assets/css/info.css +10 -0
  12. package/assets/logo.png +0 -0
  13. package/assets/partnerart.png +0 -0
  14. package/assets/spinner.gif +0 -0
  15. package/assets/three/GLTFLoader.js +4448 -0
  16. package/assets/three/ModelLoader.js +58 -0
  17. package/assets/three/OrbitControls.js +1252 -0
  18. package/assets/three/three.js +36819 -0
  19. package/assets/three/three.module.js +50708 -0
  20. package/assets/white/add_white_24dp.svg +1 -0
  21. package/assets/white/admin/person_add_FILL0_wght400_GRAD0_opsz48.svg +1 -0
  22. package/assets/white/admin/person_remove_FILL0_wght400_GRAD0_opsz48.svg +1 -0
  23. package/assets/white/admin.svg +1 -0
  24. package/assets/white/arrow_forward.svg +1 -0
  25. package/assets/white/brush_white_24dp.svg +1 -0
  26. package/assets/white/close_white_24dp.svg +1 -0
  27. package/assets/white/code_white_24dp.svg +1 -0
  28. package/assets/white/dashboard_white_24dp.svg +1 -0
  29. package/assets/white/done_white_24dp.svg +1 -0
  30. package/assets/white/emoji_people_white_24dp.svg +1 -0
  31. package/assets/white/filter_list_white_24dp.svg +1 -0
  32. package/assets/white/info_white_24dp.svg +1 -0
  33. package/assets/white/minimize_white_24dp.svg +1 -0
  34. package/assets/white/receipt_white_24dp.svg +1 -0
  35. package/assets/white/rocket_launch_white_24dp.svg +1 -0
  36. package/assets/white/search_black_24dp.svg +1 -0
  37. package/assets/white/search_white_24dp.svg +1 -0
  38. package/assets/white/settings_white_24dp.svg +1 -0
  39. package/assets/white/shopping_cart_white_24dp.svg +1 -0
  40. package/assets/white/store_white_24dp.svg +1 -0
  41. package/assets/white/timeline_white_24dp.svg +1 -0
  42. package/assets/white/view_in_ar_white_24dp.svg +1 -0
  43. package/checkout.html +131 -0
  44. package/checkout_admin.html +140 -0
  45. package/icon.png +0 -0
  46. package/imgs/armchair.png +0 -0
  47. package/imgs/arrow_tnt.png +0 -0
  48. package/imgs/bed_wnm.png +0 -0
  49. package/imgs/big_bed.png +0 -0
  50. package/imgs/birdscythe.png +0 -0
  51. package/imgs/blue_tnt.png +0 -0
  52. package/imgs/bull.png +0 -0
  53. package/imgs/carpet.png +0 -0
  54. package/imgs/chest.png +0 -0
  55. package/imgs/coin_stash.png +0 -0
  56. package/imgs/creeper_tnt.png +0 -0
  57. package/imgs/garbage_can.png +0 -0
  58. package/imgs/generator.png +0 -0
  59. package/imgs/golden_sword.png +0 -0
  60. package/imgs/highbed.png +0 -0
  61. package/imgs/jetpack1.png +0 -0
  62. package/imgs/jetpack2.png +0 -0
  63. package/imgs/jetpack3.png +0 -0
  64. package/imgs/jetpack4.png +0 -0
  65. package/imgs/jetpack5.png +0 -0
  66. package/imgs/jetpack6.png +0 -0
  67. package/imgs/karmincross.png +0 -0
  68. package/imgs/light_tnt.png +0 -0
  69. package/imgs/lucky_block.png +0 -0
  70. package/imgs/lucky_block_2.png +0 -0
  71. package/imgs/mega_tnt.png +0 -0
  72. package/imgs/modern_lamp.png +0 -0
  73. package/imgs/multiply_tnt.png +0 -0
  74. package/imgs/nuke.png +0 -0
  75. package/imgs/oak_tree.png +0 -0
  76. package/imgs/oak_tree_2.png +0 -0
  77. package/imgs/old_globe.png +0 -0
  78. package/imgs/scificannon_1.png +0 -0
  79. package/imgs/scificannon_10.png +0 -0
  80. package/imgs/scificannon_11.png +0 -0
  81. package/imgs/scificannon_12.png +0 -0
  82. package/imgs/scificannon_13.png +0 -0
  83. package/imgs/scificannon_14.png +0 -0
  84. package/imgs/scificannon_2.png +0 -0
  85. package/imgs/scificannon_3.png +0 -0
  86. package/imgs/scificannon_4.png +0 -0
  87. package/imgs/scificannon_5.png +0 -0
  88. package/imgs/scificannon_6.png +0 -0
  89. package/imgs/scificannon_7.png +0 -0
  90. package/imgs/scificannon_8.png +0 -0
  91. package/imgs/scificannon_9.png +0 -0
  92. package/imgs/simple_chair.png +0 -0
  93. package/imgs/small_car.png +0 -0
  94. package/imgs/small_modern_lamp.png +0 -0
  95. package/imgs/small_wardrobe.png +0 -0
  96. package/imgs/small_wooden_table.png +0 -0
  97. package/imgs/spike_sword.png +0 -0
  98. package/imgs/stone_holder.png +0 -0
  99. package/imgs/stone_sword.png +0 -0
  100. package/imgs/street_lamp.png +0 -0
  101. package/imgs/sword_1.png +0 -0
  102. package/imgs/sword_with_hole.png +0 -0
  103. package/imgs/testing.png +0 -0
  104. package/imgs/timer_tnt.png +0 -0
  105. package/imgs/tiny_tnt.png +0 -0
  106. package/imgs/tnt_cannon.png +0 -0
  107. package/imgs/wing_tnt.png +0 -0
  108. package/imgs/wooden_stool.png +0 -0
  109. package/imgs/wooden_wardrobe.png +0 -0
  110. package/index.html +178 -0
  111. package/index_admin.html +188 -0
  112. package/js/db/push_model.js +30 -0
  113. package/js/dialoges.js +23 -0
  114. package/js/item_functionality.js +7 -0
  115. package/js/load_cart.js +76 -0
  116. package/js/load_items.js +480 -0
  117. package/js/update.js +35 -0
  118. package/login.html +289 -0
  119. package/main.js +277 -0
  120. package/models/armchair.gltf +1 -0
  121. package/models/arrow_tnt.gltf +1 -0
  122. package/models/bedwnm.gltf +1 -0
  123. package/models/big_bed.gltf +1 -0
  124. package/models/birdscythe.gltf +1 -0
  125. package/models/blue_tnt.gltf +1 -0
  126. package/models/bull.gltf +1 -0
  127. package/models/carpet.gltf +1 -0
  128. package/models/chest.gltf +1 -0
  129. package/models/coin_stash.gltf +1 -0
  130. package/models/creeper_tnt.gltf +1 -0
  131. package/models/garbage_can.gltf +1 -0
  132. package/models/generator.gltf +1 -0
  133. package/models/golden_sword.gltf +1 -0
  134. package/models/highbed.gltf +1 -0
  135. package/models/jetpack1.gltf +1 -0
  136. package/models/jetpack2.gltf +1 -0
  137. package/models/jetpack3.gltf +1 -0
  138. package/models/jetpack4.gltf +1 -0
  139. package/models/jetpack5.gltf +1 -0
  140. package/models/jetpack6.gltf +1 -0
  141. package/models/karmincross.gltf +1 -0
  142. package/models/light_tnt.gltf +1 -0
  143. package/models/lucky_block.gltf +1 -0
  144. package/models/lucky_block_2.gltf +1 -0
  145. package/models/mega_tnt.gltf +1 -0
  146. package/models/modern_lamp.gltf +1 -0
  147. package/models/multiply_tnt.gltf +1 -0
  148. package/models/nuke.gltf +1 -0
  149. package/models/oak_tree.gltf +1 -0
  150. package/models/oak_tree_2.gltf +1 -0
  151. package/models/old globe.gltf +1 -0
  152. package/models/scificannon_1.gltf +1 -0
  153. package/models/scificannon_10.gltf +1 -0
  154. package/models/scificannon_11.gltf +1 -0
  155. package/models/scificannon_12.gltf +1 -0
  156. package/models/scificannon_13.gltf +1 -0
  157. package/models/scificannon_14.gltf +1 -0
  158. package/models/scificannon_2.gltf +1 -0
  159. package/models/scificannon_3.gltf +1 -0
  160. package/models/scificannon_4.gltf +1 -0
  161. package/models/scificannon_5.gltf +1 -0
  162. package/models/scificannon_6.gltf +1 -0
  163. package/models/scificannon_7.gltf +1 -0
  164. package/models/scificannon_8.gltf +1 -0
  165. package/models/scificannon_9.gltf +1 -0
  166. package/models/simple_chair.gltf +1 -0
  167. package/models/small_car.gltf +1 -0
  168. package/models/small_modern_lamp.gltf +1 -0
  169. package/models/small_wardrobe.gltf +1 -0
  170. package/models/small_wooden_table.gltf +1 -0
  171. package/models/spike_sword.gltf +1 -0
  172. package/models/stone_holder.gltf +1 -0
  173. package/models/stone_sword.gltf +1 -0
  174. package/models/street_lamp.gltf +1 -0
  175. package/models/sword_1.gltf +1 -0
  176. package/models/sword_with_hole.gltf +1 -0
  177. package/models/timer_tnt.gltf +1 -0
  178. package/models/tiny_tnt.gltf +1 -0
  179. package/models/tnt_cannon.gltf +1 -0
  180. package/models/wing_tnt.gltf +1 -0
  181. package/models/wooden_stool.gltf +1 -0
  182. package/models/wooden_wardrobe.gltf +1 -0
  183. package/package.json +47 -0
  184. package/preload.js +26 -0
  185. package/update.html +48 -0
package/index.html ADDED
@@ -0,0 +1,178 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
6
+ <link href="./assets/css/basic.css" rel="stylesheet">
7
+ <link href="./assets/css/dialog.css" rel="stylesheet">
8
+ </head>
9
+ <body>
10
+
11
+
12
+ <section id="head">
13
+ <div class="drag-field-head">
14
+ <p class="drag-field-text">MN-Modelstore</p>
15
+ </div>
16
+ <div class="win-btn">
17
+ <a class="btn-win" id="close-button">
18
+ <img src="assets/white/close_white_24dp.svg" style="display: flex;">
19
+ </a>
20
+ </div>
21
+ </section>
22
+
23
+
24
+ <section id="sidebar">
25
+ <section class="title-container">
26
+ <img src="assets/logo.png" width="70px" alt="logo">
27
+ </section>
28
+ <section class="links-container">
29
+ <div class="links active">
30
+ <div class="icon">
31
+ <img src="assets/white/store_white_24dp.svg">
32
+ </div>
33
+ <span>Browse</span>
34
+ </div>
35
+ <div class="links" id="checkout-side">
36
+ <div class="icon">
37
+ <img src="assets/white/receipt_white_24dp.svg">
38
+ </div>
39
+ <span class="underline-hovered">Checkout</span>
40
+ </div>
41
+ </section>
42
+ </section>
43
+
44
+
45
+
46
+ <section id="main-content">
47
+
48
+ <div id="loading">
49
+ <h3 id="loading-text">loading...</h3>
50
+ <img id="loading-image" src="assets/spinner.gif" alt="Loading..." width="70px"/>
51
+ </div>
52
+
53
+
54
+ <section id="top-section">
55
+ <div class="input-box" >
56
+ <div class="input-icon">
57
+ <img src="assets/white/search_white_24dp.svg">
58
+ </div>
59
+ <input placeholder="Search..." data-search>
60
+
61
+ </div>
62
+ <!-- THIS NEEDS TO BE IMPLEMENTED -->
63
+ <!-- <div class="action-icons">
64
+ <div class="action-icon-one">
65
+ <img class="action-icons" src="assets/white/filter_list_white_24dp.svg" width="25px">
66
+ </div>
67
+ </div> -->
68
+ </section>
69
+
70
+ <h3 class="result-headline">Results: </h3>
71
+
72
+ <!-- All items listed in here -->
73
+ <section id="items">
74
+ <template data-item-template>
75
+ <div class="grid-item" id="template">
76
+ <div class="grid-picture">
77
+ <img src="assets/testing.png" width="190px">
78
+ </div>
79
+ <h4 class="grid-label">Testmodel</h4>
80
+ <div class="grid-blur"></div>
81
+ <div class="grid-data">
82
+ <div class="grid-textures">
83
+ <span data-tooltip="Textures" data-flow="bottom">
84
+ <img src="assets/white/brush_white_24dp.svg">
85
+ </span>
86
+ </div>
87
+ <div class="grid-anims">
88
+ <span data-tooltip="Animations" data-flow="bottom">
89
+ <img src="assets/white/emoji_people_white_24dp.svg">
90
+ </span>
91
+ </div>
92
+ <div class="grid-behavior">
93
+ <span data-tooltip="Behavior" data-flow="bottom">
94
+ <img src="assets/white/code_white_24dp.svg">
95
+ </span>
96
+ </div>
97
+ <div class="grid-view-vr">
98
+ <span data-tooltip="3D View" data-flow="bottom" id="">
99
+ <img src="assets/white/view_in_ar_white_24dp.svg">
100
+ </span>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </template>
105
+ </section>
106
+ </section>
107
+ <!--transition-->
108
+ <main id="swup" class="transition-fade">
109
+ <h1>Cart</h1>
110
+ </main>
111
+ <!--Renderer-->
112
+ <div id="body-overlay"></div>
113
+ <div class="dialog" id="item-dialog">
114
+ <a href="#" role="button" class="dialog-close-button" id="dialog-close-button">
115
+ <image src="assets/white/close_white_24dp.svg"> </image>
116
+ </a>
117
+ <h3 id="item-dialog-name" style="float: left;">MODELNAME</h3>
118
+ <h4 id="item-dialog-creator" style="font-weight: lighter; float: left; margin-left: 5px;">by Tristan</h4>
119
+
120
+ <div class="model-content">
121
+ <div class="model-view-text">
122
+ <div class="multi-textures">
123
+ <h3>Texture Variants:</h3>
124
+ <div class="behavior_list" id="textures_listing">
125
+ <label class="control control-checkbox">
126
+ Idle
127
+ <input type="checkbox" />
128
+ <div class="control_indicator"></div>
129
+ </label>
130
+ </div>
131
+ </div>
132
+ <div class="multi-animations">
133
+ <h3>Animations:</h3>
134
+ <div class="behavior_list" id="animation_listing">
135
+ <label class="control control-checkbox">
136
+ Idle
137
+ <input type="checkbox" />
138
+ <div class="control_indicator"></div>
139
+ </label>
140
+ </div>
141
+ </div>
142
+ <div class="multi-behaviors">
143
+ <h3>Behaviors:</h3>
144
+ <div class="behavior_list" id="behavior_listing">
145
+ </div>
146
+ </div>
147
+ <a class="add-to-cart" id="addtocart">
148
+ Add to cart
149
+ </a>
150
+ </div>
151
+ <div id="model-view" class="model-view">
152
+
153
+ </div>
154
+ </div>
155
+ </div>
156
+ <script>
157
+ document.getElementById("close-button").addEventListener('click', event => {
158
+ window.api.send("toMain", "closeWindow");
159
+ });
160
+ document.getElementById("checkout-side").onclick = function () {
161
+ location.href = "./checkout.html";
162
+ };
163
+ </script>
164
+
165
+ <!-- three.js -->
166
+ <script src="assets/three/three.js"></script>
167
+ <script type="module" src="assets/three/GLTFLoader.js"></script>
168
+ <script type="module">
169
+
170
+
171
+ </script>
172
+
173
+ <script type="module" src="./js/load_items.js">
174
+ </script>
175
+ <script src="./js/dialoges.js">
176
+ </script>
177
+ </body>
178
+ </html>
@@ -0,0 +1,188 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
6
+ <link href="./assets/css/basic.css" rel="stylesheet">
7
+ <link href="./assets/css/dialog.css" rel="stylesheet">
8
+ </head>
9
+ <body>
10
+
11
+
12
+ <section id="head">
13
+ <div class="drag-field-head">
14
+ <p class="drag-field-text">MN-Modelstore</p>
15
+ </div>
16
+ <div class="win-btn">
17
+ <a class="btn-win" id="close-button">
18
+ <img src="assets/white/close_white_24dp.svg" style="display: flex;">
19
+ </a>
20
+ </div>
21
+ </section>
22
+
23
+
24
+ <section id="sidebar">
25
+ <section class="title-container">
26
+ <img src="assets/logo.png" width="70px" alt="logo">
27
+ </section>
28
+ <section class="links-container">
29
+ <div class="links active">
30
+ <div class="icon">
31
+ <img src="assets/white/store_white_24dp.svg">
32
+ </div>
33
+ <span>Browse</span>
34
+ </div>
35
+ <div class="links" id="checkout-side">
36
+ <div class="icon">
37
+ <img src="assets/white/receipt_white_24dp.svg">
38
+ </div>
39
+ <span class="underline-hovered">Checkout</span>
40
+ </div>
41
+ <div class="links" id="admin_panel">
42
+ <div class="icon">
43
+ <img width="32px" height="37px" src="assets/white/admin.svg">
44
+ </div>
45
+ <span class="underline-hovered">Admin</span>
46
+ </div>
47
+ </section>
48
+ </section>
49
+
50
+
51
+
52
+ <section id="main-content">
53
+
54
+ <div id="loading">
55
+ <h3 id="loading-text">loading...</h3>
56
+ <img id="loading-image" src="assets/spinner.gif" alt="Loading..." width="70px"/>
57
+ </div>
58
+
59
+
60
+ <section id="top-section">
61
+ <div class="input-box" >
62
+ <div class="input-icon">
63
+ <img src="assets/white/search_white_24dp.svg">
64
+ </div>
65
+ <input placeholder="Search..." data-search>
66
+
67
+ </div>
68
+ <!-- THIS NEEDS TO BE IMPLEMENTED -->
69
+ <!-- <div class="action-icons">
70
+ <div class="action-icon-one">
71
+ <img class="action-icons" src="assets/white/filter_list_white_24dp.svg" width="25px">
72
+ </div>
73
+ </div> -->
74
+ </section>
75
+
76
+ <h3 class="result-headline">Results: </h3>
77
+
78
+ <!-- All items listed in here -->
79
+ <section id="items">
80
+ <template data-item-template>
81
+ <div class="grid-item" id="template">
82
+ <div class="grid-picture">
83
+ <img src="assets/testing.png" width="190px">
84
+ </div>
85
+ <h4 class="grid-label">Testmodel</h4>
86
+
87
+ <div class="grid-data">
88
+ <div class="grid-textures">
89
+ <span data-tooltip="Textures" data-flow="bottom">
90
+ <img src="assets/white/brush_white_24dp.svg">
91
+ </span>
92
+ </div>
93
+ <div class="grid-anims">
94
+ <span data-tooltip="Animations" data-flow="bottom">
95
+ <img src="assets/white/emoji_people_white_24dp.svg">
96
+ </span>
97
+ </div>
98
+ <div class="grid-behavior">
99
+ <span data-tooltip="Behavior" data-flow="bottom">
100
+ <img src="assets/white/code_white_24dp.svg">
101
+ </span>
102
+ </div>
103
+ <div class="grid-view-vr">
104
+ <span data-tooltip="3D View" data-flow="bottom" id="">
105
+ <img src="assets/white/view_in_ar_white_24dp.svg">
106
+ </span>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </template>
111
+ </section>
112
+ </section>
113
+ <!--transition-->
114
+ <main id="swup" class="transition-fade">
115
+ <h1>Cart</h1>
116
+ </main>
117
+ <!--Renderer-->
118
+ <div id="body-overlay"></div>
119
+ <div class="dialog" id="item-dialog">
120
+ <a href="#" role="button" class="dialog-close-button" id="dialog-close-button">
121
+ <image src="assets/white/close_white_24dp.svg"> </image>
122
+ </a>
123
+ <h3 id="item-dialog-name" style="float: left;">MODELNAME</h3>
124
+ <h4 id="item-dialog-creator" style="font-weight: lighter; float: left; margin-left: 5px;">by Tristan</h4>
125
+
126
+ <div class="model-content">
127
+ <div class="model-view-text">
128
+ <div class="multi-textures">
129
+ <h3>Texture Variants:</h3>
130
+ <div class="behavior_list" id="textures_listing">
131
+ <label class="control control-checkbox">
132
+ Idle
133
+ <input type="checkbox" />
134
+ <div class="control_indicator"></div>
135
+ </label>
136
+ </div>
137
+ </div>
138
+ <div class="multi-animations">
139
+ <h3>Animations:</h3>
140
+ <div class="behavior_list" id="animation_listing">
141
+ <label class="control control-checkbox">
142
+ Idle
143
+ <input type="checkbox" />
144
+ <div class="control_indicator"></div>
145
+ </label>
146
+ </div>
147
+ </div>
148
+ <div class="multi-behaviors">
149
+ <h3>Behaviors:</h3>
150
+ <div class="behavior_list" id="behavior_listing">
151
+ </div>
152
+ </div>
153
+ <a class="add-to-cart" id="addtocart">
154
+ Add to cart
155
+ </a>
156
+ </div>
157
+ <div id="model-view" class="model-view">
158
+
159
+ </div>
160
+ </div>
161
+ </div>
162
+ <script>
163
+ document.getElementById("close-button").addEventListener('click', event => {
164
+ window.api.send("toMain", "closeWindow");
165
+ });
166
+ document.getElementById("checkout-side").onclick = function () {
167
+ location.href = "./checkout_admin.html";
168
+ };
169
+
170
+ document.getElementById("admin_panel").onclick = function () {
171
+ location.href = "./administration.html";
172
+ };
173
+ </script>
174
+
175
+ <!-- three.js -->
176
+ <script src="assets/three/three.js"></script>
177
+ <script type="module" src="assets/three/GLTFLoader.js"></script>
178
+ <script type="module">
179
+
180
+
181
+ </script>
182
+
183
+ <script type="module" src="./js/load_items.js">
184
+ </script>
185
+ <script src="./js/dialoges.js">
186
+ </script>
187
+ </body>
188
+ </html>
@@ -0,0 +1,30 @@
1
+ const { MongoClient, ServerApiVersion } = require('mongodb');
2
+ const uri = "mongodb+srv://adminmn:eQJ62Cszrvi7VgD@mnmodeldatabase.zsxqn.mongodb.net/myFirstDatabase?retryWrites=true&w=majority";
3
+ const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
4
+
5
+ const database = client.db("modeldatabase");
6
+ const models = database.collection("models");
7
+
8
+
9
+ function push(model_name, model_creator, model_path, thumbnail, has_anims, has_behavior, has_textures, animations, behaviors, textures, tags) {
10
+ client.connect(err => {
11
+ if (err) throw err;
12
+ var modelobj = {
13
+ released: true, model_name: model_name, model_creator: model_creator,
14
+ model_path: model_path, thumbnail: thumbnail, has_anims: has_anims, has_behavior: has_behavior,
15
+ has_textures: has_textures,
16
+ animations: animations,
17
+ behavior: behaviors,
18
+ textures: textures,
19
+ tags: tags
20
+ }
21
+ models.insertOne(modelobj);
22
+
23
+ models.find().forEach( function(item) {
24
+ item.animations.forEach(function (item, index) {
25
+
26
+ });
27
+ });
28
+ });
29
+ client.close();
30
+ }
package/js/dialoges.js ADDED
@@ -0,0 +1,23 @@
1
+ document.getElementById('body-overlay').addEventListener('click', function(e) {
2
+ document.getElementById("item-dialog").classList.remove("visable");
3
+ document.getElementById("body-overlay").classList.remove("visable");
4
+ });
5
+
6
+ document.getElementById('dialog-close-button').addEventListener('click', function(e) {
7
+ document.getElementById("item-dialog").classList.remove("visable");
8
+ document.getElementById("body-overlay").classList.remove("visable");
9
+ });
10
+
11
+ document.onkeydown = function(evt) {
12
+ evt = evt || window.event;
13
+ var isEscape = false;
14
+ if ("key" in evt) {
15
+ isEscape = (evt.key === "Escape" || evt.key === "Esc");
16
+ } else {
17
+ isEscape = (evt.keyCode === 27);
18
+ }
19
+ if (isEscape) {
20
+ document.getElementById("item-dialog").classList.remove("visable");
21
+ document.getElementById("body-overlay").classList.remove("visable");
22
+ }
23
+ };
@@ -0,0 +1,7 @@
1
+ document.querySelectorAll('.grid-item').forEach(function(item) {
2
+ item.addEventListener('click', function() {
3
+ document.getElementById("item-dialog").classList.add("visable");
4
+ document.getElementById("body-overlay").classList.add("visable");
5
+ document.getElementById("item-dialog-name").innerText = item.dataset.identifier;
6
+ });
7
+ });
@@ -0,0 +1,76 @@
1
+ import { GLTFLoader } from '../assets/three/GLTFLoader.js'
2
+ import { OrbitControls } from '../assets/three/OrbitControls.js'
3
+
4
+ var newCart = [];
5
+ // define cart
6
+ window.api.send("cart_request", "rq")
7
+ window.api.receive('cart_answer', function (data, evt) {
8
+ newCart = [...new Set(data)];;
9
+ });
10
+
11
+
12
+ window.api.send("database_request", "rqID");
13
+
14
+ const items = []
15
+ window.api.receive('item_channel', function (data, evt) {
16
+ items.push(data)
17
+ if (newCart.includes(data[0].modelname)) {
18
+ var item = document.createElement('div');
19
+ item.className = "grid-item";
20
+ item.dataset.identifier = data[0].count;
21
+ // grid picture div
22
+ var grid_pic = document.createElement('div');
23
+ grid_pic.className = "grid-picture";
24
+ var grid_pic_img = document.createElement('img');
25
+ // get img path
26
+ grid_pic_img.src = data[0].thumbnail;
27
+ grid_pic_img.width = 190;
28
+ grid_pic.appendChild(grid_pic_img);
29
+ item.appendChild(grid_pic);
30
+ // grid label
31
+ var grid_label = document.createElement('h4');
32
+ grid_label.className = "grid-label"
33
+ grid_label.innerText = data[0].modelname
34
+ item.appendChild(grid_label)
35
+ // add item to items sections
36
+ document.getElementById('items').appendChild(item);
37
+ item.dataset.modelname = data[0].modelname
38
+ item.dataset.modelcreator = data[0].modelcreator
39
+ item.dataset.modelpath = data[0].model_path
40
+
41
+ // create li
42
+ var catalog_item = document.createElement('li');
43
+ catalog_item.innerHTML = data[0].modelname
44
+ catalog_item.id = data[0].modelname
45
+
46
+ document.getElementById('checkout_catalog').appendChild(catalog_item);
47
+
48
+
49
+ // var catlog_removal = document.createElement('a');
50
+ // catlog_removal.id = "remove_item_from_checkout";
51
+ // catlog_removal.innerHTML = "Remove"
52
+ // document.getElementById(data[0].modelname).appendChild(catlog_removal);
53
+
54
+
55
+ // set item data so we can work with it later
56
+ item.dataset.behaviors = data[0].behaviors
57
+ item.dataset.textures = data[0].textures
58
+ item.dataset.animation = data[0].animations
59
+ item.dataset.tags = data[0].tags
60
+ }
61
+ });
62
+
63
+
64
+ window.api.receive('renderer', function (data, evt) {
65
+ if(data = "stop-spinner") {
66
+ document.getElementById("loading").remove()
67
+ }
68
+ if (newCart.length == 0) {
69
+ let no_results = document.createElement("h2");
70
+ no_results.textContent = "Your Cart is empty!"
71
+ document.getElementById("action-icon-one").remove();
72
+ document.getElementById("items").appendChild(no_results)
73
+ }
74
+
75
+
76
+ });