File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments