diff --git a/CustomerReviews/Sochan2/README.md b/CustomerReviews/Sochan2/README.md new file mode 100644 index 000000000..79a7e37ef --- /dev/null +++ b/CustomerReviews/Sochan2/README.md @@ -0,0 +1,26 @@ +# Customer Reviews Web Application + +## Overview +This project is a simple customer reviews web application that allows users to view and submit customer feedback. Users can browse through reviews, navigate between them, or view random ones. Additionally, new reviews can be added through a modal form. + +## Technologies Used +- **HTML5**: Structure of the web pages. +- **CSS3**: Styling the user interface with a modern, responsive design. +- **JavaScript**: Functionality for user interaction (e.g., displaying reviews, handling form submission). Use Object. +- **Framework**: No Framework, libraly + +## Features +- Display a list of customer reviews with associated images. +- Navigation buttons for cycling through reviews (Previous, Next, Random). +- A modal form to submit new reviews. +- Sidebar displaying all customers' names that link to their reviews. +- Ability to add a new review with a name, image URL, and customer feedback. + + +### Prerequisites +Make sure you have a web browser installed to run the app. You do not need any special software to run this application, as it is built using basic web technologies (HTML, CSS, JavaScript). + + + + + diff --git a/CustomerReviews/Sochan2/css/style.css b/CustomerReviews/Sochan2/css/style.css new file mode 100644 index 000000000..796afccdb --- /dev/null +++ b/CustomerReviews/Sochan2/css/style.css @@ -0,0 +1,246 @@ +body { + font-family: Arial, sans-serif; + display: flex; + justify-content: space-around; + align-items: center; + height: 100vh; + background: #f4f4f4; +} + +.review-container { + background: white; + padding: 20px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); + text-align: center; + width: 500px; +} + +#customer-image { + width: 150px; + height: 150px; + border-radius: 50%; + margin: 20px auto; +} + +#customer-name, #customer-review { + font-size: 20px; + color: #4A148C; +} + +.button + +.buttons button { + padding: 10px 20px; + margin: 10px; + background-color: #43A047; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.add-review{ + padding: 10px 20px; + margin: 10px; + background-color: #43A047; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.buttons button:hover { + background-color: #2E7D32; +} + + +.modal { + display: none; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.4); +} + +.modal-content { + background-color: #fefefe; + margin: 15% auto; + padding: 20px; + border: 1px solid #888; + width: 80%; +} + +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +input[type="text"], +textarea { + width: 95%; + padding: 12px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + box-sizing: border-box; +} + +button[type="submit"] { + background-color: #4CAF50; + color: white; + padding: 14px 20px; + margin: 8px 0; + border: none; + cursor: pointer; + width: 100%; +} + +button[type="submit"]:hover { + opacity: 0.8; +} + +/* Modal background */ +.modal { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.6); + z-index: 1000; + justify-content: center; + align-items: center; +} + +/* Modal content */ +.modal-content { + background: #fff; + padding: 2rem; + border-radius: 8px; + width: 90%; + max-width: 400px; + text-align: center; + position: relative; + animation: fadeIn 0.3s ease; +} + +@keyframes fadeIn { + from { + opacity: 0; + transform: scale(0.9); + } + to { + opacity: 1; + transform: scale(1); + } +} + +/* Close button */ +.close { + position: absolute; + top: 10px; + right: 15px; + font-size: 1.5rem; + color: #333; + cursor: pointer; +} + +/* Form group */ +.form-group { + margin-bottom: 1.5rem; + text-align: left; +} + +label { + display: block; + margin-bottom: 0.5rem; + font-weight: bold; +} + +input, textarea { + width: 100%; + padding: 0.8rem; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 1rem; + margin-top: 0.3rem; +} + +textarea { + resize: none; + height: 80px; +} + +/* Submit button */ +.submit-btn { + background: #007BFF; + color: #fff; + padding: 0.8rem 1.5rem; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 1rem; + transition: background 0.3s ease; +} + +.submit-btn:hover { + background: #0056b3; +} + +/* Add review button */ +.add-review-btn { + background: #28a745; + color: #fff; + padding: 0.8rem 1.5rem; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 1rem; + transition: background 0.3s ease; + position: fixed; + bottom: 20px; + right: 20px; +} + +.add-review-btn:hover { + background: #1e7e34; +} + +.sidebar { + width: 250px; + background-color: #f4f4f4; + padding: 20px; + position: fixed; + top: 0; + left: 0; + height: 100%; + overflow-y: auto; +} + +.sidebar div { + padding: 10px; + margin-bottom: 10px; + cursor: pointer; + background-color: #ddd; + border-radius: 4px; +} + +.sidebar div:hover { + background-color: #bbb; +} + diff --git a/CustomerReviews/Sochan2/img/customer1.png b/CustomerReviews/Sochan2/img/customer1.png new file mode 100644 index 000000000..2d8d89e1a Binary files /dev/null and b/CustomerReviews/Sochan2/img/customer1.png differ diff --git a/CustomerReviews/Sochan2/img/customer2.png b/CustomerReviews/Sochan2/img/customer2.png new file mode 100644 index 000000000..9b4fba66c Binary files /dev/null and b/CustomerReviews/Sochan2/img/customer2.png differ diff --git a/CustomerReviews/Sochan2/img/customer3.png b/CustomerReviews/Sochan2/img/customer3.png new file mode 100644 index 000000000..3817224b5 Binary files /dev/null and b/CustomerReviews/Sochan2/img/customer3.png differ diff --git a/CustomerReviews/Sochan2/index.html b/CustomerReviews/Sochan2/index.html new file mode 100644 index 000000000..8679c662a --- /dev/null +++ b/CustomerReviews/Sochan2/index.html @@ -0,0 +1,55 @@ + + + + + + + Customer Reviews + + + + + + + +
+ Customer Photo +
+
+
+ + + +
+
+ + + + + + + + + \ No newline at end of file diff --git a/CustomerReviews/Sochan2/js/customerData.js b/CustomerReviews/Sochan2/js/customerData.js new file mode 100644 index 000000000..96b5187f6 --- /dev/null +++ b/CustomerReviews/Sochan2/js/customerData.js @@ -0,0 +1,22 @@ + +const userObject = [ + { + image: "./img/customer1.png", + name: "Bob Smith", + customerReview: "Very satisfied with the purchase." + }, + + { + image: "./img/customer2.png", + name: "Alice Johnson", + customerReview: "Great service and support!" + }, + + { + image: "./img/customer3.png", + name: "Carol White", + customerReview: "Could be better, but good overall." + } + +] + diff --git a/CustomerReviews/Sochan2/js/main.js b/CustomerReviews/Sochan2/js/main.js new file mode 100644 index 000000000..3ffe9a479 --- /dev/null +++ b/CustomerReviews/Sochan2/js/main.js @@ -0,0 +1,127 @@ +let index = 0; + + +function displayCustomer(newIndex){ + + if(newIndex<0){ + index = userObject.length -1; + } + else if (newIndex>=userObject.length){ + index=0; + } + else{ + index = newIndex; + } + + + + const customerImage = document.getElementById('customer-image'); + const customerName = document.getElementById('customer-name'); + const customerReview = document.getElementById('customer-review'); + + const customer = userObject[index]; + customerImage.src = customer.image; + customerName.textContent = customer.name; + customerReview.textContent = customer.customerReview; + + + return customer; + +} + +function preButton(){ + index--; + displayCustomer(index); + }; + + +function nextButton(){ + index++; + displayCustomer(index); + } + +function randomButton(){ + randomIndex = Math.floor(Math.random()*userObject.length); + displayCustomer(randomIndex); + }; + + + + +document.getElementById("prev").addEventListener("click",preButton); +document.getElementById("next").addEventListener("click",nextButton); +document.getElementById("random").addEventListener("click",randomButton); + + +displayCustomer(index); + + +//review + + +const modal = document.getElementById("review-form"); +const openFormBtn = document.getElementById("open-form"); +const closeFormBtn = document.getElementById("close-form"); +const form = document.getElementById("new-review-form"); + + +openFormBtn.addEventListener("click", () => { + modal.style.display = "flex"; +}); + + +closeFormBtn.addEventListener("click", () => { + modal.style.display = "none"; +}); + +// Close modal when clicking outside the content +window.addEventListener("click", (e) => { + if (e.target === modal) { + modal.style.display = "none"; + } +}); + + +form.addEventListener("submit", (e) => { + e.preventDefault(); + + const name = document.getElementById("name").value; + const image = document.getElementById("image").value; + const review = document.getElementById("review").value; + + + userObject.push({ + name: name, + image: image, + customerReview: review, + }); + + alert("Review submitted successfully!"); + modal.style.display = "none"; + form.reset(); // Reset form fields +}); + +function setupSidebar() { + const sidebar = document.querySelector('.sidebar'); + userObject.forEach((customer, index) => { + const div = document.createElement('div'); + div.textContent = customer.name; + div.onclick = () => { + displayCustomer(index); + }; + sidebar.appendChild(div); + }); +} + +setupSidebar(); + + + + + + + + + + + diff --git a/ParticleSystem/mccoli/README.md b/ParticleSystem/mccoli/README.md index 434cb05b5..66fc570a2 100644 --- a/ParticleSystem/mccoli/README.md +++ b/ParticleSystem/mccoli/README.md @@ -10,7 +10,7 @@ This project is a particle system simulation created using the p5.js library. Us ### Getting Started 1. Clone this repository to your local machine. 2. Open the provided HTML file in a web browser. -3. Have fun :) +3. Have fun ### Technical Info - **Framework**: None