]> git repositories - temperature-converter.git/commitdiff
updated UI a little
authorametoresu <mail@tenkyuu.dev>
Fri, 27 Dec 2024 11:10:22 +0000 (19:10 +0800)
committerametoresu <mail@tenkyuu.dev>
Fri, 27 Dec 2024 11:10:22 +0000 (19:10 +0800)
index.html
script.js
styles.css

index 39d023be49a66caca404146cb19fcacd4abae13a..ef5c31d4a82e83501b5238c66c16bd6a3e150a01 100644 (file)
   <header></header>
   <main>
     <div class="summary">
-      <h1>Temperature Converter</h1>
-      <p>This web application allows users to convert temperatures between various units, including Celsius, Fahrenheit, and Kelvin. It provides a straightforward interface for quick and accurate conversions.</p>
+      <h1 class="app-title">Temperature Converter</h1>
+      <p class="app-description">This web application allows users to convert temperatures between various units, including Celsius, Fahrenheit, and Kelvin. It provides a straightforward interface for quick and accurate conversions.</p>
     </div>
     <div class="converter-ctn">
-      <div class="">Convert <span id="convertFromTxt"></span> to <span id="convertToTxt"></span></div>
+      <div class="convert-fr-to-txt">Convert <span id="convertFromTxt"></span> to <span id="convertToTxt"></span></div>
       <div class="convertion-wrapper">
         <div class="selection-wrapper">
           <select name="tempUnitFrom" id="tempUnitFrom">
index 577bdc482cffbbf7c02d5eb80a4c6cda410f3b8b..c95e10a2754099dcd4cac4f014b0d80b2b104f37 100644 (file)
--- a/script.js
+++ b/script.js
@@ -74,8 +74,7 @@ const calculate = (value) => {
   const to = tempUnitTo.value;
 
   if (!parsedInt || isNaN(parsedInt)) {
-    result.innerHTML = updateOutputTxt(from, to, convert(parsedInt, from, to));
-    return;
+    return result.innerHTML = updateOutputTxt(0, 0, convert(parsedInt, 0, 0));
   } else {
     document.getElementById("result").innerHTML = updateOutputTxt(from, to, convert(parsedInt, from, to));
   }
index 13750beef742fe572bce90113e49b649d60843eb..40832317ba2d1bfcea1c079f5d84852fb0c19882 100644 (file)
@@ -1,4 +1,8 @@
 :root {
+  --mobile-txt-sml: 2rem;
+  --mobile-txt-mdm: 3rem;
+  --mobile-txt-lrg: 4rem;
+  --box-shadow: 0rem 0.2rem 0.8rem #00000025;
   --button: #0031a2;
 }
 *,
   padding: 0;
 }
 html {
-  /* font-size: 62.5%; */
+  font-size: 62.5%;
 }
 main {
   width: 90%;
   margin: 0 auto;
 }
+.app-title {
+  font-size: var(--mobile-txt-lrg);
+}
+.app-description {
+  font-size: var(--mobile-txt-sml);
+}
 .converter-ctn {
-  box-shadow: 0rem 0.2rem 0.8rem #00000025;
-  padding: 1rem 2rem;
+  box-shadow: var(--box-shadow);
+  padding: 2rem;
   margin-top: 1.4rem;
 }
+.convert-fr-to-txt {
+  font-size: var(--mobile-txt-sml);
+}
 .convertion-wrapper {
   white-space: nowrap;
 }
@@ -29,15 +42,25 @@ main {
   margin-top: 0.4rem;
 }
 select {
+  font-size: var(--mobile-txt-sml);
+  padding: 1rem;
   width: 50%;
+  background-color: lightblue;
+  border: 0.1rem solid black;
+  border-radius: 0.2rem;
+  box-shadow: var(--box-shadow);
 }
 input {
+  font-size: var(--mobile-txt-sml);
+  padding: 1rem;
   margin-top: 0.4rem;
   width: 100%;
+  box-shadow: var(--box-shadow);
 }
 #result {
+  font-size: var(--mobile-txt-mdm);
   text-align: center;
-  padding: 1rem;
+  padding: 2rem;
 }
 
 @media only screen and (min-width: 1240px) {