Skip to content

Commit 16cbfce

Browse files
Merge pull request #1406 from devWonderkind/GSSoC
Add logo finder
2 parents d0b1983 + 432113d commit 16cbfce

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Projects/Logo Finder/index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<script src="https://cdn.tailwindcss.com"></script>
7+
<link rel="stylesheet" href="index.css">
8+
<link rel="icon" href="logo.png" type="image/x-icon">
9+
<title>Logo Finder</title>
10+
11+
</head>
12+
<body class="bg-gradient-to-r from-violet-500 to-fuchsia-500 text-center p-12">
13+
<h1 class="text-7xl text-white font-semibold drop-shadow-lg ">Logo Finder</h1>
14+
<input type="text" id="urlInput" class="p-3 m-8 w-4/5 max-w-sm text-2xl font-bold rounded-lg drop-shadow-2xl" placeholder="Enter company website URL...">
15+
<button onclick="findLogo()" class="bg-sky-700 px-4 py-2 text-white hover:bg-sky-800 sm:px-8 sm:py-3 text-2xl rounded-lg font-bold drop-shadow-2xl">Find Logo</button>
16+
<div id="logoContainer" style="display:none;">
17+
18+
<img id="logoImage" src="" alt="Company Logo" class="max-w-xs border-double p-2.5 mt-5 inline">
19+
<br>
20+
<button id="downloadLogo" onclick="downloadLogo()" class="bg-sky-700 px-4 py-2 text-white hover:bg-sky-800 sm:px-8 sm:py-3 text-2xl rounded-lg font-bold drop-shadow-2xl">Download Logo</button>
21+
</div>
22+
<script>
23+
function findLogo() {
24+
const url = document.getElementById('urlInput').value;
25+
if (!url) {
26+
alert('Please enter a URL');
27+
return;
28+
29+
}
30+
const logoAPI = `https://logo.clearbit.com/${url}`;
31+
document.getElementById('logoImage').src = logoAPI;
32+
document.getElementById('logoContainer').style.display = 'block';
33+
}
34+
35+
function downloadLogo() {
36+
const logoURL = document.getElementById('logoImage').src;
37+
const a = document.createElement('a');
38+
a.href = logoURL;
39+
a.download = 'logo.png';
40+
a.click();
41+
}
42+
</script>
43+
</body>
44+
</html>

Projects/Logo Finder/logo.png

3.05 KB
Loading

0 commit comments

Comments
 (0)