diff --git a/Calculators/Body-Shape-Calculator/README.md b/Calculators/Body-Shape-Calculator/README.md new file mode 100644 index 000000000..7aace7969 --- /dev/null +++ b/Calculators/Body-Shape-Calculator/README.md @@ -0,0 +1,15 @@ +#

Body Shape Calculator

+ +## Description :- + +Based on comparing the waist and bust/chest measurements to the hip measurement. This helps categorize a body shape category(Rectangle, hourglass, triangle etc). + +## Features :- + +calculator will display your body shape + suggest clothing styles. + +## Tech Stacks :- + +- HTML +- CSS +- JavaScript diff --git a/Calculators/Body-Shape-Calculator/index.html b/Calculators/Body-Shape-Calculator/index.html new file mode 100644 index 000000000..368c0efa1 --- /dev/null +++ b/Calculators/Body-Shape-Calculator/index.html @@ -0,0 +1,46 @@ + + + + + + + Body Shape calculator + + + +

Find your body Style

+
+
+ + + +
+
+ + + +
+
+ + + +
+ +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/Calculators/Body-Shape-Calculator/script.js b/Calculators/Body-Shape-Calculator/script.js new file mode 100644 index 000000000..eeb5bf29e --- /dev/null +++ b/Calculators/Body-Shape-Calculator/script.js @@ -0,0 +1,67 @@ +function calculateShape() { + const bustInput = document.getElementById("bust"); + const waistInput = document.getElementById("waist"); + const hipsInput = document.getElementById("hips"); + + // Get unit values from each select element + const bustUnit = bustInput.parentElement.querySelector(".unit-selector").value; + const waistUnit = waistInput.parentElement.querySelector(".unit-selector").value; + const hipsUnit = hipsInput.parentElement.querySelector(".unit-selector").value; + + let convertedBust = parseFloat(bustInput.value); + let convertedWaist = parseFloat(waistInput.value); + let convertedHips = parseFloat(hipsInput.value); + + // Convert to centimeters if selected + if (bustUnit === "centimeters") { + convertedBust *= 2.54; + } + if (waistUnit === "centimeters") { + convertedWaist *= 2.54; + } + if (hipsUnit === "centimeters") { + convertedHips *= 2.54; + } + + let resultText; + let suggestionText; + + if (convertedBust > convertedWaist && convertedBust > convertedHips) { + resultText = "RESULT:-Triangle Shape"; + suggestionText = "SUGGESTION:-Wear clothes like A-line skirts, V-neck tops, and wrap dresses."; + } else if (convertedWaist > convertedBust && convertedWaist > convertedHips) { + resultText = "RESULT:-Inverted Triangle Shape"; + suggestionText = "SUGGESTION:-Wear clothes like wide-leg pants, boat neck tops, and structured jackets."; + } + else if (convertedHips > convertedBust && convertedHips > convertedWaist) { + resultText = "RESULT:-Rectangle Shape"; + suggestionText = "SUGGESTION:-Wear clothes like high-waisted pants, peplum tops, and belted dresses."; + } + else if (convertedBust === convertedWaist && convertedBust === convertedHips) { + resultText = "RESULT:-Hourglass Shape"; + suggestionText = "SUGGESTION:-Wear clothes like wrap dresses, pencil skirts, and fitted tops."; + } + else if (convertedBust === convertedWaist || convertedBust === convertedHips || convertedWaist === convertedHips) { + resultText = "RESULT:-Diamond Shape"; + suggestionText = "SUGGESTION:-Wear clothes like bootcut pants, off-the-shoulder tops, and empire waist dresses."; + } + else if (convertedBust < convertedWaist && convertedBust < convertedHips){ + resultText = "RESULT:-Pear Shape"; + suggestionText = "SUGGESTION:-Wear clothes like bootcut pants, off-the-shoulder tops, and empire waist dresses."; + } + else if (convertedWaist < convertedBust && convertedWaist < convertedHips){ + resultText = "RESULT:-Apple Shape"; + suggestionText = "SUGGESTION:-Wear clothes like A-line skirts, V-neck tops, and wrap dresses."; + } + else if (convertedHips < convertedBust && convertedHips < convertedWaist){ + resultText = "RESULT:-Oval Shape"; + suggestionText = "SUGGESTION:-Wear clothes like wide-leg pants, boat neck tops, and structured jackets."; + } + else { + resultText = "Invalid input. Please enter valid measurements."; + suggestionText = ""; + } + +document.getElementById("result").innerHTML =resultText; +document.getElementById("suggestion").innerHTML =suggestionText; +} diff --git a/Calculators/Body-Shape-Calculator/style.css b/Calculators/Body-Shape-Calculator/style.css new file mode 100644 index 000000000..148665d07 --- /dev/null +++ b/Calculators/Body-Shape-Calculator/style.css @@ -0,0 +1,127 @@ +body { + font-weight: bold; + background: rgb(238, 174, 202); + background: radial-gradient(circle, rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%); + opacity: 1; + font-family: Arial, sans-serif; + display: block; + justify-content: center; + align-items: center; + height: 100vh; + margin: 20; + color: #111010; +} + +footer { + color: #111010; + text-align: center; + display: block; +} + +img { + margin-bottom: 20px; + width: 70px; + height: 50px; +} + +h1 { + text-align: center; + font-style: oblique; + font-size: 1.5em; + font-weight: bolder; + +} + +.container { + display: block; + background-color: rgba(221, 178, 203, 0.768); + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); + max-width: 400px; + width: 100%; + text-align: center; + margin: 0 auto; +} + +hr { + color: #cba8ec; +} + + +label { + display: flex; + margin-bottom: 5px; + font-weight: bold; +} + +.input-group { + margin-bottom: 15px; + display: flex; + justify-content: space-between; + align-items: center; + border-radius: 5px; +} + +.input-group input { + width: 80%; + padding: 10px; + border: 1px solid rgb(234, 229, 230); + border-radius: 5px; + font-size: 16px; + +} + +.input-group button { + width: 100%; + padding: 10px; + background-color: #de8dad; + color: white; + border: none; + border-radius: 5px 0 0 5px; + cursor: pointer; + font-size: 1em; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: rgb(222, 197, 210); +} + +.unit-selector { + padding: 10px; + border-color: #e4b3c7; + color: rgb(157, 155, 155); + border: #de8dad; + border-radius: 0 5px 5px 0; + cursor: pointer; + font-size: 1em; +} + +#result { + margin-top: 20px; + padding: 15px; + text-align: center; + font-size: 1.2em; + font-weight: bold; + +} + +.footer { + text-align: center; + font-size: 1em; + font-weight: lighter; + color: #ada8a8; + +} + +#result.hidden { + display: none; +} + +#suggestion { + font-size: 1em; + font-weight: lighter; + color: #454445; + text-align: center; +} \ No newline at end of file