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

Responsive Clojure Koans Web #6

Open
wants to merge 4 commits into
base: master
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib
.idea
target
.DS_Store
Binary file removed public/images/bulls/.DS_Store
Binary file not shown.
Binary file added public/images/logo-responsive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion public/javascript/clojurekoans.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ $(document).ready(function() {
var li = $(this).closest('li');
var idx = $(nav).index(li);
var section = $('.section').eq(idx);


if(window.innerWidth <= 800) {
$("#nav").slideToggle();
}

$('html, body').animate({scrollTop: section.offset().top});
return false;
});

$("#nav").addClass("js").before('<div id="menu">☰</div>');
$("#menu").click(function(){
$("#nav").slideToggle();
});

});
86 changes: 75 additions & 11 deletions public/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* =N Navigation
* =L Layout
* =MC Main Content
* =R Responsive
*
*
* Color Index
Expand Down Expand Up @@ -113,10 +114,10 @@ a:hover {

/* Body Text Column - Right container - holds body text*/
#inner-wrapper {
margin-left: 335px;
margin-right: 35px;
padding-top: 1em;
width: 629px;
float: left;
}

#top { color: #595249; font-size: 60px; }
Expand All @@ -129,22 +130,16 @@ a:hover {
/* ######### NAVIGATION ########## */
/* =N */

#stripe-wrapper {
}

#stripe {
background-color: #afb59b;
background-image: url('../images/bg5.jpg');
height: 100%;
padding-top: 26px;
float: left;
position: fixed;
margin: 0px 35px;
text-align: center;
width: 265px;

zoom: 1;
filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=135, Strength=1);
box-shadow: 0 0 7px black;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}

#stripe ul {
Expand All @@ -166,6 +161,15 @@ a:hover {
color: #e95d3d;
}

#logo {
background-size: contain;
width: calc(100% - 40px);
height: 200px;
margin: 0 20px;
background-image: url(../images/logo.png);
background-repeat: no-repeat;
}



/* ########### MAIN CONTENT ############## */
Expand All @@ -189,7 +193,6 @@ a:hover {
padding: 1em;
}


.contributors {
margin: 0 auto;
padding: 2em .5em;
Expand All @@ -200,7 +203,6 @@ a:hover {
display: inline-block;
font-size: 1em;
width: 48%;

}


Expand Down Expand Up @@ -244,3 +246,65 @@ a:hover {
background-image: url('../images/bulls/bull8.png');
background-position: 100% 68%;
}



/* ###### RESPONSIVE ###### */
/* =R */

@media only screen and (max-width: 980px) {
#outer-wrapper {
width: 800px;
}
#inner-wrapper {
width: 450px;
}
}

@media screen and (max-width: 800px) {
#stripe {
width: 100%;
height: 70px;
padding: 0;
margin: 0;
z-index: 100;
}
#logo {
width: auto;
height: 60px;
background-image: url(../images/logo-responsive.png);
margin-top: 5px;
}
#outer-wrapper {
width: 100%;
}
#inner-wrapper {
margin: 0;
width: calc(100% - 40px);
padding: 0 20px;
margin-top: 100px;
}
#menu {
width: 1.4em;
font-size: 1.8em;
position: fixed;
top: 13px;
right: 13px;
cursor: pointer;
}
#nav.js {
display: none;
}
ul {
width: calc(100% - 52px);
background-image: url('../images/bg5.jpg');
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
li { width:100%; }
}

@media screen and (min-width: 800px) {
#menu {
display: none;
}
}
4 changes: 2 additions & 2 deletions src/clojurekoans/view/index.hiccup.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[:div#outer-wrapper
[:div#stripe
[:img {:src "images/logo.png"}]
[:ul
[:div#logo]
[:ul#nav
[:li
[:a {:href "#"} "Introduction"]]
[:li
Expand Down
1 change: 1 addition & 0 deletions src/clojurekoans/view/layout.hiccup.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[:title "Clojure Koans"]

(include-css "/stylesheets/style.css")

"<!--[if IE]>"
(include-css "/stylesheets/iestyle.css")
"<![endif]-->"
Expand Down