Revert "Revert "Asset caching + mobile tweaks""

This reverts commit 43951f8324.
This commit is contained in:
GDColon 2019-10-18 16:48:33 -04:00
parent 43951f8324
commit 358c4e7050
10 changed files with 30 additions and 58 deletions

View file

@ -1,5 +1,7 @@
@font-face {font-family: Pusab; src: url('./../assets/Pusab.ttf')}
* { outline: none !important; }
body {
margin: 0;
height: 100vh;
@ -32,6 +34,10 @@ img, .noSelect {
pointer-events: all;
}
.cornerPiece {
position: sticky;
}
.center {
text-align: center;
max-width: 100%;
@ -120,7 +126,7 @@ p {
font-family: aller, helvetica;
color: white;
font-size: 2.9vh;
word-break: break-all;
word-break: break-word;
}
h1 {

View file

@ -17,11 +17,11 @@
<div id="everything">
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%">
<img class="gs" src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;">
<img class="gs" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
</div>
<div class="brownBox center supercenter" style="width: 135vh; height: 82%; margin-top: -0.7%">

View file

@ -31,11 +31,11 @@
</div>
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%">
<img class="gs" src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;">
<img class="gs" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
</div>
<div class="transparentBox center" style="width: 115vh; height: 9%; margin: 1.5% auto 3% auto; padding-bottom: 0.2%">

View file

@ -134,11 +134,11 @@
</div>
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%; pointer-events: none">
<img src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; top: 0%; left: 0%; width: 100%; pointer-events: none">
<img src="../assets/corner.png" width=7%; style="transform: scaleY(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleY(-1)">
</div>
<div style="position:absolute; top: 1.7%; right: 2%; text-align: right; width: 10%;">

View file

@ -38,11 +38,11 @@
</div>
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%">
<img class="gs" src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;">
<img class="gs" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
</div>
<div id="searchBox" class="supercenter dragscroll">

View file

@ -60,11 +60,11 @@
</div>
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%">
<img src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;">
<img src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
</div>
<div class="center" style="width: 70%; margin: 1% auto">

View file

@ -6,7 +6,7 @@
<link rel="icon" href="../assets/folder.png">
<meta id="meta-title" property="og:title" content="Map Packs">
<meta id="meta-desc" property="og:description" content="Collections of terrible Geometry Dash levels that people only play because of the absurd number of icons they unlock.">
<meta id="meta-image" name="og:image" itemprop="image" content="https://gdbrowser.com/assets/gauntlet.png">
<meta id="meta-image" name="og:image" itemprop="image" content="https://gdbrowser.com/assets/folder.png">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script async type="text/javascript" src="../assets/sizecheck.js"></script>
</head>

View file

@ -29,11 +29,11 @@
</div>
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%">
<img class="gs" src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;">
<img class="gs" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
</div>
<div style="position:absolute; top: 2%; left: 1.5%; width: 10%; height: 25%; pointer-events: none">

View file

@ -45,11 +45,11 @@
</div>
<div style="position:absolute; bottom: 0%; left: 0%; width: 100%">
<img class="gs" src="../assets/corner.png" width=7%;>
<img class="cornerPiece" src="../assets/corner.png" width=7%;>
</div>
<div style="position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;">
<img class="gs" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
<img class="cornerPiece" src="../assets/corner.png" width=7%; style="transform: scaleX(-1)">
</div>
<div id="searchBox" class="supercenter dragscroll">
@ -197,7 +197,7 @@ if (type == 'saved') {
if (gauntlet) {
$('body').addClass('darkBG')
$('.gs').addClass('grayscale')
$('.cornerPiece').addClass('grayscale')
$('#header').text((gauntlets[parseInt(gauntlet) - 1] || "Unknown") + " Gauntlet")
$('#meta-title').attr('content', (gauntlets[parseInt(gauntlet) - 1] || "Unknown") + " Gauntlet")
$('#meta-desc').attr('content', `View the 5 levels in the ${(gauntlets[parseInt(gauntlet) - 1] || "Unknown") + " Gauntlet"}!`)

View file

@ -42,47 +42,13 @@ app.clean = function(text) {if (typeof text != "string") return text; else retur
console.log("Site online!")
app.get("/assets/:file", function (req, res) {
fs.exists("./assets/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/assets/" + req.params.file));
}})
})
app.get("/objects/:file", function (req, res) {
fs.exists("./assets/objects/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/assets/objects/" + req.params.file));
}})
})
app.get("/blocks/:file", function (req, res) {
fs.exists("./assets/blocks/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/assets/blocks/" + req.params.file));
}})
})
app.get("/gauntlets/:file", function (req, res) {
fs.exists("./assets/gauntlets/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/assets/gauntlets/" + req.params.file));
}})
})
app.get("/difficulty/:file", function (req, res) {
fs.exists("./assets/gdfaces/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/assets/gdfaces/" + req.params.file));
}})
})
app.get("/iconkitbuttons/:file", function (req, res) {
fs.exists("./assets/iconkitbuttons/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/assets/iconkitbuttons/" + req.params.file));
}})
})
app.get("/gdicon/:file", function (req, res) {
fs.exists("./icons/iconkit/" + req.params.file, function (exists) {
if (exists) {res.status(200).sendFile(path.join(__dirname, "/icons/iconkit/" + req.params.file));
}})
})
app.use('/assets', express.static(__dirname + '/assets', {maxAge: "7d"}));
app.use('/objects', express.static(__dirname + '/assets/objects', {maxAge: "7d"}));
app.use('/blocks', express.static(__dirname + '/assets/blocks', {maxAge: "7d"}));
app.use('/gauntlets', express.static(__dirname + '/assets/gauntlets', {maxAge: "7d"}));
app.use('/difficulty', express.static(__dirname + '/assets/gdfaces', {maxAge: "7d"}));
app.use('/iconkitbuttons', express.static(__dirname + '/assets/iconkitbuttons', {maxAge: "7d"}));
app.use('/gdicon', express.static(__dirname + '/icons/iconkit', {maxAge: "7d"}));
app.get("/api", function(req, res) {
res.sendFile(__dirname + "/html/api.html")