diff --git a/README.md b/README.md index a1d182c..dff1484 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# SuperSimple3444 \ No newline at end of file +# SuperSimple3444 +https://evanharr.github.io/SuperSimple3444/#/SuperSimple3444 diff --git a/public/index.html b/public/index.html index 2ae42fa..76bc967 100644 --- a/public/index.html +++ b/public/index.html @@ -25,6 +25,26 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Car Website + - - +
+ + +
+ + +
+ + + diff --git a/src/3d/LandCruiser.glb b/src/3d/LandCruiser.glb new file mode 100644 index 0000000..48bb7d1 Binary files /dev/null and b/src/3d/LandCruiser.glb differ diff --git a/src/Account.jsx b/src/Account.jsx index fa87e57..21d9cac 100644 --- a/src/Account.jsx +++ b/src/Account.jsx @@ -108,7 +108,7 @@ function Account (){ sx={{ flexGrow: '1', position: 'absolute', - top: '80%', + top: '55%', left: '50%', transform: 'translate(-50%, -50%)', width: 600, @@ -124,49 +124,47 @@ function Account (){ alignItems='center' > - - Account Information + + Account Information + + + Click the Field you wish to edit - - - -

Name:

+ {setEditNameOpen(true)}}> + +

Name:

{firstName}   {lastName}

- - -
+
- - + {setEditEmailOpen(true)}}> +

Email Address:

{email}

- -
+ +
- - -

Address

{address}

- -
+ {setEditAddressOpen(true)}}> + +

Address:

{address}

+
- - -

Date of Birth

{DOB}

- -
+ {setEditDOBOpen(true)}}> + +

Date of Birth:

{DOB}

+
- + {setEditPasswordOpen(true)}}>

Password:

******

- -
+ +
@@ -196,7 +194,7 @@ function Account (){ )} {!payInfoExists && ( - + )} @@ -204,7 +202,7 @@ function Account (){ Vehicle Configuration - + diff --git a/src/AccountEdit.jsx b/src/AccountEdit.jsx index 264f555..d260061 100644 --- a/src/AccountEdit.jsx +++ b/src/AccountEdit.jsx @@ -71,7 +71,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Register

+

Register

diff --git a/src/App.js b/src/App.js index 0ed3537..d35db36 100644 --- a/src/App.js +++ b/src/App.js @@ -9,11 +9,13 @@ import Cart from './Cart' import Checkout from './Checkout' import CarConfig from './CarConfig' import SavedCarConfig from './SavedCarConfig' +import LandCruiserConfig from './LandCruiserConfig' import { AuthProvider } from "./AuthContext" import Register from "./register2" function App() { return( +
@@ -28,7 +30,7 @@ function App() { }> }> }> - + }> diff --git a/src/CarConfig.jsx b/src/CarConfig.jsx index 632e938..9b3cf3b 100644 --- a/src/CarConfig.jsx +++ b/src/CarConfig.jsx @@ -13,14 +13,16 @@ import { ThemeProvider } from '@mui/material/styles'; import { Canvas } from "@react-three/fiber"; import { Suspense } from "react"; import { OrbitControls } from "@react-three/drei"; -import Model from './components/Model.jsx' +import Model from './components/Mazda.jsx' +import Toyota from './components/LandCruiser.jsx' import {getDatabase, set, ref , update, onValue, get,child, push} from "firebase/database"; import {database} from "./firebase" import { useAuth } from "./AuthContext.js" import { DstAlphaFactor } from 'three'; +import { isValidFormat } from '@firebase/util'; - +//Change to to change to other model function Scene(props) { return ( <> @@ -28,6 +30,7 @@ function Scene(props) { + ) } @@ -35,6 +38,7 @@ function Scene(props) { export default function CarConfig() { + const {getCurrentUser} = useAuth() const user = getCurrentUser() @@ -91,8 +95,6 @@ export default function CarConfig() } - - return( + @@ -225,4 +228,3 @@ export default function CarConfig() ) } - diff --git a/src/Cart.jsx b/src/Cart.jsx index 0b35138..d15ab4f 100644 --- a/src/Cart.jsx +++ b/src/Cart.jsx @@ -5,8 +5,9 @@ import AccordionDetails from '@mui/material/AccordionDetails'; import Typography from '@mui/material/Typography'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import TrimPic from './Images/Trim.png' -import { Button, Link } from "@mui/material"; +import { Button } from "@mui/material"; import { StyledTypography } from "./Styles/MUIStyle"; +import { Link, useNavigate } from 'react-router-dom' @@ -104,7 +105,7 @@ function Cart (){ alignItems:'center', }} > - +
) diff --git a/src/EditAddress.jsx b/src/EditAddress.jsx index 40b927a..95adc57 100644 --- a/src/EditAddress.jsx +++ b/src/EditAddress.jsx @@ -52,7 +52,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Edit Address

+

Edit Address

diff --git a/src/EditDOB.jsx b/src/EditDOB.jsx index e5b618e..d08dd87 100644 --- a/src/EditDOB.jsx +++ b/src/EditDOB.jsx @@ -52,7 +52,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Edit Name

+

Edit Name

diff --git a/src/EditEmail.jsx b/src/EditEmail.jsx index f1d5699..b5fe681 100644 --- a/src/EditEmail.jsx +++ b/src/EditEmail.jsx @@ -51,7 +51,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Edit Name

+

Edit Name

diff --git a/src/EditName.jsx b/src/EditName.jsx index b7d38b3..d65c3fe 100644 --- a/src/EditName.jsx +++ b/src/EditName.jsx @@ -53,7 +53,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Edit Name

+

Edit Name

diff --git a/src/EditPassword.jsx b/src/EditPassword.jsx index d49f9b1..292bcf8 100644 --- a/src/EditPassword.jsx +++ b/src/EditPassword.jsx @@ -67,7 +67,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Edit Name

+

Edit Name

diff --git a/src/EditPayment.jsx b/src/EditPayment.jsx index 5a9afa5..23c07e8 100644 --- a/src/EditPayment.jsx +++ b/src/EditPayment.jsx @@ -57,7 +57,7 @@ import {database} from "./firebase" display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Edit Payment

+

Edit Payment

diff --git a/src/Home.jsx b/src/Home.jsx index aef100e..21354e7 100644 --- a/src/Home.jsx +++ b/src/Home.jsx @@ -1,12 +1,33 @@ import {React,} from 'react'; import Background from './Images/Background.png' +import {Box, Button} from '@mui/material'; +import { Link } from 'react-router-dom'; + +import { ThemeProvider } from '@mui/material/styles'; +import { defaultButton } from './Styles/MUIStyle'; +import './Styles/style.css' function Home(){ return( -
- +
+ +

+ Brand new car +

+ + + + + +
) } diff --git a/src/Images/LandCruiserTrim.png b/src/Images/LandCruiserTrim.png new file mode 100644 index 0000000..f2b84af Binary files /dev/null and b/src/Images/LandCruiserTrim.png differ diff --git a/src/Images/Trim.png b/src/Images/Trim.png index 9c2bc0a..99a45fd 100644 Binary files a/src/Images/Trim.png and b/src/Images/Trim.png differ diff --git a/src/Images/carIcon.jsx b/src/Images/carIcon.jsx index daacd8a..b68ed7e 100644 --- a/src/Images/carIcon.jsx +++ b/src/Images/carIcon.jsx @@ -3,7 +3,7 @@ import carIconLogo from './carIconLogo.svg' function carIcon(){ return( - + white outline of car and carkey ) } export default carIcon \ No newline at end of file diff --git a/src/LandCruiserConfig.jsx b/src/LandCruiserConfig.jsx new file mode 100644 index 0000000..8834fc9 --- /dev/null +++ b/src/LandCruiserConfig.jsx @@ -0,0 +1,226 @@ +import React, { useState, useEffect } from 'react'; +import { Grid, Button, Typography, FormControlLabel, FormControl, AccordionSummary, AccordionDetails, RadioGroup, IconButton } from '@mui/material'; +import { Link } from 'react-router-dom'; + +import ArrowBackIcon from '@mui/icons-material/ArrowBack'; +import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import ThreeSixtyIcon from '@mui/icons-material/ThreeSixty'; +import CameraswitchIcon from '@mui/icons-material/Cameraswitch'; +import './Styles/style.css' +import { defaultButton, StyledAccordion, StyledRadio } from './Styles/MUIStyle.js' +import { ThemeProvider } from '@mui/material/styles'; + +import { Canvas } from "@react-three/fiber"; +import { Suspense } from "react"; +import { OrbitControls } from "@react-three/drei"; +import Model from './components/Mazda.jsx' +import Toyota from './components/LandCruiser.jsx' + +import {getDatabase, set, ref , update, onValue, get,child, push} from "firebase/database"; +import {database} from "./firebase" +import { useAuth } from "./AuthContext.js" + +//Change to to change to other model +function Scene(props) { + return ( + + + + + + + + + ) +} + +export default function CarConfig() +{ + + + const {getCurrentUser} = useAuth() + const user = getCurrentUser() + + const [carName, setCarName] = useState() + const [carPrice,setCarPrice] = useState() + + const [modelColor, setColor] = useState("Red"); + const [wheelClr, setWheelColor] = useState("#a9a9a9"); + + //get database information for car + useEffect(() => + { + const reference = ref(database,'/Cars/'+ '/LandCruiser/'); + get(reference).then((snapshot) => + {if(snapshot.exists()) + { + setCarName(snapshot.val().Name) + setCarPrice(snapshot.val().Price) + console.log(snapshot.val()) + } + + }); + }) + + + //save user configuration to database + async function handleSubmitConfig(e){ + + try{ + push(ref(database, '/users/' + user.uid + '/SavedCars/'), { + + Name:carName, + Price:carPrice, + Color:modelColor, + WheelClr:wheelClr + + }) + .then(() => { + // Data saved successfully! + alert('Car Saved Successfully'); + + }) + .catch((error) => { + // The write failed... + alert(error); + }); + } + catch{ + + } + + + + + + } + return( + + {/*Left side of screen*/} + + + + + + + + + + + + {/*3d Model*/} + + + + + + + + + + {carName} + MSRP: ${carPrice} + + + + + {/*Right side of screen*/} + +

+ Configure Exterior +

+ + {/*Color Select*/} + + } + aria-controls="panel1a-content" + id="panel1a-header" + > + Color + + + + setColor(e.target.value)} + id='changing the color of the 3d car model' + for='changing the color of the 3d car model' + title='changing the color of the 3d car model' + > + } label="Red" for='changing the car color to red' title='changing the car color to red' id='changing the car color to red' /> + } label="Silver" for='changing the car color to silver' title='changing the car color to silver' id='changing the car color to silver'/> + } label="Blue" for='changing the car color to blue' title='changing the car color to blue' id='changing the car color to blue'/> + + + + + + {/*Wheel Color Select*/} + + } + aria-controls="panel2a-content" + id="panel2a-header" + > + Wheels + + + + setWheelColor(e.target.value)} + id='changing the Wheel color of the 3d car model' + for='changing the Wheel color of the 3d car model' + title='changing the Wheel color of the 3d car model' + > + } label="Silver" + for='changing the car color to silver' title='changing the car color to silver' id='changing the car wheel to silver'/> + } label="Dark Gray" + for='changing the car color to dark grey' title='changing the car color to dark grey' id='changing the wheel color to dark grey'/> + + + + + + + + + + + +
+
+ ) +} diff --git a/src/Login.js b/src/Login.js index 4876803..11fdfe9 100644 --- a/src/Login.js +++ b/src/Login.js @@ -47,7 +47,7 @@ export default function Login() { display: 'flex', flexDirection: 'column', alignItems:"center"}}> -

Login

+

Login

diff --git a/src/SavedCarConfig.jsx b/src/SavedCarConfig.jsx index 2e0d69c..dc12309 100644 --- a/src/SavedCarConfig.jsx +++ b/src/SavedCarConfig.jsx @@ -13,7 +13,7 @@ import { ThemeProvider } from '@mui/material/styles'; import { Canvas } from "@react-three/fiber"; import { Suspense } from "react"; import { OrbitControls } from "@react-three/drei"; -import Model from './components/Model.jsx' +import Model from './components/Mazda.jsx' //import Auth and Database import {getDatabase, set, ref, update, onValue, get,child, push} from "firebase/database"; diff --git a/src/Styles/MUIStyle.js b/src/Styles/MUIStyle.js index 201b27f..240d3d4 100644 --- a/src/Styles/MUIStyle.js +++ b/src/Styles/MUIStyle.js @@ -69,7 +69,6 @@ export const StyledRadio = styled(Radio)({ '&, &..Mui-checked': { color: 'blue', }, - }) //Sets textfield to white export const StyledTextField = styled(TextField)({ diff --git a/src/Vehicles.jsx b/src/Vehicles.jsx index 0f4eeac..e05e02a 100644 --- a/src/Vehicles.jsx +++ b/src/Vehicles.jsx @@ -4,6 +4,7 @@ import './Styles/style.css' import {VehicleButton, BoldTab } from './Styles/MUIStyle.js' import PropTypes from 'prop-types'; import TrimPic from './Images/Trim.png' +import LandCruiser from './Images/LandCruiserTrim.png' import { Link } from 'react-router-dom' //Returns entry for each vehicle that goes on page @@ -15,8 +16,8 @@ function VehicleEntry() return( - - Car button + +

Car Example

$100,000 Starting MSRP*

@@ -84,9 +85,6 @@ export default function Vehicles(){ style={{padding:50}} > - - -
@@ -98,8 +96,15 @@ export default function Vehicles(){ spacing={20} style={{padding:50}} > - - + + + + +

Car Example

+

$100,000 Starting MSRP*

+
+ +
diff --git a/src/components/LandCruiser.jsx b/src/components/LandCruiser.jsx new file mode 100644 index 0000000..3850549 --- /dev/null +++ b/src/components/LandCruiser.jsx @@ -0,0 +1,804 @@ +import { Suspense, useRef } from "react"; +import LandCruiser from '../3d/LandCruiser.glb' +import { useGLTF, useTexture } from "@react-three/drei"; + +export default function Model(props) { + const { nodes, materials } = useGLTF(LandCruiser); + const paintColor = props.color; + const wheelColor = props.wheelColor; + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +useGLTF.preload("/LandCruiser.glb"); \ No newline at end of file diff --git a/src/components/Model.jsx b/src/components/Mazda.jsx similarity index 95% rename from src/components/Model.jsx rename to src/components/Mazda.jsx index b4ef848..b82093e 100644 --- a/src/components/Model.jsx +++ b/src/components/Mazda.jsx @@ -1,14 +1,12 @@ -import { Canvas } from "@react-three/fiber"; -import { useLoader } from "@react-three/fiber"; -import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; import { Suspense, useRef } from "react"; import mazda from '../3d/mazda.glb' -import { Environment, OrbitControls, useGLTF, useTexture } from "@react-three/drei"; +import { useGLTF, useTexture } from "@react-three/drei"; export default function Model({ ...props }) { const group = useRef(); const { nodes, materials } = useGLTF(mazda); - const paintColor = props.color + const paintColor = props.color; + const wheelColor = props.wheelColor; return ( + > + + + > + + + > + + + > + + -

Register

+ alignItems:"center",}}> +

Register