Skip to content
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
3 changes: 3 additions & 0 deletions .idea/ZenLender.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

174 changes: 16 additions & 158 deletions index.html

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions javascript/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
let storedName, shoppingList, shoppingBag, dynamicHTML, answer, cartList;
function getUsername() {
storedName = localStorage.getItem('name');
if(storedName!=null) {
document.getElementById('title').innerHTML = 'Hi, ' + storedName;
}
document.getElementById('shoppingCart').hidden= true
console.log('Inside Onload');
}
async function checkout(event) {
//dynamicHTML = ''
event.preventDefault()
shoppingBag = localStorage.getItem('bag')
console.log(shoppingBag)
dynamicHTML= "";
axios.get('https://fetchFTC.py201678.repl.co/generatehtml/' + shoppingBag)
.then(function (response) {
console.log(response.data)
document.getElementById('shoppingCartList').innerHTML = response.data
})
.catch(function (error) {
console.log(error);
})
.then(function () {

console.log(dynamicHTML)
console.log("done");
});
axios.get('https://fetchFTC.py201678.repl.co/generateprice/' + shoppingBag)
.then(function (response) {
console.log(response.data)
document.getElementById('totalPrice').innerHTML = response.data
})
.catch(function (error) {
console.log(error);
})
.then(function () {

console.log(dynamicHTML)
console.log("done");
});

document.getElementById('shoppingCart').hidden = false;
}
function closeCheckout(event) {
document.getElementById('shoppingCart').hidden=true;
event.preventDefault();
}
function goToSignUp() {
window.location.href = "../signup.html"
}
function generateHTML(res) {
dynamicHTML = dynamicHTML + `
<li class="flex py-6">
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-01.jpg" alt="Salmon orange fabric pouch with match zipper, gray zipper pull, and adjustable hip belt." class="h-full w-full object-cover object-center">
</div>

<div class="ml-4 flex flex-1 flex-col">
<div>
<div class="flex justify-between text-base font-medium text-gray-900">
<h3>
<a href="#">${res.partName}</a>
</h3>
<p class="ml-4">$${res.price}</p>
</div>
<p class="mt-1 text-sm text-gray-500">${res.partInitials}</p>
</div>
<div class="flex flex-1 items-end justify-between text-sm">
<p class="text-gray-500">Qty 1</p>

<div class="flex">
<button type="button" class="font-medium text-indigo-600 hover:text-indigo-500">Remove</button>
</div>
</div>
</div>
</li>`
}
17 changes: 17 additions & 0 deletions javascript/products/REVCH.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let bag;
function addToCart(event) {
bag = localStorage.getItem('bag');
if(localStorage.getItem('loggedIn')==null){
window.location.href="../signup.html"
}
if(localStorage.getItem('loggedIn') === "true") {
if(bag==null){
localStorage.setItem('bag',"RCH;")
} else {
localStorage.setItem('bag',bag+"RCH;")
}
console.log('added to cart');
}
event.preventDefault()
}

14 changes: 14 additions & 0 deletions javascript/signin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let ftcNumber;
let name;
let password;
let email;
let storedName;
function signIn() {
ftcNumber = document.getElementById("ftcNumber")
name = document.getElementById("name");
storedName = localStorage.setItem('name', name);
password = document.getElementById("discordID");
email = document.getElementById("email");
console.log("");
//fetch()
}
135 changes: 127 additions & 8 deletions products/REVCH.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>REV Control Hub</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.0.2/tailwind.min.css">
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="../javascript/products/REVCH.js"></script>
<script src="../javascript/global.js"></script>

</head>
<body>
<body onload="getUsername()">

<!-- Section 1 -->
<section class="relative w-full px-8 text-gray-700 bg-white body-font" data-tails-scripts="//unpkg.com/alpinejs">
<div class="mx-auto max-w-7xl">

<nav class="relative z-50 h-24 select-none" x-data="{ showMenu: false }">
<nav class="relative z-25 h-24 select-none" x-data="{ showMenu: false }">
<div class="container relative flex flex-wrap items-center justify-between h-24 mx-auto overflow-hidden font-medium border-b border-gray-200 md:overflow-visible lg:justify-center sm:px-4 md:px-2 lg:px-0">
<div class="flex items-center justify-start w-1/4 h-full pr-4">
<a href="#_" class="inline-block py-4 md:py-0">
Expand All @@ -25,15 +32,15 @@
<div class="flex-col w-full h-auto overflow-hidden bg-white rounded-lg md:bg-transparent md:overflow-visible md:rounded-none md:relative md:flex md:flex-row">
<a href="#_" class="inline-flex items-center block w-auto h-16 px-6 text-xl font-black leading-none text-gray-900 md:hidden">ZenLender<span class="text-indigo-600">.</span></a>
<div class="flex flex-col items-start justify-center w-full space-x-6 text-center lg:space-x-8 md:w-2/3 md:mt-0 md:flex-row md:items-center">
<a href="#_" class="inline-block w-full py-2 mx-0 ml-6 font-medium text-left text-indigo-600 md:ml-0 md:w-auto md:px-0 md:mx-2 lg:mx-3 md:text-center">Home</a>
<a href="#_" class="inline-block w-full py-2 mx-0 ml-6 font-medium text-left text-indigo-600 md:ml-0 md:w-auto md:px-0 md:mx-2 hover:text-indigo-600 lg:mx-3 md:text-center">Home</a>
<a href="#_" class="inline-block w-full py-2 mx-0 font-medium text-left text-gray-700 md:w-auto md:px-0 md:mx-2 hover:text-indigo-600 lg:mx-3 md:text-center">Features</a>
<a href="#_" class="inline-block w-full py-2 mx-0 font-medium text-left text-gray-700 md:w-auto md:px-0 md:mx-2 hover:text-indigo-600 lg:mx-3 md:text-center">Blog</a>
<a href="#_" class="inline-block w-full py-2 mx-0 font-medium text-left text-gray-700 md:w-auto md:px-0 md:mx-2 hover:text-indigo-600 lg:mx-3 md:text-center">Contact</a>

</div>
<div class="flex flex-col items-start justify-end w-full pt-4 md:items-center md:w-1/3 md:flex-row md:py-0">
<div class="flex flex-col items-start justify-end w-full pt-4 md:items-center md:w-1/3 md:flex-row md:py-0" id="title">
<a href="#" class="w-full px-3 py-2 mr-0 text-gray-700 md:mr-2 lg:mr-3 md:w-auto">Sign In</a>
<a href="#_" class="inline-flex items-center w-full px-6 py-3 text-sm font-medium leading-4 text-white bg-indigo-600 md:px-3 md:w-auto md:rounded-full lg:px-5 hover:bg-indigo-500 focus:outline-none md:focus:ring-2 focus:ring-0 focus:ring-offset-2 focus:ring-indigo-600">Sign Up</a>
<a href="#" class="inline-flex items-center w-full px-6 py-3 text-sm font-medium leading-4 text-white bg-indigo-600 md:px-3 md:w-auto md:rounded-full lg:px-5 hover:bg-indigo-500 focus:outline-none md:focus:ring-2 focus:ring-0 focus:ring-offset-2 focus:ring-indigo-600">Sign Up</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -99,11 +106,13 @@ <h1 class="text-2xl font-extrabold tracking-tight text-gray-900 sm:text-3xl">REV
<!-- Options -->
<div class="mt-4 lg:mt-0 lg:row-span-3">
<h2 class="sr-only">Product information</h2>
<p class="text-3xl text-gray-900">$247</p>
<p class="text-3xl text-gray-900">Free <span class="text-gray-400"
style="text-decoration: line-through;">247$</span></p>


<form class="mt-10">
<button type="submit" class="mt-10 w-full bg-indigo-600 border border-transparent rounded-md py-3 px-8 flex items-center justify-center text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Add to bag</button>
<button onclick="addToCart(event)" type="submit" class="mt-10 w-full bg-indigo-600 border border-transparent rounded-md py-3 px-8 flex items-center justify-center text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Add to bag</button>
<button onclick="checkout(event)" class="mt-10 w-full bg-indigo-600 border border-transparent rounded-md py-3 px-8 flex items-center justify-center text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Checkout</button>
</form>
</div>

Expand Down Expand Up @@ -152,11 +161,121 @@ <h2 class="text-sm font-medium text-gray-900">Details</h2>
</div>

</section>

<section id="shoppingCart" class="z-26">
<div class="relative z-10" aria-labelledby="slide-over-title" role="dialog" aria-modal="true">
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>

<div class="fixed inset-0 overflow-hidden">
<div class="absolute inset-0 overflow-hidden">
<div class="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10">
<div class="pointer-events-auto w-screen max-w-md">
<div class="flex h-full flex-col overflow-y-scroll bg-white shadow-xl">
<div class="flex-1 overflow-y-auto py-6 px-4 sm:px-6">
<div class="flex items-start justify-between">
<h2 class="text-lg font-medium text-gray-900" id="slide-over-title">Shopping cart</h2>
<div class="ml-3 flex h-7 items-center">
<button onclick="closeCheckout()" type="button" class="-m-2 p-2 text-gray-400 hover:text-gray-500">
<span class="sr-only">Close panel</span>
<!-- Heroicon name: outline/x -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</div>

<div class="mt-8">
<div class="flow-root">
<ul role="list" class="-my-6 divide-y divide-gray-200" id="shoppingCartList">
<li class="flex py-6">
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-01.jpg" alt="Salmon orange fabric pouch with match zipper, gray zipper pull, and adjustable hip belt." class="h-full w-full object-cover object-center">
</div>

<div class="ml-4 flex flex-1 flex-col">
<div>
<div class="flex justify-between text-base font-medium text-gray-900">
<h3>
<a href="#"> Throwback Hip Bag </a>
</h3>
<p class="ml-4">$90.00</p>
</div>
<p class="mt-1 text-sm text-gray-500">Salmon</p>
</div>
<div class="flex flex-1 items-end justify-between text-sm">
<p class="text-gray-500">Qty 1</p>

<div class="flex">
<button type="button" class="font-medium text-indigo-600 hover:text-indigo-500">Remove</button>
</div>
</div>
</div>
</li>

<li class="flex py-6">
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-02.jpg" alt="Front of satchel with blue canvas body, black straps and handle, drawstring top, and front zipper pouch." class="h-full w-full object-cover object-center">
</div>

<div class="ml-4 flex flex-1 flex-col">
<div>
<div class="flex justify-between text-base font-medium text-gray-900">
<h3>
<a href="#"> Medium Stuff Satchel </a>
</h3>
<p class="ml-4">$32.00</p>
</div>
<p class="mt-1 text-sm text-gray-500">Blue</p>
</div>
<div class="flex flex-1 items-end justify-between text-sm">
<p class="text-gray-500">Qty 1</p>

<div class="flex">
<button type="button" class="font-medium text-indigo-600 hover:text-indigo-500">Remove</button>
</div>
</div>
</div>
</li>

<!-- More products... -->
</ul>
</div>
</div>
</div>

<div class="border-t border-gray-200 py-6 px-4 sm:px-6">
<div class="flex justify-between text-base font-medium text-gray-900" id="totalPrice">
<p>Subtotal</p>
<p>$262.00</p>
</div>
<p class="mt-0.5 text-sm text-gray-500">Shipping and taxes calculated at checkout.</p>
<div class="mt-6">
<a href="#" class="flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-6 py-3 text-base font-medium text-white shadow-sm hover:bg-indigo-700">Checkout</a>
</div>
<div class="mt-6 flex justify-center text-center text-sm text-gray-500">
<p>
or <button type="button" onclick="closeCheckout()" class="font-medium text-indigo-600 hover:text-indigo-500">Continue Shopping<span aria-hidden="true"> →</span></button>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>





<!-- Section 2 -->
<section class="text-gray-700 bg-white body-font">
<div class="container flex flex-col items-center px-8 py-8 mx-auto max-w-7xl sm:flex-row">
<a href="#_" class="text-xl font-black leading-none text-gray-900 select-none logo">ZenLender<span class="text-indigo-600">.</span></a>
<p class="mt-4 text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l sm:border-gray-200 sm:mt-0">© 2021 DevMello - Tailwindcss
<p class="mt-4 text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l sm:border-gray-200 sm:mt-0">© 2022 DevMello - Tailwindcss
</p>
<span class="inline-flex justify-center mt-4 space-x-5 sm:ml-auto sm:mt-0 sm:justify-start">
<a href="#" class="text-gray-400 hover:text-gray-500">
Expand Down
Loading