Commit ea23a88d authored by alexandre's avatar alexandre

Sectioning help, and auto-hiding help bar

parent a3f9b714
......@@ -18,5 +18,16 @@
<!-- </ul> -->
{{ flatpage.content }}
<script src="{% static 'playground/vendors/jquery.min.js' %}"></script>
<script charset="utf-8">
$('h3').each(function() {
$(this)
.click(function() { $(this).toggleClass('help__section--closed'); })
.addClass('help__section help__section--closed')
.nextUntil("h3, h2, h1")
.wrapAll('<div class="help__inner"></div>');
});
</script>
</body>
</html>
......@@ -1162,7 +1162,22 @@ li .icon--tag { color: white } */
line-height: 1.35;
}
.help__content h2 { margin-top: 28pt; text-align: center; margin-bottom: 14pt; }
.help__content h2 {
/* position: sticky; */
/* background-color: white; */
/* top: 0; */
letter-spacing: 1px;
text-transform: uppercase;
}
.help__content h2,
.help__content h3 {
font-weight: bold;
padding-top: 28pt;
padding-bottom: 14pt;
}
.help__content h2:first-of-type { padding-top: 0; }
.help__content :matches(p, ul, ol, pre) + :matches(p, ul, ol, pre) { margin-top: 14pt; }
......@@ -1172,6 +1187,18 @@ li .icon--tag { color: white } */
.help__content code { color: darkgrey; margin-left: 1.25em; font-size: 75%}
.help__section::before { content: "▼ "; }
.help__section--closed::before { content: "▶ "; }
.help__section--closed + .help__inner { display: none; }
.help__content img,
.help__content pre {
overflow: hidden;
max-width: 100%;
}
......
......@@ -11,6 +11,8 @@ window.W = window.W || {};
var baseView = this.getOption('application').getView();
var view = new W.HomeView();
baseView.showChildView('main', view);
baseView.getChildView('help').triggerMethod("hide");
},
......@@ -18,6 +20,7 @@ window.W = window.W || {};
var baseView = this.getOption('application').getView();
var view = new W.AboutView();
baseView.showChildView('main', view);
baseView.getChildView('help').triggerMethod("hide");
},
......@@ -25,6 +28,8 @@ window.W = window.W || {};
var baseView = this.getOption('application').getView();
var view = new W.UserListView();
baseView.showChildView('main', view);
baseView.getChildView('help').triggerMethod("hide");
},
......@@ -32,6 +37,8 @@ window.W = window.W || {};
var baseView = this.getOption('application').getView();
var view = new W.UserDetailView();
baseView.showChildView('main', view);
baseView.getChildView('help').triggerMethod("hide");
},
......@@ -39,6 +46,8 @@ window.W = window.W || {};
var baseView = this.getOption('application').getView();
var view = new W.ScoreListView();
baseView.showChildView('main', view);
baseView.getChildView('help').triggerMethod("hide");
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment