Skip to content

Commit 5649aff

Browse files
author
ricky.gummadi
committed
update styles and add ICO
1 parent 0416c59 commit 5649aff

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

build/build.mjs

+11-1
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,25 @@ async function minifyHTML() {
3838
}
3939

4040
async function compressImages() {
41-
await imagemin(['src/logo.jpeg'], {
41+
const imageFiles = [
42+
'src/logo.jpeg',
43+
'src/logo.png',
44+
'src/logo.ico'
45+
];
46+
47+
await imagemin(imageFiles, {
4248
destination: 'dist/',
4349
plugins: [
4450
imageminMozjpeg({ quality: 75 }),
4551
imageminPngquant({ quality: [0.6, 0.8] })
4652
]
4753
});
54+
55+
// Directly copy ICO files as imagemin doesn't handle ICO files
56+
fs.copyFileSync('src/logo.ico', 'dist/logo.ico');
4857
}
4958

59+
5060
function copyCNAME() {
5161
fs.copyFileSync('src/CNAME', 'dist/CNAME');
5262
}

build/build.test.js

+16
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,20 @@ describe('Build Process', () => {
156156
throw error;
157157
}
158158
});
159+
160+
test('HTML includes favicon', () => {
161+
const distHtml = fs.readFileSync(distHtmlPath, 'utf8');
162+
163+
// Check that the favicon is correctly included in the HTML
164+
try {
165+
expect(distHtml).toContain('<link rel="icon" href="logo.ico" type="image/x-icon">');
166+
console.log('Success: HTML includes the favicon.');
167+
} catch (error) {
168+
console.error('Expected favicon link: <link rel="icon" href="logo.ico" type="image/x-icon">');
169+
console.error(`Actual HTML content: ${distHtml}`);
170+
error.message = 'Failed: HTML does not include the favicon link.';
171+
throw error;
172+
}
173+
});
174+
159175
});

src/index.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<title>IpSimple - A Simple Public IP Address API</title>
77
<meta name="description" content="IpSimple API is a straightforward public IP address API, designed for quick integration into any application.">
88

9+
<!-- Add this line to include the favicon -->
10+
<link rel="icon" href="logo.ico" type="image/x-icon">
11+
912
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
1013
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
1114
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
@@ -93,7 +96,7 @@ <h1><a href="#top"><img src="logo.jpeg" alt="IpSimple Logo" style="width: 100px;
9396
<h2 class="display-4 fw-bold">Effortless & Free Public IP Discovery</h2>
9497
<h3 class="lead text-center align-middle">A fast, free, reliable, and easy-to-use public IP address API</h3>
9598
<p></p>
96-
<a href="https://github.com/ipsimple" class="social-icon"><i class="fab fa-github"></i></a>
99+
<a href="https://github.com/ipsimple" class="social-icon large-font"><i class="fab fa-github"></i></a>
97100
</div>
98101
</div>
99102
</div>

src/logo.ico

16.6 KB
Binary file not shown.

src/styles.css

+4
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ code {
185185
font-weight: bold;
186186
}
187187

188+
.large-font{
189+
font-size: 2.5em !important;
190+
}
191+
188192
pre {
189193
white-space: pre-wrap; /* Allows the code to wrap */
190194
word-break: break-all; /* Prevents long words from making the container overflow */

0 commit comments

Comments
 (0)