├── js ├── ecommerce.js ├── user.js ├── products.js ├── categories.js ├── cart.js └── init.js ├── css ├── style.min.css ├── sass │ └── style.scss └── style.css ├── category.html ├── wishlist.html ├── logout.html ├── templates ├── navigation.html └── footer.html ├── product.html ├── login.html ├── about.html ├── README.md ├── index.html ├── account.html ├── contact.html └── cart.html /js/ecommerce.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /css/style.min.css: -------------------------------------------------------------------------------- 1 | @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css");body{color:#333;font-size:16px}.text-end a{float:right}a{text-decoration:none !important}a :hover,a :active,a :visited{text-decoration:none}.breadcrumb .sep{padding:0 5px}label{margin-bottom:1rem}.hero{background-color:#e7f3ff;padding:2rem;margin-bottom:2rem}.product{border:1px solid #c0c0c0;height:300px;margin-bottom:1rem;text-align:center;position:relative}.product .image{overflow:hidden;height:100%;width:100%;margin-bottom:1rem;padding:1rem}.product .image img{max-height:80%;max-width:80%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.product .info{background-color:#1c7ad1cc;position:absolute;width:100%;bottom:0;left:0;padding:1rem;min-height:100%;opacity:0;transition:all 0.25s ease;color:#fff !important}.product .info .title{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.product :hover>.info{opacity:1}footer{margin-top:2rem}.cartDisplay div{width:75%}.cartDisplay div h6{text-align:left}.cartDisplay img{margin-right:1rem} 2 | -------------------------------------------------------------------------------- /js/user.js: -------------------------------------------------------------------------------- 1 | class User { 2 | constructor() { 3 | this.apiUrl = "https://fakestoreapi.com/"; 4 | } 5 | 6 | getAccountInfo(user) { 7 | $("#username").val(user.username); 8 | $("#fname").val(user.name.firstname); 9 | $("#lname").val(user.name.lastname); 10 | $("#phone").val(user.phone); 11 | $("#email").val(user.email); 12 | $("#address").val(user.address.number + " " + user.address.street); 13 | $("#city").val(user.address.city); 14 | $("#zip").val(user.address.zipcode); 15 | } 16 | 17 | doLogin(username, password) { 18 | localStorage.clear(); 19 | $.ajax({ 20 | type: "GET", 21 | url: this.apiUrl + "users", 22 | success: function (data) { 23 | $(data).each(function (index, user) { 24 | if (user.username == username && user.password == password) { 25 | localStorage.setItem("user", JSON.stringify(user)); 26 | } 27 | }); 28 | if (localStorage.getItem("user") != null) { 29 | window.location.href = "/account.html"; 30 | } else { 31 | $(".loginMsg").html( 32 | '
15 |
15 | Lorem ipsum duis mattis id nullam erat vitae ad, gravida vel tincidunt hendrerit vestibulum dictumst quam feugiat ut platea cras ornare tristique pulvinar convallis netus.
20 | 21 |