Website/docs/index.html

157 lines
6.4 KiB
HTML
Raw Normal View History

2023-03-02 21:09:33 -05:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SPT-AKI</title>
<link rel="stylesheet" href="./assets/css/style.css">
<link rel="stylesheet" href="./assets/css/prism.css">
</head>
<body>
<header aki-toolbar>
<a class="left" href="../../index.html">
<img class="logo" src="./assets/img/logo.png">
<span class="title text2">
<span>SPT-AKI - Docs</span>
</span>
</a>
<nav class="text2 right dropdown">
<div class="dropdown-button">...</div>
<div class="dropdown-content">
2023-03-02 21:09:38 -05:00
<a href="https://www.offline-tarkov.com">Website</a>
<a href="https://mods.offline-tarkov.com">Workshop</a>
<a href="https://dev.offline-tarkov.com">Gitea</a>
2023-03-02 21:09:33 -05:00
</div>
</nav>
</header>
<main>
<aside></aside>
<div id="router-outlet" class="doc-typography">
<div class="text2" style="align-items:center;display:flex;height:100%;justify-content: center;">
<div aki-card>
Select a guide on the left to get started.
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="./assets/js/prism.js"></script>
2023-03-02 21:09:34 -05:00
<script src="./assets/js/aki-navigator.js"></script>
2023-03-02 21:09:33 -05:00
<script>
2023-03-02 21:09:46 -05:00
// TODO: keep updating old files and add them the the routes list
2023-03-02 21:09:33 -05:00
const routes = {
"SPT-AKI": {
2023-03-02 21:09:39 -05:00
"Installing a release": "spt-aki/install.md",
2023-03-02 21:09:46 -05:00
"About": "spt-aki/about.md",
2023-03-02 21:09:34 -05:00
"FAQ": "spt-aki/faq.md",
// TODO: work on routes nesting
2023-03-02 21:09:33 -05:00
},
2023-03-02 21:09:34 -05:00
"Tutorials": {
// Generalist tutorials (walkthrough projects)
2023-03-02 21:09:46 -05:00
"WorkInProgress": "demo.md"
2023-03-02 21:09:34 -05:00
},
"Modding": {
// Here are guides only related to modifying the server/client.
2023-03-02 21:09:46 -05:00
"WorkInProgress": "demo.md"
2023-03-02 21:09:34 -05:00
},
"Resources": {
"Index": "resources/index.md",
"Player profile": "resources/resources_player_profile.md",
"Quests": "resources/resources_quests.md",
"Locations": "resources/resources_locations.md",
"Item stats": "resources/resources_items_stats.md",
"Other": "resources/resources_other.md",
},
"Development": {
// Documents related to maintaining the project
"Dump game data": "development/dump_data.md"
2023-03-02 21:09:34 -05:00
},
2023-03-02 21:09:46 -05:00
// "DEBUG": {
// "** Markdown Demo": "demo.md"
// },
// "Tutorials-old":{
// "Create a mod on SP-Tarkov": ".old/tutorials/create_a_mod.md", // TODO: Create a "modding 101 series"
// "How to report a bug": ".old/tutorials/bug-report.md", // TODO: include in FAQ
// "Editing differents things in my player profile": ".old/tutorials/edit_the_player_profile.md",
// "Change some traders behaviour": ".old/tutorials/edit_traders_values.md",
// "How to customize maps values": ".old/tutorials/edit_location_values.md",
// "Change global values of the server": ".old/tutorials/edit_globals_values.md",
// "Edit weapons textures": ".old/tutorials/edit_weapons_textures.md",
// "Edit weapons textures with photoshop": ".old/tutorials/photoshop_texture_editing.md",
// "Customize weather presets": ".old/tutorials/create_weather.md",
// "Add new bundles to the game": ".old/tutorials/add_new_bundles.md"
// },
// "Modding":{
// "All items stats resources":"resources/itemsStats_resources.md",
// "All locations resources":"resources/locations_resources.md",
// "All player profile resources":"resources/playerProfile_resources.md",
// "All quest resources":"resources/quests_resources.md",
// "All other resources":"resources/other_resources.md"
// }
2023-03-02 21:09:33 -05:00
};
/**
* Populates the <aside> element in the page
* based on the `routes` object content.
*/
function populateNav() {
Object.entries(routes).forEach(([key, node]) => {
const sectionTitle = document.createElement('div');
sectionTitle.classList.add('subheader');
sectionTitle.innerText = key;
const sectionList = document.createElement('ul');
// sectionTitle.appendChild(sectionList);
Object.entries(node).forEach(([k, v]) => {
const listItem = document.createElement('li');
const link = document.createElement('a');
link.innerText = k;
link.href = `#${v}`;
listItem.appendChild(link);
// listItem.setAttribute('link', v);
// listItem.innerText = k;
// The nav binding
listItem.addEventListener('click', e => {
if (e.target && e.target.hasAttribute('link')) {
window.location.hash = e.target.getAttribute('link');
}
});
sectionList.appendChild(listItem);
});
const divider = document.createElement('hr');
divider.setAttribute('aki-divider', '');
const nav = document.querySelector('aside');
nav.appendChild(sectionTitle);
nav.appendChild(sectionList);
nav.appendChild(divider);
});
}
populateNav();
2023-03-02 21:09:34 -05:00
// Dirty override
class AkiNavigatorDocs extends AkiNavigator {
async fetchView(view) {
const response = await fetch(`${this.fetchPath}/${view}`);
const text = await response.text();
this.removeChildren(this.contentOutlet);
this.contentOutlet.innerHTML = marked(text); // edited
Prism.highlightAll(); // edited
}
}
const akiNavigator = new AkiNavigatorDocs(undefined, 'md');
2023-03-02 21:09:33 -05:00
</script>
</body>