diff --git a/src/assets/glb/shelf.glb b/src/assets/glb/shelf.glb new file mode 100644 index 0000000..6d1b3ba Binary files /dev/null and b/src/assets/glb/shelf.glb differ diff --git a/src/assets/glb/shopping_cart.glb b/src/assets/glb/shopping_cart.glb new file mode 100644 index 0000000..35562d7 Binary files /dev/null and b/src/assets/glb/shopping_cart.glb differ diff --git a/src/assets/glb/shopping_cart2.glb b/src/assets/glb/shopping_cart2.glb new file mode 100644 index 0000000..e1e7bb5 Binary files /dev/null and b/src/assets/glb/shopping_cart2.glb differ diff --git a/src/assets/glb/shopping_cart3.glb b/src/assets/glb/shopping_cart3.glb new file mode 100644 index 0000000..3638610 Binary files /dev/null and b/src/assets/glb/shopping_cart3.glb differ diff --git a/src/assets/img/appletexture.jpg b/src/assets/img/appletexture.jpg new file mode 100644 index 0000000..0b0a91b Binary files /dev/null and b/src/assets/img/appletexture.jpg differ diff --git a/src/assets/img/luckycharms.jpeg b/src/assets/img/luckycharms.jpeg new file mode 100644 index 0000000..bbde7ed Binary files /dev/null and b/src/assets/img/luckycharms.jpeg differ diff --git a/src/assets/img/watermellontexture.jpg b/src/assets/img/watermellontexture.jpg new file mode 100644 index 0000000..964274c Binary files /dev/null and b/src/assets/img/watermellontexture.jpg differ diff --git a/src/css/addtocart.css b/src/css/addtocart.css new file mode 100644 index 0000000..70c17df --- /dev/null +++ b/src/css/addtocart.css @@ -0,0 +1,15 @@ +.popup{ + position: fixed; + top:100px; + left: 0px; + width:100vw; + height: 100vw; + background: rgba(0,0,0,0.7); + z-index: 1; +} + +.popup .content { + position: absolute; + top: 50%; + left: 50% +} diff --git a/src/css/cart.css b/src/css/cart.css new file mode 100644 index 0000000..74bcf8c --- /dev/null +++ b/src/css/cart.css @@ -0,0 +1,92 @@ +body{ + font-family:'Courier New', Courier, monospace; + margin: 0; +} + +.container{ + margin: auto; + text-align: center; + position: fixed; + left: 70%; + top: 5%; + + +} + +.container h1{ + left: 70%; + top: 0.5%; + position: fixed; + +} + + +svg{ + width: 30px; + left: 90%; + top:1.5%; + position: fixed; +} + + + +header .icon-cart span{ + display: flex; + width: 30px; + height: 30px; + background-color: red; + justify-content: center; + align-items: center; + color:#fff; + border-radius: 50%; + position: fixed; + top: 4%; + right: 2px; +} + +.cartTab{ + width: 300px; + background-color: #35343200; + color: #eee; + position: fixed; + inset: 0 0 0 auto; + left: 80%; + +} + +body .showCart .cartTab{ + inset: 0 0 0 auto; +} + +body.showCart + +.cartTab .listCart .item img{ + width: 100%; +} + +.cartTab .listCart .item{ + align-items: center; +} + +.listCart .quantity span{ + display: inline-block; + width: 25px; + height: 25px; + background-color: #eee; + color: #555; + border-radius: 50%; +} + +.listCart{ + overflow: auto; +} + +.listCart::-webkit-scrollbar{ + width: 0; +} + + + + + + diff --git a/src/css/examples.css b/src/css/examples.css index a4be4f4..27264b4 100644 --- a/src/css/examples.css +++ b/src/css/examples.css @@ -1,3 +1,6 @@ + +@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); + * { margin: 0; padding: 0; @@ -24,3 +27,72 @@ div#info-text { div#info-text p { margin-bottom: 16px; } + +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap'); + + + + + +.btn{ + padding: 10px 60px; + background: #fff; + border: 0; + outline: none; + cursor: pointer; + font-size: 22px; + font-weight: 500; + border-radius: 10px; + transition: transform 0.2s; +} + +.btn:active{ + transform: scale(0.95); +} + +.popup{ + width: 400px; + background: #fff; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + position: fixed; + top: 0; + left: 50%; + transform: translate(-50%, -50%) scale(0.1); + text-align: center; + padding: 0 30px 60px; + color: #333; + visibility: hidden; + transition: all 0.4s ease-in-out; +} + +.open-popup{ + visibility: visible; + top: 50%; + transform: translate(-50%, -50%) scale(1); +} + +.popup img{ + width: 100px; +} + +.popup h2{ + font-size: 38px; + font-weight: 500; + margin: 30px 0 10px; +} + +.popup button{ + width: 100%; + margin-top: 50px; + padding: 10px 0; + background-color: #e02189; + color: #fff; + border: 0; + outline: none; + font-size: 18px; + border-radius: 4px; + box-shadow: 0 5px 5px rgba(0,0,0,0.2); +} + diff --git a/src/examples/3rd-person-camera.html b/src/examples/3rd-person-camera.html index 7a393d9..8d888a4 100644 --- a/src/examples/3rd-person-camera.html +++ b/src/examples/3rd-person-camera.html @@ -7,16 +7,21 @@ content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" /> - 3rd Person Camera + - + + + + + -
Use WASD, SPACE and your Mouse.
Works on mobile and desktop.
+ +
+ + + +
+

Items

+ + +
+ + diff --git a/src/examples/medieval-fantasy-book-standalone.html b/src/examples/medieval-fantasy-book-standalone.html index 72b368c..812acbc 100644 --- a/src/examples/medieval-fantasy-book-standalone.html +++ b/src/examples/medieval-fantasy-book-standalone.html @@ -176,15 +176,7 @@ /** * Add Pointer Lock and Pointer Drag */ - if (!isTouchDevice) { - let pl = new PointerLock(this.canvas) - let pd = new PointerDrag(this.canvas) - pd.onMove(delta => { - if (pl.isLocked()) { - this.controls.update(delta.x * 2, delta.y * 2) - } - }) - } + } addBook() @@ -223,7 +215,7 @@ /** * Add joystick */ - if (isTouchDevice) { + const joystick = new JoyStick() const axis = joystick.add.axis({ styles: { left: 35, bottom: 35, size: 100 } @@ -247,7 +239,7 @@ }) buttonB.onClick(() => (this.move = true)) buttonB.onRelease(() => (this.move = false)) - } + setTimeout(() => { const placeholder = document.getElementById('welcome-game-placeholder') diff --git a/src/examples/use-native-three-code.html b/src/examples/use-native-three-code.html index 01d4d4e..3de73c7 100644 --- a/src/examples/use-native-three-code.html +++ b/src/examples/use-native-three-code.html @@ -12,6 +12,11 @@ + + + + + diff --git a/src/js/cart.js b/src/js/cart.js new file mode 100644 index 0000000..b28b04f --- /dev/null +++ b/src/js/cart.js @@ -0,0 +1,3 @@ + + +