Simple Text Page
This commit is contained in:
parent
6a404810f0
commit
7cd2503c46
1 changed files with 49 additions and 0 deletions
49
text/index.html
Normal file
49
text/index.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
:root {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
width: 99%;
|
||||
height: 98%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
body.dark {
|
||||
color: #dfdfdf;
|
||||
background-color: #282828;
|
||||
}
|
||||
h1, h4 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 { font-size: 2.5rem; margin-bottom: 5px !important; }
|
||||
h4 { font-size: 1.1rem; }
|
||||
</style>
|
||||
<h1>Title</h1>
|
||||
<h4>Text</h4>
|
||||
<script>
|
||||
let h1 = document.querySelector('h1');
|
||||
let h4 = document.querySelector('h4');
|
||||
h1.textContent = (location.search.match(/[?&]title=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
|
||||
h4.textContent = (location.search.match(/[?&]text=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
|
||||
if (location.search.match(/[?&]theme=dark/))
|
||||
document.body.classList.add('dark');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue