Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial responsive commit. See #12 #16

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions _layouts/doc.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="{{site.baseurl}}/assets/pygment.css" />
<link rel="stylesheet" href="{{site.baseurl}}/assets/main.css" />

Expand All @@ -11,6 +12,32 @@

<body>

<header id="mobile-header">
<h1 id="logo-top"><a href="http://bonsaijs.org/">Bonsai</a></h1>
<a id="link-to-nav" href="#nav">Menu</a>
</header>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

<div id="content" class="{% if page.categories contains 'jsdoc' %}jsdoc{% endif %}">

<h1>
{{page.title}}
</h1>

{% if page.relatedLinks and page.relatedLinks != empty %}
<div id="relatedLinks">
<h3>Related:</h3>
{% for link in page.relatedLinks %}
<a class="overview" href="{{link}}">{{page.relatedNames[forloop.index0]}} &raquo;</a>
{% endfor %}
</div>
{% endif %}

{{content}}
<br style="clear:both;"/>
</div>

<div id="side"></div>
<div id="nav">
<h1 id="logo"><a href="http://bonsaijs.org/">Bonsai</a></h1>
Expand Down Expand Up @@ -43,7 +70,6 @@ <h2 class="menuHeading">API: Mixins</h2>
</ul>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
(function() {
// Make collapsible menu sections:
Expand Down Expand Up @@ -85,26 +111,6 @@ <h2 class="menuHeading">API: Mixins</h2>

}());
</script>

<div id="content" class="{% if page.categories contains 'jsdoc' %}jsdoc{% endif %}">

<h1>
{{page.title}}
</h1>

{% if page.relatedLinks and page.relatedLinks != empty %}
<div id="relatedLinks">
<h3>Related:</h3>
{% for link in page.relatedLinks %}
<a class="overview" href="{{link}}">{{page.relatedNames[forloop.index0]}} &raquo;</a>
{% endfor %}
</div>
{% endif %}

{{content}}
<br style="clear:both;"/>
</div>

<script src="{{site.baseurl}}/lib/ace/ace-noconflict.js"></script>
<script src="{{site.baseurl}}/lib/bonsai/bonsai.iframe.js"></script>
<script src="{{site.baseurl}}/assets/doc.js"></script>
Expand Down
71 changes: 71 additions & 0 deletions assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ p {
}

#logo { padding: 0; }
#logo-top a,
#logo a {
display: block;
text-indent: -9999em;
Expand Down Expand Up @@ -279,3 +280,73 @@ code {
font-size: 1.2em;
font-style: italic;
}

#mobile-header {
display: none;
}

@media screen and (max-width: 520px) {

#mobile-header {
display: block;
background: #111926;
position: relative;
}

#logo-top a {
background-position: 5% 0
}

#link-to-nav {
display: inline-block;
position: absolute;
margin-top: -1em;
right: 1.5em;
top: 50%;
color: #fff;
font-weight: bold;
font-size: 1.2em;
padding: 0.666em 1.333em;
text-decoration: none;
background: #061426;
background: -webkit-linear-gradient(top, #272A33, #061426);
background: -moz-linear-gradient(top, #272A33, #061426);
background: -o-linear-gradient(top, #272A33, #061426);
background: linear-gradient(top, #272A33, #061426);
border-radius: 0.333em;
border: 1px solid #020E26;
box-shadow: inset 0 0 3px rgba(255,255,255,0.333);
}

#side {
display: none;
}

#logo {
display: none;
}

#nav {
background: #111926;
position: static;
width: auto;
}

#nav .menuHeading {
background-position: 95% 10px;
}

#content {
font-size: 1.25em;
margin: 0 auto;
padding: 0 0 30px;
width: 95%;
}

#content img {
max-width: 100%;

}


}