Browse Source

Initial commit

master
Graham Northup 3 years ago
commit
69078fb8ee
  1. 4
      .gitignore
  2. 18
      Makefile
  3. 8
      cmp/badges.html
  4. 5
      cmp/header.html
  5. 7
      cmp/nav.html
  6. 47
      contact.html
  7. 10
      contact.m4
  8. 57
      downloads.html
  9. 12
      downloads.m4
  10. 0
      files/.git-keep
  11. BIN
      img/Octocat/Octocat.jpg
  12. BIN
      img/Octocat/Octocat.png
  13. BIN
      img/bg/fountain.png
  14. BIN
      img/bg/path.png
  15. BIN
      img/bg/spawn.png
  16. BIN
      img/discord/color.png
  17. BIN
      img/download.png
  18. BIN
      img/email.png
  19. BIN
      img/placeholder.png
  20. BIN
      img/right_arrow.png
  21. BIN
      img/world.png
  22. 57
      index.html
  23. 27
      index.m4
  24. 19
      lib/00html.m4
  25. 28
      lib/99local.m4
  26. 47
      servers.html
  27. 10
      servers.m4
  28. 185
      style.css
  29. 27
      util/server.py
  30. 13
      util/versions.py
  31. 0
      worlds/.git-keep

4
.gitignore

@ -0,0 +1,4 @@
files/*
!files/.git-keep
worlds/*
!worlds/.git-keep

18
Makefile

@ -0,0 +1,18 @@
LIBDIR:=lib
LIBS:=$(sort $(wildcard $(LIBDIR)/*.m4))
SRCS:=$(wildcard *.m4)
OUTS:=$(SRCS:.m4=.html)
M4_DEFINES:=-Denv_libdir="$(LIBDIR)" -Denv_libs="$(LIBS)" -Denv_srcs="$(SRCS)" -Denv_outs="$(OUTS)"
website: _force $(OUTS)
_force:
.PHONY: website _force
$(OUTS): _force
%.html: %.m4
m4 -P $(M4_DEFINES) -Denv_filename="$<" $(M4FLAGS) $(LIBS) $< > $@

8
cmp/badges.html

@ -0,0 +1,8 @@
m4_define([[ll_badges]], [[<div class="badges">
ll_each_badge($@)
</div>]])m4_dnl
m4_define([[ll_each_badge]], [[m4_ifelse([[$#$1]], [[1]], [[]], [[$#]], [[0]], [[]], [[ll_badge($1)
$0(m4_shift($@))]])]])m4_dnl
m4_define([[ll_badge]], [[m4_ifelse([[$4]], [[]], [[<div]], [[<a href="$4"]]) class="badge" m4_ifelse([[$3]], [[]], [[]], [[style="$3"]])>
<img src="m4_ifelse([[$2]], [[]], [[img/placeholder.png]], [[$2]])"/><p>$1</p>
</m4_ifelse([[$4]], [[]], [[div]], [[a]])>]])m4_dnl

5
cmp/header.html

@ -0,0 +1,5 @@
m4_define([[ll_header]], [[<style type="text/css">body { background-image: url($1); }</style>
<header>
<h1><a href="./">Lusty Lavender</a></h1>
<h2>An <a href="https://electrical-age.net/">Electrical Age</a> Development Modpack</h2>
</header>]])m4_dnl

7
cmp/nav.html

@ -0,0 +1,7 @@
<nav>
<ul>
<a href="downloads.html"><li>Downloads</li></a>
<a href="servers.html"><li>Servers</li></a>
<a href="contact.html"><li>Contact</li></a>
</ul>
</nav>

47
contact.html

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Lusty Lavender</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<meta charset="utf-8"/>
<!-- Hello, and thanks for reading the source code! This is Grissess,
and all of this content was handmade in Neovim and spliced
together with GNU m4. Feel free to peek around and learn, and even
use these patterns on your own projects - but please ask us before
hosting exact replicas of our website, or hosting the modpack, so
that we can make sure everyone gets content that's up to date :) .
Have a good one! -->
</head>
<body>
<style type="text/css">body { background-image: url(img/bg/spawn.png); }</style>
<header>
<h1><a href="./">Lusty Lavender</a></h1>
<h2>An <a href="https://electrical-age.net/">Electrical Age</a> Development Modpack</h2>
</header>
<section class="main">
<nav>
<ul>
<a href="downloads.html"><li>Downloads</li></a>
<a href="servers.html"><li>Servers</li></a>
<a href="contact.html"><li>Contact</li></a>
</ul>
</nav>
<span class="discordAreaMarker">
<div class="badges">
<a href="https://discord.gg/DTGVB9a" class="badge" >
<img src="img/discord/color.png"/><p>Join our Discord server</p>
</a>
<a href="mailto:jrddunbr@gmail.com" class="badge" >
<img src="img/email.png"/><p>Send the admin an email</p>
</a>
</div>
</span>
</section>
</body>
</html>

10
contact.m4

@ -0,0 +1,10 @@
ht_include([[cmp/header.html]])m4_dnl
ll_header([[img/bg/spawn.png]])
<section class="main">
ht_include([[cmp/nav.html]])
ht_include([[cmp/badges.html]])m4_dnl
<span class="discordAreaMarker">
ll_badges([[[[Join our Discord server]],[[img/discord/color.png]],,[[https://discord.gg/DTGVB9a]]]],[[[[Send the admin an email]],[[img/email.png]],,[[mailto:jrddunbr@gmail.com]]]])
</span>
</section>

57
downloads.html

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>Lusty Lavender</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<meta charset="utf-8"/>
<!-- Hello, and thanks for reading the source code! This is Grissess,
and all of this content was handmade in Neovim and spliced
together with GNU m4. Feel free to peek around and learn, and even
use these patterns on your own projects - but please ask us before
hosting exact replicas of our website, or hosting the modpack, so
that we can make sure everyone gets content that's up to date :) .
Have a good one! -->
</head>
<body>
<style type="text/css">body { background-image: url(img/bg/fountain.png); }</style>
<header>
<h1><a href="./">Lusty Lavender</a></h1>
<h2>An <a href="https://electrical-age.net/">Electrical Age</a> Development Modpack</h2>
</header>
<section class="main">
<nav>
<ul>
<a href="downloads.html"><li>Downloads</li></a>
<a href="servers.html"><li>Servers</li></a>
<a href="contact.html"><li>Contact</li></a>
</ul>
</nav>
<div class="badges">
<a href="files/llv7.zip" class="badge" >
<img src="img/download.png"/><p>Download the latest version</p>
</a>
<a href="https://github.com/jrddunbr/ElectricalAge" class="badge" >
<img src="img/Octocat/Octocat.png"/><p>Browse source on GitHub</p>
</a>
<a href="worlds/latest.7z" class="badge" >
<img src="img/world.png"/><p>Get the map</p>
</a>
</div>
<h3>Worlds:</h3>
<ul class="versions">
<li><a href="worlds/latest.7z">latest.7z</a></li>
<li><a href="worlds/ll-07-07-2018_19:35:05.7z">ll-07-07-2018_19:35:05.7z</a></li>
<li><a href="worlds/ll-08-07-2018_04:00:22.7z">ll-08-07-2018_04:00:22.7z</a></li>
</ul>
</section>
</body>
</html>

12
downloads.m4

@ -0,0 +1,12 @@
ht_include([[cmp/header.html]])m4_dnl
ll_header([[img/bg/fountain.png]])
<section class="main">
ht_include([[cmp/nav.html]])
ht_include([[cmp/badges.html]])m4_dnl
ll_badges([[[[Download the latest version]],[[img/download.png]],,[[files/llv7.zip]]]], [[[[Browse source on GitHub]],[[img/Octocat/Octocat.png]],,[[https://github.com/jrddunbr/ElectricalAge]]]], [[[[Get the map]],[[img/world.png]],,[[worlds/latest.7z]]]])
<h3>Worlds:</h3>
m4_syscmd([[util/versions.py worlds]])
</section>

0
files/.git-keep

BIN
img/Octocat/Octocat.jpg

After

Width: 800  |  Height: 665  |  Size: 50 KiB

BIN
img/Octocat/Octocat.png

After

Width: 800  |  Height: 665  |  Size: 2.0 MiB

BIN
img/bg/fountain.png

After

Width: 1178  |  Height: 629  |  Size: 1.0 MiB

BIN
img/bg/path.png

After

Width: 1178  |  Height: 629  |  Size: 653 KiB

BIN
img/bg/spawn.png

After

Width: 889  |  Height: 629  |  Size: 867 KiB

BIN
img/discord/color.png

After

Width: 245  |  Height: 240  |  Size: 1.5 KiB

BIN
img/download.png

After

Width: 200  |  Height: 200  |  Size: 2.0 KiB

BIN
img/email.png

After

Width: 512  |  Height: 512  |  Size: 4.5 KiB

BIN
img/placeholder.png

After

Width: 128  |  Height: 128  |  Size: 391 B

BIN
img/right_arrow.png

After

Width: 626  |  Height: 530  |  Size: 40 KiB

BIN
img/world.png

After

Width: 512  |  Height: 512  |  Size: 39 KiB

57
index.html

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>Lusty Lavender</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<meta charset="utf-8"/>
<!-- Hello, and thanks for reading the source code! This is Grissess,
and all of this content was handmade in Neovim and spliced
together with GNU m4. Feel free to peek around and learn, and even
use these patterns on your own projects - but please ask us before
hosting exact replicas of our website, or hosting the modpack, so
that we can make sure everyone gets content that's up to date :) .
Have a good one! -->
</head>
<body>
<style type="text/css">body { background-image: url(img/bg/spawn.png); }</style>
<header>
<h1><a href="./">Lusty Lavender</a></h1>
<h2>An <a href="https://electrical-age.net/">Electrical Age</a> Development Modpack</h2>
</header>
<section class="main">
<nav>
<ul>
<a href="downloads.html"><li>Downloads</li></a>
<a href="servers.html"><li>Servers</li></a>
<a href="contact.html"><li>Contact</li></a>
</ul>
</nav>
<p>
<code>Lusty Lavender</code> is a relatively lightweight modpack designed specifically to experiment with the <a href="https://electrical-age.net/">Electrical Age</a> mod. It also contains some support mods:
<ul>
<li>OpenComputers,</li>
<li>Applied Energistics 2,</li>
<li>BuildCraft,</li>
<li>Thermal Expansion, Thermal Dynamics, etc.,</li>
<li>RailCraft,</li>
<li>some of Project Red,</li>
</ul>
...and so forth, mostly to serve and complement Electrical Age nicely.
</p>
<p>
The pack and the server are currently maintained by <a href="https://github.com/jrddunbr/">Jared Dunbar</a>, and the Electrical Age used in the pack may be built off his own repository tip&mdash;so don't expect it to be 100%-compatible with mainline ELN (instead, expect bugfixes!).
</p>
<p>
To get started, <a href="downloads.html">download</a> the latest version, and check out the <a href="downloads.html#instructions">instructions</a>. Then, connect to a <a href="servers.html">server</a>!
</p>
</section>
</body>
</html>

27
index.m4

@ -0,0 +1,27 @@
ht_include([[cmp/header.html]])m4_dnl
ll_header([[img/bg/spawn.png]])
<section class="main">
ht_include([[cmp/nav.html]])
<p>
<code>Lusty Lavender</code> is a relatively lightweight modpack designed specifically to experiment with the <a href="https://electrical-age.net/">Electrical Age</a> mod. It also contains some support mods:
<ul>
<li>OpenComputers,</li>
<li>Applied Energistics 2,</li>
<li>BuildCraft,</li>
<li>Thermal Expansion, Thermal Dynamics, etc.,</li>
<li>RailCraft,</li>
<li>some of Project Red,</li>
</ul>
...and so forth, mostly to serve and complement Electrical Age nicely.
</p>
<p>
The pack and the server are currently maintained by <a href="https://github.com/jrddunbr/">Jared Dunbar</a>, and the Electrical Age used in the pack may be built off his own repository tip&mdash;so don't expect it to be 100%-compatible with mainline ELN (instead, expect bugfixes!).
</p>
<p>
To get started, <a href="downloads.html">download</a> the latest version, and check out the <a href="downloads.html#instructions">instructions</a>. Then, connect to a <a href="servers.html">server</a>!
</p>
</section>

19
lib/00html.m4

@ -0,0 +1,19 @@
m4_divert(-1)
This file is loaded first. Place any macros you want to access from all files
here. Note that the Makefile runs with -P, so all builtins have an m4 prefix.
First and foremost, change the quote character to doubled brackets, which are
unlikely to conflict with any syntactic element in HTML itself. Note that the
string end quote would conflict with CDATA for XHTML, so this should be
avoided. HTML5 generally has no need for CDATA sections.
m4_changequote(`[[', `]]')
ht_include([[filename]]) - include a filename relative to the Makefile root.
(This is a thin wrapper around m4_include which can be redirected or
redefined.)
m4_define([[ht_include]], [[m4_include($@)]])
m4_divert(0)m4_dnl

28
lib/99local.m4

@ -0,0 +1,28 @@
m4_divert(-1)
This file contains local configuration. For the most part, it's responsible for
printing out the initial lines of all files. You should avoid anything not
specifically local here--it can go in 00html.m4 instead.
m4_divert(9)m4_dnl This section contains footer material for all pages.
</body>
</html>
m4_divert(0)m4_dnl
<!DOCTYPE html>
<html>
<head>
<title>Lusty Lavender</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<meta charset="utf-8"/>
<!-- Hello, and thanks for reading the source code! This is Grissess,
and all of this content was handmade in Neovim and spliced
together with GNU m4. Feel free to peek around and learn, and even
use these patterns on your own projects - but please ask us before
hosting exact replicas of our website, or hosting the modpack, so
that we can make sure everyone gets content that's up to date :) .
Have a good one! -->
</head>
<body>

47
servers.html

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Lusty Lavender</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<meta charset="utf-8"/>
<!-- Hello, and thanks for reading the source code! This is Grissess,
and all of this content was handmade in Neovim and spliced
together with GNU m4. Feel free to peek around and learn, and even
use these patterns on your own projects - but please ask us before
hosting exact replicas of our website, or hosting the modpack, so
that we can make sure everyone gets content that's up to date :) .
Have a good one! -->
</head>
<body>
<style type="text/css">body { background-image: url(img/bg/path.png); }</style>
<header>
<h1><a href="./">Lusty Lavender</a></h1>
<h2>An <a href="https://electrical-age.net/">Electrical Age</a> Development Modpack</h2>
</header>
<section class="main">
<nav>
<ul>
<a href="downloads.html"><li>Downloads</li></a>
<a href="servers.html"><li>Servers</li></a>
<a href="contact.html"><li>Contact</li></a>
</ul>
</nav>
<div class="badges">
<div class="badge" >
<img src="img/right_arrow.png"/><p>Connect to <addr>eln.ja13.org:3030</addr></p>
</div>
</div>
<div class="serverStatus">
<div class="statusLine"><span class="serverName">[Unofficial ELN Testing Server] LLv7</span> is up: <span class="online">0</span>/<span class="max">30</span> players</div>
</div>
</section>
</body>
</html>

10
servers.m4

@ -0,0 +1,10 @@
ht_include([[cmp/header.html]])m4_dnl
ll_header([[img/bg/path.png]])
<section class="main">
ht_include([[cmp/nav.html]])
ht_include([[cmp/badges.html]])m4_dnl
ll_badges([[[[Connect to <addr>eln.ja13.org:3030</addr>]],[[img/right_arrow.png]]]])
m4_syscmd([[util/server.py 128.153.145.151 3030]])
</section>

185
style.css

@ -0,0 +1,185 @@
body {
margin: 0;
background-color: #ddd;
background-size: cover;
background-repeat: no-repeat;
}
a, a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1 {
font-size: 450%;
}
h1, h1 a {
font-variant: small-caps;
font-family: Courier;
text-decoration: none;
}
h2 {
font-style: italic;
}
h1, h2 {
text-align: center;
margin: 0;
padding: 0.25em 0;
background-color: rgb(255, 255, 255, 0.25);
color: #7700aa;
text-shadow: 1px 1px 2px #fff, -1px 1px 2px #fff, -1px -1px 2px #fff, 1px -1px 2px #fff;
}
h3 {
font-variant: small-caps;
}
header {
padding: 4em 0 6em 0;
}
section.main {
margin: -2em 15%;
box-shadow: 0 -3px 6px #000;
background-color: #eee;
padding: 1em;
}
nav ul {
display: flex;
flex-direction: row;
width: 100%;
list-style: none inside;
justify-content: space-evenly;
padding: 0;
}
nav ul li {
font-size: 125%;
padding: 0.5em 1em;
background-color: #007;
border: 1px solid #000;
border-radius: 5px;
}
nav ul a {
color: #fff;
font-weight: bold;
}
nav ul a:visited {
color: #9f9;
}
div.badges {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
width: 100%;
padding: 1em;
}
.badge {
display: flex;
border: 1px solid #bbb;
border-radius: 3px;
width: 40%;
padding: 0.5em;
margin: 0.5em 1.5em;
font-weight: bold;
background-color: #ccc;
box-shadow: 0 0 2px #000;
align-items: center;
justify-content: center;
}
.badge div {
margin: auto;
}
.badge img {
float: left;
height: 48px;
margin: 0.5em;
vertical-align: middle;
}
.error {
color: #700;
}
.serverStatus .statusLine {
text-align: center;
}
.serverStatus .serverName, .serverStatus .online {
font-weight: bold;
}
.serverStatus .max {
color: #007;
font-style: italic;
}
.serverStatus .players {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
padding: 1em;
}
.serverStatus .players .player {
display: flex;
align-items: center;
width: 30%;
padding: 0.5em;
border: 1px solid #bbb;
border-radius: 3px;
}
.serverStatus .players .player img {
margin: 0.5em;
height: 48px;
float: left;
}
.serverStatus .players .player .name {
font-family: Courier;
}
.versions {
padding: 0;
list-style: none inside;
}
.versions li {
margin: 0.5em 0;
}
.versions li a {
display: block;
padding: 0.5em;
padding-left: 1.5em;
background-color: #aaf;
font-family: Courier;
font-size: 125%;
}
.versions li a:hover {
background-color: #afa;
}
.discordAreaMarker img {
background-color: #fff;
border: 2px solid #444;
border-radius: 3px;
padding: 0.5em;
}

27
util/server.py

@ -0,0 +1,27 @@
#!/usr/bin/env python3
import sys, cgi, socket
from mcstatus import MinecraftServer
AVATAR_URI = 'https://crafatar.com/avatars/{}.png'
if len(sys.argv) < 3:
print(f'usage: {sys.argv[0]} host port', file=sys.stderr)
exit()
print('<div class="serverStatus">')
server = MinecraftServer(sys.argv[1], int(sys.argv[2]))
try:
stat = server.status()
except (ConnectionError, socket.error):
print('<div class="error">The server at {cgi.escape(sys.argv[1])}:{sys.argv[2]}appears to be down.</div>')
else:
print(f'<div class="statusLine"><span class="serverName">{cgi.escape(stat.description)}</span> is up: <span class="online">{stat.players.online}</span>/<span class="max">{stat.players.max}</span> players</div>')
if stat.players.online:
print('<div class="players">')
for player in stat.players.sample:
print(f'\t<div class="player"><img src="{AVATAR_URI.format(player.id)}"/><p class="name">{cgi.escape(player.name)}</p></div>')
print('</div>')
print('</div>')

13
util/versions.py

@ -0,0 +1,13 @@
#!/usr/bin/env python3
import sys, os
if len(sys.argv) < 2:
print(f'usage: {sys.argv[0]} dir', file=sys.stderr)
exit()
print('<ul class="versions">')
for fname in sorted(os.listdir(sys.argv[1])):
if fname.startswith('.'):
continue
print(f'\t<li><a href="{sys.argv[1]}/{fname}">{fname}</a></li>')
print('</ul>')

0
worlds/.git-keep

Loading…
Cancel
Save