make view update with slideshow selection !
This commit is contained in:
parent
7185f78eee
commit
cbb0a652f7
8 changed files with 5355 additions and 75 deletions
156
books.html
156
books.html
|
@ -1,95 +1,117 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<title>fateforge-tools</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
|
||||
/>
|
||||
<link href="css/all.min.css" rel="stylesheet" />
|
||||
|
||||
<link href="css/flickity.css" rel="stylesheet" />
|
||||
<link href="css/style.css" rel="stylesheet" />
|
||||
<link rel="icon" type="image/x-icon" href="/img/FateforgeTool_logo_80.png">
|
||||
</head>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/x-icon"
|
||||
href="/img/FateforgeTool_logo_80.png"
|
||||
/>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<button onclick="changeLangEN()"><img src="https://cdn.countryflags.com/thumbs/united-kingdom/flag-400.png"
|
||||
width="20"> English</button>
|
||||
<button onclick="changeLangFR()"><img src="https://cdn.countryflags.com/thumbs/france/flag-400.png" width="20">
|
||||
French</button>
|
||||
<body>
|
||||
<button onclick="changeLangEN()">
|
||||
<img
|
||||
src="https://cdn.countryflags.com/thumbs/united-kingdom/flag-400.png"
|
||||
width="20"
|
||||
/>
|
||||
English
|
||||
</button>
|
||||
<button onclick="changeLangFR()">
|
||||
<img
|
||||
src="https://cdn.countryflags.com/thumbs/france/flag-400.png"
|
||||
width="20"
|
||||
/>
|
||||
French
|
||||
</button>
|
||||
|
||||
<h1>FateforgeTools</h1>
|
||||
|
||||
<div class="gallery js-flickity">
|
||||
<div class="gallery-cell" id="ADV1">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ADV1_BC_EN.jpg">
|
||||
|
||||
</div>
|
||||
<div class="book-title">Adventurer</div>
|
||||
</div>
|
||||
<div class="gallery-cell" id="ADV1">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ADV1_BC_EN.jpg" />
|
||||
</div>
|
||||
<div class="book-title">Adventurer</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\GRI1_BC_EN.jpg">
|
||||
|
||||
</div>
|
||||
<div class="book-title">Grimoire</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\GRI1_BC_EN.jpg" />
|
||||
</div>
|
||||
<div class="book-title">Grimoire</div>
|
||||
</div>
|
||||
<div class="gallery-cell" id="CRE2">
|
||||
<div class="book-container" data-localize="book-CRE2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell" id="CRE2">
|
||||
<div class="book-container" data-localize="book-CRE2"></div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ENC1_BC_EN.png" />
|
||||
</div>
|
||||
<div class="book-title">Encyclopedia</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ENC1_BC_EN.png">
|
||||
|
||||
</div>
|
||||
<div class="book-title">Encyclopedia</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ENC2_DR.png">
|
||||
|
||||
</div>
|
||||
<div class="book-title">Encyclopedia : Netherworld</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ENC2_DR.png" />
|
||||
</div>
|
||||
<div class="book-title">Encyclopedia : Netherworld</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div><a href="#CRE2">View cell 2</a></div>
|
||||
|
||||
<div
|
||||
class="view-container"
|
||||
style="display: flex; align-items: center; justify-content: center"
|
||||
>
|
||||
<h1 id="view-title"></h1>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="lib/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery.localize.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery.localize-dev.js"></script>
|
||||
<script type="text/javascript" src="js/language.js"></script>
|
||||
<script src="lib/flickity.pkgd.min.js"></script>
|
||||
<script src="lib/flickity.hash.js"></script>
|
||||
<script>
|
||||
var flkty = new Flickity('.gallery', {
|
||||
"freeScroll": true, "wrapAround": true, "hash": true // options
|
||||
});
|
||||
flkty.on('select', function (index) {
|
||||
console.log('Flickity selected at ' + index);
|
||||
refreshBooks();
|
||||
});
|
||||
flkty.on('settle', function (index) {
|
||||
console.log('Flickity settled at ' + index);
|
||||
refreshBooks();
|
||||
});
|
||||
var lastbook;
|
||||
var flkty = new Flickity(".gallery", {
|
||||
freeScroll: true,
|
||||
wrapAround: true,
|
||||
hash: true, // options
|
||||
});
|
||||
flkty.on("select", function (index) {
|
||||
var currentbook = document
|
||||
.getElementsByClassName("gallery-cell is-selected")[0]
|
||||
.getAttribute("id");
|
||||
if (currentbook == lastbook) {
|
||||
return;
|
||||
}
|
||||
//TODO: Fill view-container with books
|
||||
setLocalizeDataAttr("view-title", currentbook + ".title");
|
||||
|
||||
lastbook = currentbook;
|
||||
refreshBooks();
|
||||
});
|
||||
flkty.on("settle", function (index) {
|
||||
console.log("Flickity settled at " + index);
|
||||
refreshBooks();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,17 +1,43 @@
|
|||
// In a browser where the language is set to French
|
||||
$("[data-localize]").localize("main", { pathPrefix: "lang" });
|
||||
|
||||
$("[data-localize]")
|
||||
.localize("main", { pathPrefix: "lang" })
|
||||
.localize("books", { pathPrefix: "lang" });
|
||||
var currentLang;
|
||||
// You can also override the language detection, and pass in a language code
|
||||
//$("[data-localize]").localize("main", { language: "fr" });
|
||||
function changeLangFR() {
|
||||
$("[data-localize]").localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "fr",
|
||||
});
|
||||
$("[data-localize]")
|
||||
.localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "fr",
|
||||
})
|
||||
.localize("books", {
|
||||
pathPrefix: "lang",
|
||||
language: "fr",
|
||||
});
|
||||
currentLang = "fr";
|
||||
}
|
||||
function changeLangEN() {
|
||||
$("[data-localize]").localize("main", {
|
||||
$("[data-localize]")
|
||||
.localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "en",
|
||||
})
|
||||
.localize("books", {
|
||||
pathPrefix: "lang",
|
||||
language: "en",
|
||||
});
|
||||
currentLang = "en";
|
||||
}
|
||||
|
||||
function refreshBooks() {
|
||||
|
||||
$("[data-localize]").localize("books", {
|
||||
pathPrefix: "lang",
|
||||
language: "en",
|
||||
language: currentLang,
|
||||
});
|
||||
}
|
||||
|
||||
function setLocalizeDataAttr(className, dataValue) {
|
||||
$("#" + className).data("localize", dataValue).attr("data-localize", dataValue);
|
||||
}
|
35
lang/books-en.json
Normal file
35
lang/books-en.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"ADV1": {
|
||||
"code": "ADV1",
|
||||
"title": "Adventurers",
|
||||
"desc": [
|
||||
"*Découvrez l’univers d’Eana et ses multiples civilisations hautes en couleur, retrouvez les portails perdus des Voyageurs, gravissez les marches de la Forge du destin et mesurez-vous aux Dragons-dieux !* **Aventuriers** est le premier volume de la gamme de jeu de rôle Dragons. Destiné aux joueurs et au meneur, il se compose de trois parties :",
|
||||
"**Création de personnage.** Déterminez avec votre meneur dans quelles conditions votre personnage accède à l’éveil à la magie, et faites votre choix parmi toutes les options qui s’offrent à vous, notamment : neuf espèces jouables ; dix-huit civilisations ; un pas-à-pas pour concevoir des historiques personnalisés ; treize classes – dont le lettré, un érudit inventif et capable d’agir même dans les régions privées de magie ; de nombreux dons pour accompagner l’évolution de votre héros.",
|
||||
"**Vie quotidienne.** Découvrez la mythique Cité franche, ainsi que toutes les règles permettant de donner corps aux voyages et à la vie quotidienne. Le mystère, l’exploration et la découverte sont au cœur de l’expérience du jeu. Que vous vous déplaciez à pied, en bateau ou en nefélytre, répondez à l’appel de l’aventure !",
|
||||
"**Règles du jeu.** Le système est organisé autour de quatre pôles : les caractéristiques, l’aventure, le combat et la santé. Les règles optionnelles sont présentées à l’aide d’un système modulaire permettant à chaque meneur de définir son propre style de jeu."
|
||||
],
|
||||
"physical-link": "https://www.philibertnet.com/fr/dragons/62090-dragons-1-aventuriers-livre-de-base-9782919256365.html",
|
||||
"pdf-link": "https://www.drivethrurpg.com/product/422886/Dragons--1--Livre-de-base--Aventuriers",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "01/04/2018",
|
||||
"cf-date": "14/03/2016"
|
||||
|
||||
},
|
||||
"CRE2": {
|
||||
"code": "CRE2",
|
||||
"title": "Creature : Netherworld",
|
||||
"desc": [
|
||||
"*"
|
||||
],
|
||||
"physical-link": "",
|
||||
"pdf-link": "",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "",
|
||||
"cf-date": ""
|
||||
|
||||
}
|
||||
}
|
35
lang/books-fr.json
Normal file
35
lang/books-fr.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"ADV1": {
|
||||
"code": "ADV1",
|
||||
"title": "Aventuriers",
|
||||
"desc": [
|
||||
"*Découvrez l’univers d’Eana et ses multiples civilisations hautes en couleur, retrouvez les portails perdus des Voyageurs, gravissez les marches de la Forge du destin et mesurez-vous aux Dragons-dieux !* **Aventuriers** est le premier volume de la gamme de jeu de rôle Dragons. Destiné aux joueurs et au meneur, il se compose de trois parties :",
|
||||
"**Création de personnage.** Déterminez avec votre meneur dans quelles conditions votre personnage accède à l’éveil à la magie, et faites votre choix parmi toutes les options qui s’offrent à vous, notamment : neuf espèces jouables ; dix-huit civilisations ; un pas-à-pas pour concevoir des historiques personnalisés ; treize classes – dont le lettré, un érudit inventif et capable d’agir même dans les régions privées de magie ; de nombreux dons pour accompagner l’évolution de votre héros.",
|
||||
"**Vie quotidienne.** Découvrez la mythique Cité franche, ainsi que toutes les règles permettant de donner corps aux voyages et à la vie quotidienne. Le mystère, l’exploration et la découverte sont au cœur de l’expérience du jeu. Que vous vous déplaciez à pied, en bateau ou en nefélytre, répondez à l’appel de l’aventure !",
|
||||
"**Règles du jeu.** Le système est organisé autour de quatre pôles : les caractéristiques, l’aventure, le combat et la santé. Les règles optionnelles sont présentées à l’aide d’un système modulaire permettant à chaque meneur de définir son propre style de jeu."
|
||||
],
|
||||
"physical-link": "https://www.philibertnet.com/fr/dragons/62090-dragons-1-aventuriers-livre-de-base-9782919256365.html",
|
||||
"pdf-link": "https://www.drivethrurpg.com/product/422886/Dragons--1--Livre-de-base--Aventuriers",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "01/04/2018",
|
||||
"cf-date": "14/03/2016"
|
||||
|
||||
},
|
||||
"CRE2": {
|
||||
"code": "CRE2",
|
||||
"title": "Créature : Inframonde",
|
||||
"desc": [
|
||||
"*"
|
||||
],
|
||||
"physical-link": "",
|
||||
"pdf-link": "",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "",
|
||||
"cf-date": ""
|
||||
|
||||
}
|
||||
}
|
5157
lib/showdown.js
Normal file
5157
lib/showdown.js
Normal file
File diff suppressed because it is too large
Load diff
1
lib/showdown.js.map
Normal file
1
lib/showdown.js.map
Normal file
File diff suppressed because one or more lines are too long
3
lib/showdown.min.js
vendored
Normal file
3
lib/showdown.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
lib/showdown.min.js.map
Normal file
1
lib/showdown.min.js.map
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue