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> <body>
<div class="topbar"> <div class="topbar">
<a href="index.html" class="backbutton"> <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> </a>
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;"> <div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
<h4>ข้อมูลเบราว์เซอร์</h4> <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> <body>
<div class="header"> <div class="header">
<img src="icons/ttt-org.png" alt="TTT Logo" width="64" height="64" style="margin-right: 10px;"> <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>
<div class="grid-container"> <div class="grid-container">
@ -206,7 +206,8 @@
<div style="display: flex; margin-left: 0.5cm; align-items: center;"> <div style="display: flex; margin-left: 0.5cm; align-items: center;">
<p>หมายเลข IP</p> <p>หมายเลข IP</p>
</div> </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> </a>
<div class="separator"></div> <div class="separator"></div>
@ -215,7 +216,7 @@
<div style="display: flex; margin-left: 0.5cm; align-items: center;"> <div style="display: flex; margin-left: 0.5cm; align-items: center;">
<p>ข้อมูลเบราว์เซอร์</p> <p>ข้อมูลเบราว์เซอร์</p>
</div> </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> </a>
</div> </div>
@ -224,7 +225,7 @@
<div class="list"> <div class="list">
<div class="inner-grid"> <div class="inner-grid">
<div> <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> <div>
<div style="display: flex; margin-bottom: -5%; align-items: center;"> <div style="display: flex; margin-bottom: -5%; align-items: center;">

View file

@ -11,7 +11,7 @@
<body> <body>
<div class="topbar"> <div class="topbar">
<a href="index.html" class="backbutton"> <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> </a>
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;"> <div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
<h4>หมายเลข IP</h4> <h4>หมายเลข IP</h4>

244
style.css
View file

@ -5,18 +5,43 @@ html *
font-family: Cantarell, sans-serif; font-family: Cantarell, sans-serif;
} }
body {
background-color: #fafafa;
}
.header { .header {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.button {
.middle {
grid-area: middle;
width: 15cm;
}
.inner-grid {
display: grid;
align-items: center;
grid-template-columns: 3cm 1fr 3cm;
grid-template-areas:
'inner-left inner-middle inner-right'
}
@media (prefers-color-scheme: light) {
body {
background-color: #fafafa;
}
.logo {
color: #000;
}
.grid-container {
display: grid;
justify-content: center;
color: #000000;
grid-template-areas:
'left middle right'
}
.button {
background-color: #EBEBEB; background-color: #EBEBEB;
color: black; color: black;
border: none; border: none;
@ -32,20 +57,13 @@ body {
width: 100px; width: 100px;
height: 35px; height: 35px;
transition-duration: 0.2s; transition-duration: 0.2s;
} }
.button:hover { .button:hover {
background-color: #E0E0E0; background-color: #E0E0E0;
} }
.footer {
display: flex;
justify-content: center;
align-items: center;
}
.bigbutton {
.bigbutton {
background-color: #fafafa; background-color: #fafafa;
color: black; color: black;
border-radius:10px; border-radius:10px;
@ -59,64 +77,34 @@ body {
padding-left: 15px; padding-left: 15px;
margin-bottom: 20px; margin-bottom: 20px;
transition-duration: 0.2s; transition-duration: 0.2s;
} }
.bigbutton:hover { .bigbutton:hover {
background-color: #E0E0E0; background-color: #E0E0E0;
}
} .list {
.grid-container {
display: grid;
justify-content: center;
grid-template-areas:
'left middle right'
}
.left {
grid-area: left;
}
.middle {
grid-area: middle;
width: 15cm;
}
.right {
grid-area: right;
}
.inner-grid {
display: grid;
align-items: center;
grid-template-columns: 3cm 1fr 3cm;
grid-template-areas:
'inner-left inner-middle inner-right'
}
.list {
border-radius: 12px 12px 12px 12px; border-radius: 12px 12px 12px 12px;
background-color: rgba(255, 255, 255, 1); background-color: #ffffff;
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13); box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.13);
margin-bottom: 50px; margin-bottom: 50px;
} }
.separator { .separator {
width: 15cm; width: 15cm;
height: 1px; height: 1px;
background-color: rgba(237, 237, 237, 1); background-color: rgba(237, 237, 237, 1);
} }
.listaction { .listaction {
display: grid; display: grid;
grid-template-columns: 1fr 1cm; grid-template-columns: 1fr 1cm;
text-decoration: none; text-decoration: none;
color: black; color: black;
align-items: center; align-items: center;
}
} .topbar {
.topbar {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 1.2cm; height: 1.2cm;
@ -124,18 +112,18 @@ body {
left: 0px; left: 0px;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
border: 1px solid rgba(224, 224, 224, 1); border: 1px solid rgba(224, 224, 224, 1);
} color: #000000;
}
.listinfo { .listinfo {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
text-decoration: none; text-decoration: none;
color: black; color: black;
align-items: center; align-items: center;
}
} .backbutton {
.backbutton {
position: absolute; position: absolute;
color: black; color: black;
border-radius:10px; border-radius:10px;
@ -149,8 +137,132 @@ body {
transition-duration: 0.2s; transition-duration: 0.2s;
width: 1cm; width: 1cm;
height: 1cm; height: 1cm;
}
.backbutton:hover {
background-color: #DEDEDE;
}
} }
.backbutton:hover { @media (prefers-color-scheme: dark) {
background-color: #DEDEDE;
.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;
}
} }