Add static page navigation

This commit is contained in:
Ray Schamp 2015-05-05 16:53:44 -04:00
parent 53d0b66025
commit a69d55e995
6 changed files with 34 additions and 13 deletions

View file

@ -809,7 +809,7 @@ body > main > footer > div {
body > main > article,
body > section {
display: none; }
body #privacy-policy {
body #home {
display: block; }
#dialogs {
@ -999,10 +999,9 @@ body > main > header {
text-align: center; }
#editor {
text-align: center;
margin-top: 30px;
display: none;
position: relative; }
position: absolute;
width: 100%;
height: 100%; }
.scratch_unsupported p {
color: #aaa;

File diff suppressed because one or more lines are too long

View file

@ -169,10 +169,10 @@
</section>
<nav>
<h2>ScratchX</h2>
<h2><a href="#home" data-staticlink="home">ScratchX</a></h2>
<ul>
<li><a href="">Terms of Service</a></li>
<li><a href="">Privacy Policy</a></li>
<li><a href="#privacy-policy" data-staticlink="privacy-policy">Privacy Policy</a></li>
<li><a href="">Contact Us</a></li>
<li><a href="">FAQ</a></li>
<li><a href="">Forums</a></li>

View file

@ -103,3 +103,26 @@ swfobject.switchOffAutoHideShow();
swfobject.embedSWF('Scratch.swf', 'editor', '100%', '100%', '11.7.0', 'libs/expressInstall.swf',
flashVars, params, null, handleEmbedStatus);
function showPage(path) {
var toHide = "body > main, body > main > article, #editor";
var toShow = "#" + path;
if (path != "editor") {
toShow += ", body > main";
}
$(toHide).hide();
$(toShow).show();
}
$("[data-staticlink]").click(function(e) {
e.preventDefault();
showPage(e.target.attributes['data-staticlink'].value)
});
$(function (){
if (window.location.hash) {
showPage(window.location.hash.substr(1));
}
});

View file

@ -1,8 +1,7 @@
#editor {
text-align: center ;
margin-top: 30px;
display: none;
position: relative;
position: absolute;
width: 100%;
height: 100%;
}
.scratch_unsupported p {

View file

@ -35,7 +35,7 @@ body {
> section {
display: none;
}
#privacy-policy {
#home {
display: block;
}
}