diff --git a/Calculators/Weight-Converter-Based-on-Planet/README.md b/Calculators/Weight-Converter-Based-on-Planet/README.md new file mode 100644 index 000000000..5cf213d3c --- /dev/null +++ b/Calculators/Weight-Converter-Based-on-Planet/README.md @@ -0,0 +1,15 @@ +#

Weight Calculator

+ +## Description :- + +Convert Weight of an object to different different Planet + +## Tech Stacks :- + +- HTML +- CSS +- JavaScript + +## Screenshots :- + +![alt text](image.png) diff --git a/Calculators/Weight-Converter-Based-on-Planet/image.png b/Calculators/Weight-Converter-Based-on-Planet/image.png new file mode 100644 index 000000000..12ef4746d Binary files /dev/null and b/Calculators/Weight-Converter-Based-on-Planet/image.png differ diff --git a/Calculators/Weight-Converter-Based-on-Planet/index.html b/Calculators/Weight-Converter-Based-on-Planet/index.html new file mode 100644 index 000000000..360620307 --- /dev/null +++ b/Calculators/Weight-Converter-Based-on-Planet/index.html @@ -0,0 +1,48 @@ + + + + + + + + + + + Weight Calculator + + + +
+
+
+ + + +
to
+
+
+
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/Calculators/Weight-Converter-Based-on-Planet/script.js b/Calculators/Weight-Converter-Based-on-Planet/script.js new file mode 100644 index 000000000..a433f0bee --- /dev/null +++ b/Calculators/Weight-Converter-Based-on-Planet/script.js @@ -0,0 +1,23 @@ + +function Calculate(params) { + let weight_on_earth = document.getElementById("Weight-on-earth").value; + let unit = document.getElementById("unit").value; + let planet = document.getElementById("planet").value; + let weight_on_planet; + if(planet == "Mercury"){ + weight_on_planet = weight_on_earth*0.38; + } else if(planet == "Venus") { + weight_on_planet = weight_on_earth * 0.91; + } else if(planet == "Mars") { + weight_on_planet = weight_on_earth * 0.38; + } else if(planet == "Jupiter") { + weight_on_planet = weight_on_earth * 2.34; + } else if(planet == "Saturn") { + weight_on_planet = weight_on_earth * 1.06; + } else if(planet == "Uranus") { + weight_on_planet = weight_on_earth * 0.92; + } else if(planet == "Neptune") { + weight_on_planet = weight_on_earth * 1.19; + } + document.querySelector(".answer").textContent = "Weight on "+planet+" = "+weight_on_planet+" "+unit; +} \ No newline at end of file diff --git a/Calculators/Weight-Converter-Based-on-Planet/style.css b/Calculators/Weight-Converter-Based-on-Planet/style.css new file mode 100644 index 000000000..45d72584c --- /dev/null +++ b/Calculators/Weight-Converter-Based-on-Planet/style.css @@ -0,0 +1,51 @@ +body { + font-family:'Times New Roman', Times, serif; + background: linear-gradient(to bottom, #6c5b7b, #c06c84); + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.converter{ + height: 50vh; + width: 70vh; + background-color: #fff; + display: flex; + justify-content: center; + align-items: center; +} +.converterbox{ + height: 50%; + width: 50%; +} +.converterbox input{ + margin: 0.7vw 0.7vw 1.5vw 0vw; +} +.converterbox .ctr{ + margin-bottom: 1.5vw; +} + +#planet{ + width: 162px; + margin-top: 0.7vw; +} +.converterbox .calculate{ + margin: 1.7vw 0 1.25vw 0; + padding: 0.3rem 0.7rem; + background-color: #74025B; + border-radius: 5px; + border: white 1px solid; + color: white; +} +.converterbox .calculate:active{ + opacity: 0.5; +} + +.converterbox .answer{ + color: green; + width: 100%; + text-align: center; +} \ No newline at end of file diff --git a/index.html b/index.html index 4abdaab88..d68ee81dc 100644 --- a/index.html +++ b/index.html @@ -2274,6 +2274,20 @@

Calculates weight from kgs to pounds and vice-versa.

+
+
+

Weight Converter Based on Planet

+

Convert weight of an object based on planet

+ +
+

Word Count Calculator