Where people come together to learn, code, and play. Custom-built HTTP server, site generator, and website from scratch using no external libraries. Goal is to be as minimalistic and fun as possible. http://projectdivar.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SigPlace/out/articles/curabitur vel tempus ex.art...

105 lines
4.6 KiB

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/reset.css">
<link rel="stylesheet" type="text/css" href="/sig.css">
<meta charset="UTF-8">
<script type="text/javascript">
function loadCodeBackground() {
fetch("/codeBackground").then((data)=>data.text())
.then((data)=>{
document.getElementById("codeForeground").innerText=data
document.getElementById("codeBackground").innerText=data
})
}
loadCodeBackground();
</script>
</head>
<body>
<div class="contentBody">
<div class="contentWrapper"><h1>Curabitur vel tempus ex</h1><div class="expandedContent" id="content_out/articles/curabitur vel tempus ex.article">
<p class="color1">
Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. Nullam odio purus, tristique non turpis sit amet, malesuada ultricies purus. Mauris ut nulla nisl. Aenean sit amet est egestas justo volutpat consequat. Suspendisse in sagittis augue, et mattis tortor. Nullam viverra metus et nibh fringilla iaculis.
</p>
<br/>
<p class="color2">
<pre>
&lt;>&lt;Test><span class="string">"&lt;/test>&lt;/test2>&lt;test3>"</span>
</pre>
</p>
</div><div class="datebar"></div><div class="date">29 Apr 2022 7:37PM</div></div>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=curabitur vel tempus ex.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
).then((data)=>data.text())
.then((data)=>{
fetchComments()
})
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label><textarea id="msg"></textarea><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=curabitur vel tempus ex.comment").then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
document.getElementById("comments").innerHTML="";
for (var i=0;i<data.length;i++) {
if (i==0) {
document.getElementById("commentCounter").innerText=data[i]
} else {
if (data[i].trim().length>0) {
if (i%2==1) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+data[i]+"</div><br>"
} else {
data2=data[i].split(";");
document.getElementById("msg"+(i/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+data2[0]+"</sup></div></div><br>"
}
}
}
}
document.getElementById("commentContainer").style.visibility="visible"
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>