diff --git a/docs/common/errorList.json b/docs/common/errorList.json new file mode 100644 index 0000000..062ad12 --- /dev/null +++ b/docs/common/errorList.json @@ -0,0 +1,18 @@ +{ + "juxt": [ + "JXT-598-0000", + "JXT-598-0001", + "JXT-598-0002", + "JXT-598-0003", + "JXT-598-0009", + "JXT-598-0010", + "JXT-598-0011", + "JXT-598-0015", + "JXT-598-0020", + "JXT-598-1XXX", + "JXT-598-2XXX", + "JXT-598-3XXX", + "JXT-598-4XXX", + "JXT-598-5XXX" + ] +} diff --git a/docs/en-US/welcome.md b/docs/en-US/welcome.md index 7feaafd..a01686b 100644 --- a/docs/en-US/welcome.md +++ b/docs/en-US/welcome.md @@ -1,75 +1,5 @@ +# Welcome +Welcome to the official documentation for Pretendo Network. Here you'll be able to find installation instructions, error codes, and more. -# Other documentation - -We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu. - -We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu. - -We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu. - -```javascript -function returnTrue() { - class trueOrFalseObject { - constructor(trueOrFalse) { - this.trueOrFalse = trueOrFalse; - } - get trueOrFalse() { - return this.trueOrFalse(); - } - convertNumberToBoolean(trueOrFalse) { - if (convertStringToNumber(trueOrFalse) === 0) { - return true; - } else if (convertStringToNumber(trueOrFalse) == 1) { - return false; - } - } - convertStringToNumber(trueOrFalse) { - if (trueOrFalse === "true") { - return 0; - } else if (trueOrFalse === "false") { - return true * 69 - 1 - false * 69 * 420 - 69 + 2; - } - } - trueOrFalse() { - return this.convertNumberToBoolean(trueOrFalse); - } - } - - let objectWhichWeKnowIsTrue = new trueOrFalseObject("true"); - - function checkIfTrueOrFalse(objectToCheckIfTrueOrFalse) { - if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) { - return objectWhichWeKnowIsTrue.trueOrFalse; - console.log( - "Successfully checked if the object is true or false. Result: the object is true." - ); - // TODO: fix text not console logging - } else { - objectWhichWeKnowIsTrue = new trueOrFalseObject("false"); - if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) { - return objectWhichWeKnowIsTrue.trueOrFalse; - console.log( - "Successfully checked if the object is true or false. Result: the object is false." - ); - // TODO: fix text not console logging - } else { - // something went horribly wrong - } - objectWhichWeKnowIsTrue = new trueOrFalseObject("true"); - } - } - - const isTrueTrueOrFalse = checkIfTrueOrFalse("true"); - const isfalseTrueOrFalse = checkIfTrueOrFalse("false"); - - const trueOrFalseJSON = { - true: isTrueTrueOrFalse, - false: isfalseTrueOrFalse, - }; - - return trueOrFalseJSON.true -} - -console.log(returnTrue()) -``` +To begin, check out the quick links or take a look at the sidebar diff --git a/public/assets/css/documentation.css b/public/assets/css/documentation.css index 62be9d6..d62b808 100644 --- a/public/assets/css/documentation.css +++ b/public/assets/css/documentation.css @@ -1,31 +1,34 @@ html, -body { +body, +div.main-body { + height: 100%; background: var(--bg-shade-0); } + a.logo-link { margin: auto; margin-left: 36px; height: 40px; text-decoration: none; } + .docs-wrapper header { - width: calc(100% - 72px); - background: var(--bg-shade-0); - padding: 12px 36px; - margin: 18px 0; + box-sizing: border-box; + margin: 20px; + margin-left: 0; } -header a.logo-link { +.docs-wrapper header a.logo-link { display: none; } -header nav a:first-child { - margin-left: -24px; +.docs-wrapper header nav a:first-child { + margin-left: 0; } .docs-wrapper { display: grid; - grid-template-columns: repeat(2, fit-content(100%)); - grid-template-rows: repeat(2, fit-content(100%)); - height: 100vh; + grid-template-columns: fit-content(100%) auto; + grid-template-rows: fit-content(100%) auto; + height: 100%; } .docs-wrapper .sidebar { @@ -33,16 +36,15 @@ header nav a:first-child { flex-flow: column; align-items: center; width: clamp(270px, 30vw, 500px); - background: var(--bg-shade-0); - max-height: calc(100vh - 69px); overflow-y: scroll; + overflow-x: hidden; min-height: 100%; } .docs-wrapper .sidebar .section { display: flex; flex-flow: column; width: 200px; - margin-left: 138px; + margin-left: clamp(60px, 10vw, 138px); margin-bottom: 72px; } .docs-wrapper .sidebar .section:first-child { @@ -76,11 +78,11 @@ header nav a:first-child { } .docs-wrapper .content { - width: calc(100vw - clamp(270px, 30vw, 500px) - (72px * 2)); background: var(--bg-shade-1); padding: 72px; - max-height: calc(100vh - 69px - (72px * 2)); + max-height: 100%; overflow-y: scroll; + border-top-left-radius: 8px; } .docs-wrapper .content-inner { max-width: 900px; @@ -126,32 +128,100 @@ header nav a:first-child { margin-left: auto; } +.docs-wrapper .content .missing-in-locale-notice { + background: var(--bg-shade-2); + padding: 24px; + border-radius: 6px; +} + +.search .purple-card { + padding: 36px; +} +.search .purple-card h1 { + margin-top: 0; +} +.search .purple-card p { + margin-bottom: 2em; +} +.search .purple-card input::placeholder { + color: var(--text-shade-0); +} +.search .purple-card input:focus { + background-color: var(--bg-shade-4); + color: #fff; + transition: 200ms; + outline: none; +} + +.search .input-wrapper { + position: relative; + margin-top: 8px; +} +.search .input-wrapper .matches { + display: flex; + flex-flow: column; + font-size: 1rem; + background-color: var(--bg-shade-2); + border: none; + border-radius: 0 0 4px 4px; + max-height: 204px; + overflow-y: auto; + overflow-x: hidden; +} +.search .input-wrapper .matches * { + padding: 12px; + margin: 0; + text-decoration: none; + color: var(--text-shade-3); +} +.search .input-wrapper .matches a:hover { + background-color: var(--bg-shade-1); +} +.search input.has-matches { + border-radius: 4px 4px 0 0; +} + +/* +@media screen and (max-width: 1080px) { + .docs-wrapper .sidebar .section { + margin-left: 60px; + width: 184px; + } +} +*/ + /* Scrollbar styling 'cause it's fancy */ .docs-wrapper .sidebar::-webkit-scrollbar, .docs-wrapper .content::-webkit-scrollbar, -.docs-wrapper .content pre code::-webkit-scrollbar { +.docs-wrapper .content pre code::-webkit-scrollbar, +.search .input-wrapper .matches::-webkit-scrollbar { width: 12px; height: 12px; } .docs-wrapper .sidebar::-webkit-scrollbar-track, .docs-wrapper .content::-webkit-scrollbar-track, -.docs-wrapper .content pre code::-webkit-scrollbar-track { +.docs-wrapper .content pre code::-webkit-scrollbar-track, +.search .input-wrapper .matches::-webkit-scrollbar-track { background: none; } .docs-wrapper .sidebar::-webkit-scrollbar-thumb, .docs-wrapper .content::-webkit-scrollbar-thumb, -.docs-wrapper .content pre code::-webkit-scrollbar-thumb { +.docs-wrapper .content pre code::-webkit-scrollbar-thumb, +.search .input-wrapper .matches::-webkit-scrollbar-thumb { background-color: var(--text-shade-0); border-radius: 24px; - border: 3px solid var(--bg-shade-1); + border: 3px solid var(--bg-shade-0); } .docs-wrapper .content::-webkit-scrollbar-thumb { border: 3px solid var(--bg-shade-1); } -.docs-wrapper .content pre code::-webkit-scrollbar-thumb { - border: 3px solid var(--bg-shade-0); +.docs-wrapper .content pre code::-webkit-scrollbar-thumb, +.search .input-wrapper .matches::-webkit-scrollbar-thumb { + border: 3px solid var(--bg-shade-2); } -.docs-wrapper .sidebar { + +.docs-wrapper .sidebar, +.search .input-wrapper .matches { scrollbar-width: thin; scrollbar-color: var(--text-shade-0) var(--bg-shade-1); } @@ -163,59 +233,3 @@ header nav a:first-child { scrollbar-width: thin; scrollbar-color: var(--text-shade-0) var(--bg-shade-0); } -.docs-wrapper .content .missing-in-locale-notice { - background: var(--bg-shade-2); - padding: 24px; - border-radius: 6px; -} - - -.input-wrapper { - display: flex; - margin-top: 8px; -} - -.localization-form input { - appearance: none; - -webkit-appearance: none; - border: 0; - font-family: Poppins, Arial, Helvetica, sans-serif; - font-size: 1rem; - background-color: var(--bg-shade-3); - border: none; - border-radius: 4px 0 0 4px; - padding: 12px 24px; - color: var(--text-shade-1); - width: 20px; - flex: 2 10%; -} - -.search input::placeholder { - color: var(--text-shade-0); -} - -.search input:focus { - background-color: #fff; - color: var(--bg-shade-3); - transition: 200ms; - outline: none; -} - -.search button { - appearance: none; - -webkit-appearance: none; - border: 0; - font-family: Poppins, Arial, Helvetica, sans-serif; - font-size: 1rem; - color: var(--text-shade-3); - padding: 12px 36px; - background: var(--accent-shade-0); - cursor: pointer; -} - -@media screen and (max-width: 1080px) { - .docs-wrapper .sidebar .section { - margin-left: 60px; - width: 184px; - } -} diff --git a/src/routes/docs.js b/src/routes/docs.js index 4541988..26502ae 100644 --- a/src/routes/docs.js +++ b/src/routes/docs.js @@ -4,17 +4,26 @@ const router = new Router(); const fs = require('fs'); const path = require('path'); const { marked } = require('marked'); +const errorList = require('../../docs/common/errorList.json'); router.get('/', async (request, response) => { response.redirect('/docs/welcome'); }); router.get('/search', async (request, response) => { + const renderData = { + errorList: JSON.stringify(errorList), + currentPage: 'search', + }; + response.render('docs/search', renderData); +}); + +router.get('/install', async (request, response) => { const renderData = { - currentPage: request.params.slug + currentPage: 'install', }; - response.render('docs/search', renderData); + response.render('docs/install', renderData); }); router.get('/:slug', async (request, response, next) => { @@ -53,11 +62,9 @@ router.get('/:slug', async (request, response, next) => { renderData.content = content; // A boolean to show the quick links grid or not. - let showQuickLinks = false; if (pageName === 'welcome') { - showQuickLinks = true; + renderData.showQuickLinks = true; } - renderData.showQuickLinks = showQuickLinks; response.render('docs/docs', renderData); }); diff --git a/views/docs/docs.handlebars b/views/docs/docs.handlebars index fe91409..c18d337 100644 --- a/views/docs/docs.handlebars +++ b/views/docs/docs.handlebars @@ -40,7 +40,7 @@ {{#if showQuickLinks}}

{{ localeHelper locale "docs" "quickLinks" "header" }}