Skip to content

Commit c56c33c

Browse files
committed
Get rid of fixed-position-ness of nav sidebar
refs functional-koans/clojure-koans#34
1 parent 11336ca commit c56c33c

File tree

3 files changed

+52
-86
lines changed

3 files changed

+52
-86
lines changed

public/stylesheets/style.css

+28-27
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* =MC Main Content
1616
*
1717
*
18-
* Color Index
18+
* Color Index
1919
* #e2dcd4 - Body Background Beige - to avoid white flicker prior to paper.jpg load
2020
* #afb59b - 'Stripe' Navigation Banner Background Green - again to avoid flickr before image load
2121
* #990000 - Link hover red (non-navigation links)
@@ -49,18 +49,15 @@
4949

5050
html, body {
5151
background-color: #e2dcd4;
52+
background: url('../images/paper.jpg');
53+
background-attachment: fixed;
5254
font-size: 16px;
5355
color: #2a1807;
5456
font-family: 'Optima', Arial, sans-serif;
5557
margin: 0;
5658
padding: 0;
5759
}
5860

59-
body {
60-
background-image: url('../images/paper.jpg');
61-
background-attachment: fixed;
62-
}
63-
6461
ul {
6562
list-style-type: none;
6663
padding: 0;
@@ -73,7 +70,7 @@ h1 {
7370
font-family: 'Optima', Arial, sans-serif;
7471
font-weight: lighter;
7572
margin: 0;
76-
text-shadow: 0px -1px 1px #f3f3f3;
73+
text-shadow: 0px -1px 1px #f3f3f3;
7774
}
7875

7976
p {
@@ -83,10 +80,10 @@ p {
8380
padding: 0;
8481
}
8582

86-
a {
83+
a {
8784
color: #b04d22;
88-
font-weight: bold;
89-
text-decoration: none;
85+
font-weight: bold;
86+
text-decoration: none;
9087
}
9188

9289
a:hover {
@@ -104,8 +101,9 @@ a:hover {
104101
/* Main Body */
105102
#outer-wrapper {
106103
margin: 0 auto;
107-
overflow: hidden;
104+
overflow: hidden;
108105
width: 999px; /* Main site width */
106+
position: relative;
109107
}
110108

111109
.rounded_top {
@@ -115,53 +113,56 @@ a:hover {
115113

116114
/* Body Text Column - Right container - holds body text*/
117115
#inner-wrapper {
118-
float: right;
119116
margin-right: 35px;
120117
padding-top: 1em;
121118
width: 629px;
119+
float: left;
122120
}
123121

124122
#top { color: #595249; font-size: 60px; }
125123

126-
124+
.clearfix { clear: both; }
127125

128126

129127

130128

131129
/* ######### NAVIGATION ########## */
132130
/* =N */
133131

132+
#stripe-wrapper {
133+
}
134+
134135
#stripe {
135136
background-color: #afb59b;
136137
background-image: url('../images/bg5.jpg');
137138
height: 100%;
138139
padding-top: 26px;
139-
position: fixed;
140+
float: left;
140141
margin: 0px 35px;
141142
text-align: center;
142143
width: 265px;
143-
144+
144145
zoom: 1;
145146
filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=135, Strength=1);
146-
box-shadow: 0 0 7px black;
147+
box-shadow: 0 0 7px black;
147148
}
148149

149150
#stripe ul {
150151
padding: 26px;
151152
text-align: left;
152153
}
153154

154-
#stripe a {
155+
#stripe a {
155156
color: #2a1807;
156157
display: block;
157-
font-weight: normal;
158+
font-weight: normal;
158159
font-family: Rosarivo, Arial, Sans-serif;
159160
padding: .42em;
160161
border-bottom: 1px dashed #e0d5c7;
161162
}
162163
#stripe a:hover {
163164
background: rgba(255,255,255, .25);
164-
border-radius: 2px;
165+
border-radius: 2px;
165166
color: #e95d3d;
166167
}
167168

@@ -192,7 +193,7 @@ a:hover {
192193
.contributors {
193194
margin: 0 auto;
194195
padding: 2em .5em;
195-
width: 350px;
196+
width: 350px;
196197
}
197198

198199
.contributors li {
@@ -215,31 +216,31 @@ a:hover {
215216

216217
#two {
217218
background-image: url('../images/bulls/bull2.png');
218-
background-position: 100% 95%;
219+
background-position: 100% 95%;
219220
}
220221

221222
#three {
222223
background-image: url('../images/bulls/bull3.png');
223-
background-position: 90% 87%;
224+
background-position: 90% 87%;
224225
}
225226

226227
#five { /* Actually number 4 on the page */
227228
background-image: url('../images/bulls/bull5.png');
228-
background-position: 100% 90%;
229+
background-position: 100% 90%;
229230
}
230231

231232
#seven {
232233
background-image: url('../images/bulls/bull6.png');
233-
background-position: 100% 60%;
234+
background-position: 100% 60%;
234235
}
235236

236237
#eight {
237238
background-image: url('../images/bulls/bull7.png');
238-
background-position: 100% 38%;
239+
background-position: 100% 38%;
239240
}
240241

241242

242243
#nine {
243244
background-image: url('../images/bulls/bull8.png');
244-
background-position: 100% 68%;
245-
}
245+
background-position: 100% 68%;
246+
}

src/clojurekoans/view/index.hiccup.clj

+23-28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1-
[:div {:id "outer-wrapper"}
2-
[:div#cover]
1+
[:div#outer-wrapper
2+
[:div#stripe
3+
[:img {:src "images/logo.png"}]
4+
[:ul
5+
[:li
6+
[:a {:href "#"} "Introduction"]]
7+
[:li
8+
[:a {:href "#"} "1. Install Java"]]
9+
[:li
10+
[:a {:href "#"} "2. Install the Koans"]]
11+
[:li
12+
[:a {:href "#"} "3. Run the First Koan"]]
13+
[:li
14+
[:a {:href "#"} "4. Repeat"]]
15+
[:li
16+
[:a {:href "#"} "A Word on Testing"]]
17+
[:li
18+
[:a {:href "#"} "Contributors"]]
19+
[:li
20+
[:a {:href "#"} "Thanks"]]]]
21+
322
[:div#inner-wrapper
423
[:div#one.section
524

@@ -96,12 +115,7 @@
96115
[:div#eight.section
97116
[:h1 "Contributors"]
98117

99-
(if-let [contributors (seq (get-contributors))]
100-
[:ul.contributors
101-
(doall (for [{name :name login :login} contributors]
102-
[:li
103-
[:a {:href (str "https://github.com/" login)} name]]))]
104-
[:p [:a {:href "https://github.com/functional-koans/clojure-koans/graphs/contributors"} "Our Contributors"]])
118+
[:p [:a {:href "https://github.com/functional-koans/clojure-koans/graphs/contributors"} "Our Contributors"]]
105119

106120
[:p "If you have any questions or suggestions about the koans, feel free to "
107121
[:a {:href "https://github.com/functional-koans/clojure-koans/"} "open an issue or pull request"]
@@ -121,23 +135,4 @@
121135
" and powered by "
122136
[:a {:href "http://www.joodoweb.com"} "Joodo"]
123137
"."]]]
124-
125-
[:div#stripe
126-
[:img {:src "images/logo.png"}]
127-
[:ul
128-
[:li
129-
[:a {:href "#"} "Introduction"]]
130-
[:li
131-
[:a {:href "#"} "1. Install Java"]]
132-
[:li
133-
[:a {:href "#"} "2. Install the Koans"]]
134-
[:li
135-
[:a {:href "#"} "3. Run the First Koan"]]
136-
[:li
137-
[:a {:href "#"} "4. Repeat"]]
138-
[:li
139-
[:a {:href "#"} "A Word on Testing"]]
140-
[:li
141-
[:a {:href "#"} "Contributors"]]
142-
[:li
143-
[:a {:href "#"} "Thanks"]]]]]
138+
[:div.clearfix]]

src/clojurekoans/view/view_helpers.clj

+1-31
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,5 @@
33
(:use
44
[joodo.views :only (render-partial *view-context*)]
55
[hiccup.page-helpers]
6-
[hiccup.form-helpers]
7-
[clojure.java.io :only [reader]]
8-
[clojure.data.json :only [read-json]])
9-
(:import java.net.URL))
6+
[hiccup.form-helpers]))
107

11-
(def cached-contributors (atom []))
12-
13-
(defn get-contributor-json
14-
([]
15-
(try
16-
(let [conn (-> (URL. "http://github.com/api/v2/json/repos/show/functional-koans/clojure-koans/contributors")
17-
.openConnection)]
18-
(.setConnectTimeout conn 1000)
19-
(.setReadTimeout conn 1000)
20-
(get-contributor-json (.getInputStream conn)))
21-
(catch Exception e
22-
nil)))
23-
([stream]
24-
(try
25-
(slurp (reader stream))
26-
(catch Exception e
27-
nil))))
28-
29-
(defn get-contributors
30-
([]
31-
(get-contributors (get-contributor-json)))
32-
([json]
33-
(let [parsed (if json
34-
(read-json json)
35-
@cached-contributors)]
36-
(when json (reset! cached-contributors parsed))
37-
(:contributors parsed))))

0 commit comments

Comments
 (0)