mirror of
https://github.com/Oreolek/gamebookformat.git
synced 2024-04-29 07:39:21 +03:00
HTML output now playable with JavaScript disabled or missing js file.
This commit is contained in:
parent
25fb3ec60c
commit
9f9e613d4d
|
@ -24,7 +24,7 @@
|
||||||
.sectionnumber,.introsectionheading {font-weight: bolder;
|
.sectionnumber,.introsectionheading {font-weight: bolder;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;}
|
text-align: center;}
|
||||||
.section {display: none; width: 90%; margin-left: 5%; margin-right: 5%;}
|
.section {width: 90%; margin-left: 5%; margin-right: 5%;}
|
||||||
.sectiontext {margin-top: 0.5em;}
|
.sectiontext {margin-top: 0.5em;}
|
||||||
.gamebook {max-width: 30em; padding: 1em; width: 100%; font-size: 133%;}
|
.gamebook {max-width: 30em; padding: 1em; width: 100%; font-size: 133%;}
|
||||||
.collections {margin-top: 4em;}
|
.collections {margin-top: 4em;}
|
||||||
|
@ -47,4 +47,6 @@
|
||||||
.sectionimage {width: 100%; padding: 1em;}
|
.sectionimage {width: 100%; padding: 1em;}
|
||||||
.nodisplay {display: none;}
|
.nodisplay {display: none;}
|
||||||
.resumenr {font-weight: bold;}
|
.resumenr {font-weight: bold;}
|
||||||
.counterChange {font-weight: bold;}
|
.counterChange {font-weight: bold;}
|
||||||
|
|
||||||
|
a {text-decoration: none; color: black;}
|
|
@ -160,6 +160,11 @@ var gamebook = {
|
||||||
this.displaySection(nr);
|
this.displaySection(nr);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
prepare : function() {
|
||||||
|
this.addClassToClass('section', 'nodisplay');
|
||||||
|
this.runActionsInIntroSections();
|
||||||
|
},
|
||||||
|
|
||||||
'start' : function() {
|
'start' : function() {
|
||||||
this.hideIntroSections();
|
this.hideIntroSections();
|
||||||
this.addClassToClass('startlink', 'nodisplay');
|
this.addClassToClass('startlink', 'nodisplay');
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
<link rel="stylesheet" href="gamebookformat.css"
|
<link rel="stylesheet" href="gamebookformat.css"
|
||||||
type="text/css" />
|
type="text/css" />
|
||||||
<script>
|
<script>
|
||||||
gamebook.id = '%(id)s';
|
if (typeof gamebook !== 'undefined') {
|
||||||
|
gamebook.id = '%(id)s';
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
#include "head-overrides"
|
#include "head-overrides"
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
if (this.gamebook) {
|
if (typeof gamebook !== 'undefined') {
|
||||||
gamebook.runActionsInIntroSections();
|
gamebook.prepare();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
<a class="sectionref enabledlink" data-ref="%(nr)d">%(nr)d</a>
|
<a class="sectionref enabledlink" data-ref="%(nr)d"
|
||||||
|
href="#section%(nr)d">%(nr)d</a>
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="startlink"
|
<div class="startlink"
|
||||||
onclick="gamebook.turnTo(1)">%(starttext)s</div>
|
onclick="gamebook.turnTo(1)">%(starttext)s</div>
|
||||||
<script>
|
<script>
|
||||||
if (gamebook.hasSavedGame()) {
|
if (typeof gamebook !== 'undefined' && gamebook.hasSavedGame()) {
|
||||||
var resumeLinks = document.getElementsByClassName('resumelink');
|
var resumeLinks = document.getElementsByClassName('resumelink');
|
||||||
Array.prototype.forEach.call(resumeLinks, function(e) {
|
Array.prototype.forEach.call(resumeLinks, function(e) {
|
||||||
e.classList.remove('nodisplay');
|
e.classList.remove('nodisplay');
|
||||||
|
|
4
todo.org
4
todo.org
|
@ -1,4 +1,4 @@
|
||||||
* TODO [48/72] [66%]
|
* TODO [49/72] [68%]
|
||||||
- [X] Debug output
|
- [X] Debug output
|
||||||
- [X] DOT output
|
- [X] DOT output
|
||||||
- [X] LaTeX output
|
- [X] LaTeX output
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
display somewhere on page (in HTML output)
|
display somewhere on page (in HTML output)
|
||||||
- [X] Counters increase/decrease
|
- [X] Counters increase/decrease
|
||||||
- [X] Counters check
|
- [X] Counters check
|
||||||
- [ ] Make sure HTML output works with javascript disabled
|
- [X] Make sure HTML output works with javascript disabled
|
||||||
and in inferior browsers
|
and in inferior browsers
|
||||||
- [ ] Trade (optionally drop something from collection to add something new).
|
- [ ] Trade (optionally drop something from collection to add something new).
|
||||||
- [ ] Buy (optionally decrease a counter to add something to a collection)
|
- [ ] Buy (optionally decrease a counter to add something to a collection)
|
||||||
|
|
Loading…
Reference in a new issue