-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
53 lines (53 loc) · 1.95 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<!-- Created By PenguinTech -->
<!--Thanks to Codingnepal - YouTube.com-->
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Welcome to PenguinTech</title>
<link rel="shortcut icon" type="image" href="./sources/logo.PNG">
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<img src="./sources/logo.png">
<div class="center">
<div class="outer button">
<a href="./sources/main.html"><button>Take me in</button> </a>
<span></span>
<span></span>
</div>
</div>
<div class="detect">
<h2>Browser:</h2>
<div class="logos">
<img class="chrome" src="./logos/chrome.png" alt="chrome" title="Google Chrome">
<img class="firefox" src="./logos/firefox.png" alt="firefox" title="Mozilla Firefox">
<img class="edge" src="./logos/edge.png" alt="edge" title="Microsoft Edge">
<img class="opera" src="./logos/opera.png" alt="opera" title="Opera">
<img class="safari" src="./logos/safari.png" alt="safari" title="Apple Safari">
</div>
</div>
<script>
let userAgent = navigator.userAgent;
let browser;
if(userAgent.match(/edg/i)){
browser = "edge";
}else if(userAgent.match(/firefox|fxios/i)){
browser = "firefox";
}else if(userAgent.match(/opr\//i)){
browser = "opera";
}else if(userAgent.match(/chrome|chromium|crios/i)){
browser = "chrome";
}else if(userAgent.match(/safari/i)){
browser = "safari";
}else{
alert("Other browser");
}
const logo = document.querySelector(`.logos .${browser}`);
if(logo){
logo.style.opacity = "1";
}
</script>
</body>
</html>