Skip to content

Commit add96b0

Browse files
style: format code with ClangFormat, dotnet-format, Prettier, RuboCop, Rustfmt, Scalafmt, StandardJS, StandardRB and swift-format
This commit fixes the style issues introduced in e44d9df according to the output from ClangFormat, dotnet-format, Prettier, RuboCop, Rustfmt, Scalafmt, StandardJS, StandardRB and swift-format. Details: None
1 parent e44d9df commit add96b0

4 files changed

Lines changed: 78 additions & 76 deletions

File tree

index.html

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>All-in-One Tools</title>
7-
<link rel="stylesheet" href="css/style.css">
8-
</head>
9-
<body>
10-
<header>
11-
<h1>All-in-One Tools</h1>
12-
<p>A collection of useful tools, all in one place.</p>
13-
</header>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>All-in-One Tools</title>
7+
<link rel="stylesheet" href="css/style.css" />
8+
</head>
9+
<body>
10+
<header>
11+
<h1>All-in-One Tools</h1>
12+
<p>A collection of useful tools, all in one place.</p>
13+
</header>
1414

15-
<main class="tool-grid">
16-
<div class="tool-card">
17-
<h2>Unit Converter</h2>
18-
<p>Convert between common units (length, weight, temperature).</p>
19-
<a href="tools/converter.html" class="btn">Open</a>
20-
</div>
21-
<div class="tool-card">
22-
<h2>Calculator</h2>
23-
<p>Perform quick calculations.</p>
24-
<a href="tools/calculator.html" class="btn">Open</a>
25-
</div>
26-
</main>
15+
<main class="tool-grid">
16+
<div class="tool-card">
17+
<h2>Unit Converter</h2>
18+
<p>Convert between common units (length, weight, temperature).</p>
19+
<a href="tools/converter.html" class="btn">Open</a>
20+
</div>
21+
<div class="tool-card">
22+
<h2>Calculator</h2>
23+
<p>Perform quick calculations.</p>
24+
<a href="tools/calculator.html" class="btn">Open</a>
25+
</div>
26+
</main>
2727

28-
<footer>
29-
<p>Made with ❤️ by LCS</p>
30-
</footer>
31-
</body>
32-
</html>
28+
<footer>
29+
<p>Made with ❤️ by LCS</p>
30+
</footer>
31+
</body>
32+
</html>

tools/converter.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
background: white;
55
padding: 1.5rem;
66
border-radius: 12px;
7-
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
7+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
88
}
99

1010
.converter-box {
@@ -17,7 +17,7 @@
1717
font-weight: bold;
1818
}
1919

20-
.converter-box input,
20+
.converter-box input,
2121
.converter-box select {
2222
width: 100%;
2323
padding: 0.6rem;
@@ -29,4 +29,4 @@
2929
.converter-box h2 {
3030
text-align: center;
3131
color: #4f46e5;
32-
}
32+
}

tools/converter.html

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Unit Converter</title>
7-
<link rel="stylesheet" href="../css/style.css">
8-
<link rel="stylesheet" href="converter.css">
9-
</head>
10-
<body>
11-
<header>
12-
<h1>Unit Converter</h1>
13-
<a href="../index.html" class="btn">← Back</a>
14-
</header>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Unit Converter</title>
7+
<link rel="stylesheet" href="../css/style.css" />
8+
<link rel="stylesheet" href="converter.css" />
9+
</head>
10+
<body>
11+
<header>
12+
<h1>Unit Converter</h1>
13+
<a href="../index.html" class="btn">← Back</a>
14+
</header>
1515

16-
<main class="converter-container">
17-
<div class="converter-box">
18-
<label for="type">Conversion Type:</label>
19-
<select id="type">
20-
<option value="length">Length (m ↔ km)</option>
21-
<option value="weight">Weight (kg ↔ g)</option>
22-
<option value="temperature">Temperature (°C ↔ °F)</option>
23-
</select>
24-
</div>
16+
<main class="converter-container">
17+
<div class="converter-box">
18+
<label for="type">Conversion Type:</label>
19+
<select id="type">
20+
<option value="length">Length (m ↔ km)</option>
21+
<option value="weight">Weight (kg ↔ g)</option>
22+
<option value="temperature">Temperature (°C ↔ °F)</option>
23+
</select>
24+
</div>
2525

26-
<div class="converter-box">
27-
<label for="inputValue">Input Value:</label>
28-
<input type="number" id="inputValue" placeholder="Enter value">
29-
</div>
26+
<div class="converter-box">
27+
<label for="inputValue">Input Value:</label>
28+
<input type="number" id="inputValue" placeholder="Enter value" />
29+
</div>
3030

31-
<div class="converter-box">
32-
<button id="convertBtn" class="btn">Convert</button>
33-
</div>
31+
<div class="converter-box">
32+
<button id="convertBtn" class="btn">Convert</button>
33+
</div>
3434

35-
<div class="converter-box">
36-
<h2>Result: <span id="result">-</span></h2>
37-
</div>
38-
</main>
35+
<div class="converter-box">
36+
<h2>Result: <span id="result">-</span></h2>
37+
</div>
38+
</main>
3939

40-
<script src="converter.js"></script>
41-
</body>
42-
</html>
40+
<script src="converter.js"></script>
41+
</body>
42+
</html>

tools/converter.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,28 @@ convertBtn.addEventListener("click", () => {
1717
switch (type) {
1818
case "length":
1919
// meters <-> kilometers
20-
result = value >= 1000
21-
? `${(value / 1000).toFixed(2)} km`
22-
: `${(value * 1000).toFixed(2)} m`;
20+
result =
21+
value >= 1000
22+
? `${(value / 1000).toFixed(2)} km`
23+
: `${(value * 1000).toFixed(2)} m`;
2324
break;
2425

2526
case "weight":
2627
// kilograms <-> grams
27-
result = value >= 1
28-
? `${(value * 1000).toFixed(2)} g`
29-
: `${(value / 1000).toFixed(2)} kg`;
28+
result =
29+
value >= 1
30+
? `${(value * 1000).toFixed(2)} g`
31+
: `${(value / 1000).toFixed(2)} kg`;
3032
break;
3133

3234
case "temperature":
3335
// Celsius <-> Fahrenheit
34-
result = `${value} °C = ${(value * 9/5 + 32).toFixed(2)} °F`;
36+
result = `${value} °C = ${((value * 9) / 5 + 32).toFixed(2)} °F`;
3537
break;
3638

3739
default:
3840
result = "Unsupported conversion";
3941
}
4042

4143
resultSpan.textContent = result;
42-
});
44+
});

0 commit comments

Comments
 (0)