Added web manifest

This commit is contained in:
Jay 2022-02-20 00:42:07 -06:00
parent 1b2f94c00b
commit a4d500efab
13 changed files with 116 additions and 10 deletions

View File

@ -5,7 +5,8 @@ function auth(request, response, next) {
if(request.path.includes('/css/') || request.path.includes('/fonts/')
|| request.path.includes('/js/') || request.path.includes('/icons/')
|| request.path.includes('/banner/') || request.path.includes('/posts/')
|| request.path.includes('/drawing/')|| request.path.includes('/screenshot/')) {
|| request.path.includes('/drawing/') || request.path.includes('/screenshot/')
|| request.path.includes('/web/')) {
if(request.subdomains.indexOf('juxt') !== -1) {
request.directory = 'web';
request.lang = util.data.processLanguage();

View File

@ -35,6 +35,7 @@ console.use('/news', routes.PORTAL_NEWS);
console.use('/', routes.PORTAL_WEB);
console.use('/login', routes.WEB_LOGIN);
console.use('/robots.txt', routes.ROBOTS);
console.use('/web', routes.PWA);
admin.use('/', routes.WEB_ADMIN);
admin.use('/v1/', routes.WEB_API);

View File

@ -5,6 +5,10 @@ const database = require('../../../../database');
const util = require('../../../../util');
var path = require('path');
router.get('/', function (req, res) {
res.redirect('/activity-feed')
});
router.get('/css/:filename', function (req, res) {
res.set("Content-Type", "text/css");
res.sendFile('/css/' + req.params.filename, {root: path.join(__dirname, '../../../../webfiles/' + req.directory)});

View File

@ -11,4 +11,5 @@ module.exports = {
WEB_API: require('./admin/api'),
WEB_LOGIN: require('./web/login'),
ROBOTS: require('./web/robots'),
PWA: require('./web/pwa'),
};

View File

@ -66,7 +66,7 @@ router.post('/', async (req, res) => {
res.statusCode = 403;
let response = {
error_code: 403,
message: 'Invalid account ID or passwordrrrrrrr'
message: 'Invalid account ID or password'
};
return res.send(response);
}

View File

@ -0,0 +1,15 @@
var express = require('express');
const path = require("path");
var router = express.Router();
router.get('/icons/:filename', function (req, res) {
res.set("Content-Type", "image/png");
res.sendFile('/images/icons/' + req.params.filename, {root: path.join(__dirname, '../../../../webfiles/web')});
});
router.get('/manifest.json', function (req, res) {
res.set("Content-Type", "text/json");
res.sendFile('manifest.json', {root: path.join(__dirname, '../../../../webfiles/web')});
});
module.exports = router;

View File

@ -4,6 +4,7 @@
<link rel="stylesheet" type="text/css" href="<%= /*cdnURL*/ %>/css/juxt.css">
<script src="https://portal.cdn.pretendo.cc/js/pjax.min.js"></script>
<script src="https://portal.cdn.pretendo.cc/js/juxt.js"></script>
<link rel="manifest" href="/web/manifest.json">
<!-- Global site tag (gtag.js) - Google Analytics Testing-->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-195842548-1"></script>
<script>

View File

@ -4,6 +4,7 @@
<link rel="stylesheet" type="text/css" href="<%= /*cdnURL*/ %>/css/juxt.css">
<script src="https://portal.cdn.pretendo.cc/js/pjax.min.js"></script>
<script src="https://portal.cdn.pretendo.cc/js/juxt.js"></script>
<link rel="manifest" href="/web/manifest.json">
<!-- Global site tag (gtag.js) - Google Analytics Testing-->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-195842548-1"></script>
<script>

View File

@ -28,6 +28,7 @@ a {
a:hover {
cursor: pointer;
text-decoration: underline;
}
#title {
@ -260,6 +261,11 @@ header > a > p {
margin-bottom: 1em;
}
iframe {
width: 100%;
height: fit-content;
}
@media screen and (max-width: 1350px) {
.communities-wrapper {
max-width: 600px;
@ -315,6 +321,10 @@ header > a > p {
header a {
padding: 0.25em 1em 0.25em 1em;
}
header svg {
scale: 0.75;
}
#load-more-posts-button {
width: 95vw;

View File

@ -4,6 +4,7 @@
<link rel="stylesheet" type="text/css" href="<%= /*cdnURL*/ %>/css/juxt.css">
<script src="https://portal.cdn.pretendo.cc/js/pjax.min.js"></script>
<script src="https://portal.cdn.pretendo.cc/js/juxt.js"></script>
<link rel="manifest" href="/web/manifest.json">
<!-- Global site tag (gtag.js) - Google Analytics Testing-->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-195842548-1"></script>
<script>
@ -33,6 +34,11 @@
</div>
</div>
<script>
window.onscroll = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
document.getElementById('load-more-posts-button').click();
}
};
function copyToClipboard(text) {
let inputc = document.getElementsByTagName("header")[0].appendChild(document.createElement("input"));
inputc.value = text;

View File

@ -5,6 +5,7 @@
<title>Juxtaposition Log In</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="manifest" href="/web/manifest.json">
<!-- windows/ios/chrome -->
<meta http-equiv="X-UA-Compatible" content="ie=edge">
@ -35,11 +36,9 @@
<meta name="robots" content="index, follow">
<!-- favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/icons/favicon-16x16.png">
<link rel="mask-icon" href="/assets/images/icons/safari-pinned-tab.svg" color="#1b1f3b">
<link rel="shortcut icon" href="/assets/images/icons/favicon.ico">
<link rel="apple-touch-icon" href="/web/icons/icon-144x144.png">
<link rel="icon" type="image/png" href="/web/icons/icon-144x144.png">
<link rel="shortcut icon" href="/web/icons/icon-72x72.png">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&amp;display=swap" rel="stylesheet">

View File

@ -0,0 +1,52 @@
{
"name": "Juxtaposition",
"short_name": "Juxt",
"theme_color": "#1b1f3b",
"background_color": "#1b1f3b",
"display": "standalone",
"orientation": "portrait",
"scope": "/",
"start_url": "/activity-feed",
"icons": [
{
"src": "/web/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "/web/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "/web/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "/web/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "/web/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
},
{
"src": "/web/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/web/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/web/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@ -5,6 +5,7 @@
<link rel="stylesheet" type="text/css" href="<%= /*cdnURL*/ %>/css/juxt.css">
<script src="https://portal.cdn.pretendo.cc/js/pjax.min.js"></script>
<script src="https://portal.cdn.pretendo.cc/js/juxt.js"></script>
<link rel="manifest" href="/web/manifest.json">
<!-- Global site tag (gtag.js) - Google Analytics Testing-->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-195842548-1"></script>
<script>
@ -62,9 +63,23 @@
</div>
</div>
</div>
<img src="" onerror="wiiuBrowser.showLoadingIcon(!1);window.scroll(0, 0);">
</div>
<body onload="stopLoading();wiiuBrowser.lockUserOperation(false);">
<script>
function copyToClipboard(text) {
let inputc = document.getElementsByTagName("header")[0].appendChild(document.createElement("input"));
inputc.value = text;
inputc.focus();
inputc.select();
document.execCommand('copy');
inputc.parentNode.removeChild(inputc);
Toast("Copied to clipboard.");
}
function Toast(text) {
var x = document.getElementById("toast");
x.innerText = text;
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}
</script>
</body>
</html>