Add auto dark mode detection

This commit is contained in:
Late Night Defender 2023-08-11 14:34:22 +07:00
parent d3a1a20b3a
commit 19f0c23bb3
6 changed files with 244 additions and 135 deletions

View file

@ -11,7 +11,7 @@
<body>
<div class="topbar">
<a href="index.html" class="backbutton">
<img src="icons/left.svg">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path fill="currentColor" 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>
</a>
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
<h4>ข้อมูลเบราว์เซอร์</h4>

View file

@ -1,2 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 606 B

View file

@ -1,2 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 519 B

View file

@ -11,7 +11,7 @@
<body>
<div class="header">
<img src="icons/ttt-org.png" alt="TTT Logo" width="64" height="64" style="margin-right: 10px;">
<h1>TechTransThai 🏳️‍⚧️</h1>
<h1 class="logo">TechTransThai 🏳️‍⚧️</h1>
</div>
<div class="grid-container">
@ -206,7 +206,8 @@
<div style="display: flex; margin-left: 0.5cm; align-items: center;">
<p>หมายเลข IP</p>
</div>
<img src="icons/right.svg">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px" ><path fill="currentColor" 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>
</a>
<div class="separator"></div>
@ -215,7 +216,7 @@
<div style="display: flex; margin-left: 0.5cm; align-items: center;">
<p>ข้อมูลเบราว์เซอร์</p>
</div>
<img src="icons/right.svg">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px" ><path fill="currentColor" 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>
</a>
</div>
@ -224,7 +225,7 @@
<div class="list">
<div class="inner-grid">
<div>
<img src="icons/latenightdef.png" alt="latenightdef" width="80" height="80" style="margin-left: 0.3cm; border-radius: 40px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);">
<img src="icons/latenightdef.png" alt="latenightdef" width="80" height="80" style="margin-left: 0.3cm; border-radius: 40px">
</div>
<div>
<div style="display: flex; margin-bottom: -5%; align-items: center;">

View file

@ -11,7 +11,7 @@
<body>
<div class="topbar">
<a href="index.html" class="backbutton">
<img src="icons/left.svg">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path fill="currentColor" 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>
</a>
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
<h4>หมายเลข IP</h4>

362
style.css
View file

@ -5,76 +5,10 @@ html *
font-family: Cantarell, sans-serif;
}
body {
background-color: #fafafa;
}
.header {
display: flex;
justify-content: center;
align-items: center;
}
.button {
background-color: #EBEBEB;
color: black;
border: none;
border-radius: 8px;
justify-content: center;
align-items: center;
text-decoration: none;
display: flex;
font-size: 16px;
font-weight: bold;
margin: 4px 2px;
cursor: pointer;
width: 100px;
height: 35px;
transition-duration: 0.2s;
}
.button:hover {
background-color: #E0E0E0;
}
.footer {
display: flex;
justify-content: center;
align-items: center;
}
.bigbutton {
background-color: #fafafa;
color: black;
border-radius:10px;
justify-content: center;
align-items: center;
text-decoration: none;
display: grid;
font-size: 14px;
cursor: pointer;
padding-right: 15px;
padding-left: 15px;
margin-bottom: 20px;
transition-duration: 0.2s;
}
.bigbutton:hover {
background-color: #E0E0E0;
}
.grid-container {
display: grid;
justify-content: center;
grid-template-areas:
'left middle right'
}
.left {
grid-area: left;
display: flex;
justify-content: center;
align-items: center;
}
.middle {
@ -82,10 +16,6 @@ body {
width: 15cm;
}
.right {
grid-area: right;
}
.inner-grid {
display: grid;
align-items: center;
@ -93,64 +23,246 @@ body {
grid-template-areas:
'inner-left inner-middle inner-right'
}
@media (prefers-color-scheme: light) {
.list {
border-radius: 12px 12px 12px 12px;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);
margin-bottom: 50px;
}
body {
background-color: #fafafa;
}
.separator {
width: 15cm;
height: 1px;
background-color: rgba(237, 237, 237, 1);
}
.logo {
color: #000;
}
.listaction {
display: grid;
grid-template-columns: 1fr 1cm;
text-decoration: none;
color: black;
align-items: center;
.grid-container {
display: grid;
justify-content: center;
color: #000000;
grid-template-areas:
'left middle right'
}
.button {
background-color: #EBEBEB;
color: black;
border: none;
border-radius: 8px;
justify-content: center;
align-items: center;
text-decoration: none;
display: flex;
font-size: 16px;
font-weight: bold;
margin: 4px 2px;
cursor: pointer;
width: 100px;
height: 35px;
transition-duration: 0.2s;
}
.button:hover {
background-color: #E0E0E0;
}
.bigbutton {
background-color: #fafafa;
color: black;
border-radius:10px;
justify-content: center;
align-items: center;
text-decoration: none;
display: grid;
font-size: 14px;
cursor: pointer;
padding-right: 15px;
padding-left: 15px;
margin-bottom: 20px;
transition-duration: 0.2s;
}
.bigbutton:hover {
background-color: #E0E0E0;
}
.list {
border-radius: 12px 12px 12px 12px;
background-color: #ffffff;
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);
margin-bottom: 50px;
}
.separator {
width: 15cm;
height: 1px;
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);
color: #000000;
}
.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;
}
}
.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);
}
@media (prefers-color-scheme: dark) {
.listinfo {
display: grid;
grid-template-columns: 1fr 1fr;
text-decoration: none;
color: black;
align-items: center;
.logo {
color: #fff;
}
body {
background-color: #222222;
}
.grid-container {
display: grid;
justify-content: center;
color: #ffffff;
grid-template-areas:
'left middle right'
}
.button {
background-color: #4a4a4a;
color: #ffffff;
border: none;
border-radius: 8px;
justify-content: center;
align-items: center;
text-decoration: none;
display: flex;
font-size: 16px;
font-weight: bold;
margin: 4px 2px;
cursor: pointer;
width: 100px;
height: 35px;
transition-duration: 0.2s;
}
.button:hover {
background-color: #595959;
}
.bigbutton {
background-color: #222222;
color: #ffffff;
border-radius:10px;
justify-content: center;
align-items: center;
text-decoration: none;
display: grid;
font-size: 14px;
cursor: pointer;
padding-right: 15px;
padding-left: 15px;
margin-bottom: 20px;
transition-duration: 0.2s;
}
.bigbutton:hover {
background-color: #595959;
}
.list {
border-radius: 12px 12px 12px 12px;
background-color: #363636;
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);
margin-bottom: 50px;
}
.separator {
width: 15cm;
height: 1px;
background-color: #232323;
}
.listaction {
display: grid;
grid-template-columns: 1fr 1cm;
text-decoration: none;
color: #ffffff;
align-items: center;
}
.topbar {
position: absolute;
width: 100%;
height: 1.2cm;
top: 0px;
left: 0px;
background-color: #303030;
border: 1px solid #1f1f1f;
color: #ffffff;
}
.listinfo {
display: grid;
grid-template-columns: 1fr 1fr;
text-decoration: none;
color: #ffffff;
align-items: center;
}
.backbutton {
position: absolute;
color: #ffffff;
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: #3e3e3e;
}
}
.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;
}