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

Wishlist new component #238

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
667 changes: 666 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^14.4.3",
"aframe": "^1.5.0",
"aframe-react": "^4.4.0",
"qrcode.react": "^3.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-lazyload": "^3.2.0",
"react-router-dom": "^6.16.0",
"react-scripts": "5.0.1",
"web-vitals": "^3.5.0"
"web-vitals": "^3.5.0",
"zustand": "^4.5.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
63 changes: 63 additions & 0 deletions public/ar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
</head>
<body>
<!-- Copyright (c) 2022 8th Wall, Inc. -->
<!-- body.html is optional; elements will be added to your html body after app.js is loaded. -->

<a-scene
xrextras-gesture-detector
landing-page
xrextras-loading
xrextras-runtime-error
renderer="colorManagement:true; webgl2: true;"
xrweb="disableWorldTracking: true"
>
<a-assets>
<a-asset-item
id="jelly-glb"
src="assets/jellyfish-model.glb"
></a-asset-item>
<img id="jelly-thumb" src="assets/video-thumbnail.jpg" />
<video
id="jelly-video"
autoplay
muted
crossorigin="anonymous"
loop="true"
src="assets/jellyfish-video.mp4"
></video>
</a-assets>

<a-camera
position="0 4 10"
raycaster="objects: .cantap"
cursor="fuse: false; rayOrigin: mouse;"
>
</a-camera>

<a-light type="directional" intensity="0.5" position="1 1 1"></a-light>

<a-light type="ambient" intensity="0.7"></a-light>

<!-- Note: "name:" must be set to the name of the image target uploaded to the 8th Wall Console -->
<xrextras-named-image-target name="video-target">
<a-entity
xrextras-play-video="video: #jelly-video; thumb: #jelly-thumb; canstop: true"
geometry="primitive: plane; height: 1; width: 0.79;"
></a-entity>
</xrextras-named-image-target>

<!-- Note: "name:" must be set to the name of the image target uploaded to the 8th Wall Console -->
<xrextras-named-image-target name="model-target">
<!-- Add a child entity that can be rotated independently of the image target. -->
<a-entity xrextras-one-finger-rotate gltf-model="#jelly-glb"></a-entity>
</xrextras-named-image-target>
</a-scene>
</body>
</html>
Binary file added public/assets/flyer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/jellyfish-model.glb
Binary file not shown.
Binary file added public/assets/jellyfish-video.mp4
Binary file not shown.
Binary file added public/assets/video-thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/wish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/wished.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@
padding: 0.2rem;
}

.wishlist-btn {
background-color: rgba(0, 0, 0, 0.284);
bottom: 19px;
right: 1rem;
border: none;
border-radius: 100%;
color: #fff;
cursor: pointer;
position: absolute;
width: 2rem;
height: 2rem;
display: grid;
place-items: center;
aspect-ratio: 1/1;
font-weight: 600;
font-size: 1.5rem;
padding: 0.2rem;
}

.help-btn span,
.fullscreen-btn span {
width: 50px;
Expand Down
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ import Contact from "./components/Contact/Contact";
import Footer from "./components/Footer/Footer";
import Header from "./components/Header/Header";
import Feedback from "./components/Feedback/Feedback";
import Test from "./test";

const App = () => {
return (
<BrowserRouter>
<Header />
{/* <Header /> */}
<Routes>
<Route path="/" element={<ProductList />} />
<Route path="/about" element={<About />} />
<Route path="/feedback" element={<Feedback />} />
<Route path="/contact" element={<Contact />} />
<Route path="*" element={<ErrorPage />} />
<Route path="/ar-demo" element={<Test />} />
</Routes>
<Footer />
{/* <Footer /> */}
</BrowserRouter>
);
};
Expand Down
52 changes: 52 additions & 0 deletions src/assets/css/wishlistbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.wishlist-bar {
position: fixed;
top: 0;
right: -100%; /* Adjust as needed to set the initial position */
width: 100%;
height: 100vh;
z-index: 10;
max-width: 500px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
overflow: hidden scroll;
display: flex;
flex-direction: column;
gap: 20px;
transition: right 0.3s ease-in-out;
}

.wishlist-bar.open {
right: 0;
}
.wishlist-toggle-close {
background-color: #db4534;
color: #fff;
padding: 10px;
border: none;
cursor: pointer;
}
.wishlist-toggle {
display: flex;
justify-content: center;
align-items: center;
color: #fff;
max-height: 50px;
font-size: large;
font-weight: 500;
padding: 10px;
background: none;
border: none;
gap: 10px;
cursor: pointer;
}
.wishlist-toggle img{
height: 40px;
width: 40px;
}
.wishlist-content {
padding: 20px;
}

.wishlist-item {
margin-bottom: 10px;
}
Binary file added src/assets/models/export.glb
Binary file not shown.
42 changes: 25 additions & 17 deletions src/components/Feedback/Feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ const Feedback = () => {
let feature = document.getElementById("features").value;
let comment = document.getElementById("comments").value;

let body = "Name of the User: <br/>" + usersname + "<br/>" + "Email of the User: <br/>" + usersemail + "<br/><br/>" +
let body =
"Name of the User: <br/>" +
usersname +
"<br/>" +
"Email of the User: <br/>" +
usersemail +
"<br/><br/>" +
"What did you like most about AR-Webstore? <br/>" +
likes +
"<br/><br/> Will our 3D and AR features improve your shopping experience if we integrate it on an online e-commerce store ?<br/>" +
Expand All @@ -41,8 +47,6 @@ const Feedback = () => {
"<br/> <br/>Any other comments?<br/>" +
comment;

console.log(body);

window.Email.send({
Host: "smtp.elasticemail.com",
Username: "shwetkhatri2001@gmail.com",
Expand All @@ -52,33 +56,37 @@ const Feedback = () => {
Subject: "AR-Webstore has got a feedback",
Body: body,
}).then((message) => {
if (message === "OK") {
window.swal(
if (message === "OK") {
window
.swal(
"Successfull",
"Thanks! We've received your feedback",
"success"
).then(() => {
formRef.current.reset();
)
.then(() => {
formRef.current.reset();
});
} else {
window.swal(
"Something Wrong",
"Your FeedBack is not Received",
"error"
);
}
});
} else {
window.swal(
"Something Wrong",
"Your FeedBack is not Received",
"error"
);
}
});
};

return (
<div className="container">
<h1>Your Feedback ✍️ Our Evolution 🚀</h1>
<form ref={formRef} onSubmit={(e) => e.preventDefault()}>
<label htmlFor="username">Name:</label><br/>
<label htmlFor="username">Name:</label>
<br />
<input type="text" id="username" placeholder="Your Name..." />
<br />

<label htmlFor="useremail">Email:</label><br/>
<label htmlFor="useremail">Email:</label>
<br />
<input type="text" id="useremail" placeholder="Your Email..." />
<br />

Expand Down
9 changes: 8 additions & 1 deletion src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import "./styles.css";
import WishList from "../WishList";

const Header = () => {
const navigationLinks = [
Expand Down Expand Up @@ -29,7 +30,12 @@ const Header = () => {
onClick={() => setShowMobileSidebar(!showMobileSidebar)}
>
{Array.from({ length: 2 + showMobileSidebar }, (_, i) => (
<div key={i} className={i === 0 ? "firstbar" : i === 1 ? "secondbar" : "lastbar"}/>
<div
key={i}
className={
i === 0 ? "firstbar" : i === 1 ? "secondbar" : "lastbar"
}
/>
))}
{/* If the condition is true, only the first, second, and last div elements will be rendered. */}
</div>
Expand All @@ -46,6 +52,7 @@ const Header = () => {
})}
</ul>
</nav>
<WishList />
</header>
);
};
Expand Down
Loading