dc09.ru-old/text/index.html

52 lines
1.6 KiB
HTML
Raw Normal View History

2022-08-10 11:56:37 +04:00
<!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');
2022-08-11 17:42:30 +04:00
let caption = (location.search.match(/[?&]title=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
let content = (location.search.match(/[?&]text=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
h1.textContent = decodeURIComponent(caption);
h4.textContent = decodeURIComponent(content);
2022-08-10 11:56:37 +04:00
if (location.search.match(/[?&]theme=dark/))
document.body.classList.add('dark');
</script>
</body>
</html>