Add UA detection

This commit is contained in:
Late Night Defender 2023-08-10 18:24:31 +07:00
parent 12980b1669
commit 2d7bda3aa2
8 changed files with 167 additions and 30 deletions

61
browser.html Normal file
View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<meta http-equiv="Content-Language" content="th">
<meta http-equiv="content-Type" content="text/html; charset=UTF-8">
<title>ข้อมูลเบราว์เซอร์</title>
<link rel="icon" type="image/png" href="icons/ttt-org.png">
</head>
<body>
<div class="topbar">
<a href="index.html" class="backbutton">
<img src="icons/left.svg">
</a>
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
<h4>ข้อมูลเบราว์เซอร์</h4>
</div>
</div>
<div class="grid-container">
<div class="middle">
<div class="list" style="margin-top: 1.5cm;">
<a class="listinfo">
<div style="display: flex; margin-left: 0.5cm; align-items: center; justify-content: left;">
<p>เบราว์เซอร์</p>
</div>
<div style="display: flex; margin-right: 0.5cm; align-items: center; justify-content: right;">
<p id="browser-display"></p>
</div>
</a>
<div class="separator"></div>
<a class="listinfo">
<div style="display: flex; margin-left: 0.5cm; align-items: center; justify-content: left;">
<p>ระบบปฏิบัติการ</p>
</div>
<div style="display: flex; margin-right: 0.5cm; align-items: center; justify-content: right;">
<p id="os-display"></p>
</div>
</a>
</div>
</div>
</div>
</body>
<script>
const agent = navigator.userAgent;
const browserName = agent.split(" ")[agent.split(" ").length-1]
document.getElementById("browser-display").innerHTML = browserName;
const OS = agent.split("(")[1].split(")")[0]
document.getElementById("os-display").innerHTML = OS;
</script>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

2
icons/left.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 10.9375 0.996094 c -0.292969 0 -0.558594 0.128906 -0.742188 0.328125 l -6.671874 6.671875 l 6.671874 6.675781 c 0.011719 0.011719 0.023438 0.023437 0.035157 0.03125 c 0.179687 0.183594 0.429687 0.292969 0.707031 0.292969 h 1 v -1 c 0 -0.273438 -0.113281 -0.523438 -0.292969 -0.707032 c -0.011719 -0.007812 -0.019531 -0.019531 -0.035156 -0.03125 l -5.257813 -5.261718 l 5.292969 -5.292969 c 0.179688 -0.179687 0.292969 -0.429687 0.292969 -0.707031 v -1 z m 0 0"/></svg>

After

Width:  |  Height:  |  Size: 606 B

BIN
icons/nextcloud.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

2
icons/right.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 4 0.996094 v 1 c 0 0.296875 0.125 0.558594 0.328125 0.742187 l 5.257813 5.257813 l -5.257813 5.261718 l -0.035156 0.03125 c -0.179688 0.183594 -0.292969 0.433594 -0.292969 0.707032 v 1 h 1 c 0.277344 0 0.527344 -0.109375 0.707031 -0.292969 l 0.035157 -0.03125 l 6.671874 -6.675781 l -6.671874 -6.671875 c -0.183594 -0.199219 -0.449219 -0.328125 -0.742188 -0.328125 z m 0 0"/></svg>

After

Width:  |  Height:  |  Size: 519 B

View file

@ -118,7 +118,7 @@
<!-- Nextcloud --> <!-- Nextcloud -->
<div class="inner-grid"> <div class="inner-grid">
<div> <div>
<img src="icons/nextcloud.svg" alt="Nextcloud" width="80" height="80" style="margin-left: 0.3cm;"> <img src="icons/nextcloud.png" alt="Nextcloud" width="80" height="80" style="margin-left: 0.3cm;">
</div> </div>
<div> <div>
<h3>Nextcloud</h3> <h3>Nextcloud</h3>
@ -202,37 +202,22 @@
<h3>เครื่องมือ</h3> <h3>เครื่องมือ</h3>
<div class="list"> <div class="list">
<div class="inner-grid"> <a class="listaction" href="ip.html">
<div> <div style="display: flex; margin-left: 0.5cm; align-items: center;">
<img src="icons/" alt="ip-address" width="80" height="80" style="margin-left: 0.3cm; border-radius: 40px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);"> <p>หมายเลข IP</p>
</div>
<div>
<div style="display: flex; margin-bottom: -5%; align-items: center;">
<h3>ตรวจสอบหมายเลข IP</h3>
<p></p>
</div>
<p>ดูหมายเลข IP ของคุณ</p>
</div>
<div>
<a href="https://www.techtransthai.org" class="button" rel="me">View...</a>
</div>
</div> </div>
<img src="icons/right.svg">
</a>
<div class="inner-grid"> <div class="separator"></div>
<div>
<img src="icons/" alt="user-agent" width="80" height="80" style="margin-left: 0.3cm; border-radius: 40px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);"> <a class="listaction" href="browser.html">
</div> <div style="display: flex; margin-left: 0.5cm; align-items: center;">
<div> <p>ข้อมูลเบราว์เซอร์</p>
<div style="display: flex; margin-bottom: -5%; align-items: center;">
<h3>ตรวจสอบ User Agent</h3>
<p></p>
</div>
<p>ดู User Agent ของคุณ</p>
</div>
<div>
<a href="https://www.techtransthai.org" class="button" rel="me">View...</a>
</div>
</div> </div>
<img src="icons/right.svg">
</a>
</div> </div>
<h3>รู้จักกับเรา</h3> <h3>รู้จักกับเรา</h3>

39
ip.html Normal file
View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<meta http-equiv="Content-Language" content="th">
<meta http-equiv="content-Type" content="text/html; charset=UTF-8">
<title>หมายเลข IP</title>
<link rel="icon" type="image/png" href="icons/ttt-org.png">
</head>
<body>
<div class="topbar">
<a href="index.html" class="backbutton">
<img src="icons/left.svg">
</a>
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
<h4>หมายเลข IP</h4>
</div>
</div>
<div class="grid-container">
<div class="middle">
<div class="list" style="margin-top: 1.5cm;">
<a class="listinfo">
<div style="display: flex; margin-left: 0.5cm; align-items: center; justify-content: left;">
<p>หมายเลข IPv4</p>
</div>
<div style="display: flex; margin-right: 0.5cm; align-items: center; justify-content: right;">
<p>127.0.0.1</p>
</div>
</a>
</div>
</div>
</div>
</body>
</html>

View file

@ -106,3 +106,51 @@ body {
height: 1px; height: 1px;
background-color: rgba(237, 237, 237, 1); background-color: rgba(237, 237, 237, 1);
} }
.listaction {
display: grid;
grid-template-columns: 1fr 1cm;
text-decoration: none;
color: black;
align-items: center;
}
.topbar {
position: absolute;
width: 100%;
height: 1.2cm;
top: 0px;
left: 0px;
background-color: rgba(255, 255, 255, 1);
border: 1px solid rgba(224, 224, 224, 1);
}
.listinfo {
display: grid;
grid-template-columns: 1fr 1fr;
text-decoration: none;
color: black;
align-items: center;
}
.backbutton {
position: absolute;
color: black;
border-radius:10px;
justify-content: center;
align-items: center;
text-decoration: none;
display: grid;
font-size: 14px;
cursor: pointer;
margin: 0.1cm;
transition-duration: 0.2s;
width: 1cm;
height: 1cm;
}
.backbutton:hover {
background-color: #DEDEDE;
}