Skip to content

Commit

Permalink
Updated website
Browse files Browse the repository at this point in the history
  • Loading branch information
IiTossiI authored Sep 26, 2023
1 parent 030ee8e commit 0a1afb6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
<div class="main">
Welcome to AntiUtopia!<br><br>AntiUtopia is a very advanced minecraft CountryRP where you can create your own countries, currencies, languages and other cool stuff!
</div>
<div class="main">
Rules
<div class="rules">
<span>Loading rules...</span>
</div>
</div>
<div class="main">
<div class="latest"></div> Latest news<br>
<div class="news">
Expand Down
10 changes: 9 additions & 1 deletion main.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ button:hover {
border-bottom: solid 0px #AAAAAA;
border-top: solid 4px #444444;
}
h1, h2, h3, h4, h5, h6 {
h1, h2, h3, h4, h5, h6, p {
margin: 0px;
}
img {
Expand All @@ -56,3 +56,11 @@ img {
margin-top: 4px;
padding-top: 4px;
}
.rules {
background-color: #333333;
border: solid 1px black;
padding: 8px;
}
.rules > hr {
border-color: black;
}
17 changes: 17 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
var rules = document.querySelector(".rules")
var news = document.querySelector(".news")

fetch("https://antiutopia.glitch.me/server.rules").then(response => {
if (response.status == 200) {
response.text().then(data => {
data = data.split("\n")
rules.innerHTML = ""
data.forEach(rule => {
rules.innerHTML += "<span>" + rule + "</span><br><hr>"
})
rules.innerHTML = rules.innerHTML.slice(0, -8)
})
} else {
rules.innerHTML = "<span>Unable to load rules</span>"
}
})


fetch("https://antiutopia.glitch.me/latest.news").then(response => {
if (response.status == 200) {
response.text().then(data => {
Expand Down

0 comments on commit 0a1afb6

Please sign in to comment.