git.fiddlerwoaroof.com
Browse code

Initial Prototype Done

- Requires login via OAuth2
- Separated palettes from the color scheme
- A palette is a is just a collection of named colors
- A color scheme attaches a meaning to the colors (it just stores
symbols)
- This structure allows certain operations on the palette to propagate
to he correct contexts automagically

fiddlerwoaroof authored on 02/09/2015 15:57:00
Showing 5 changed files
... ...
@@ -4,6 +4,7 @@
4 4
 (ql:quickload :cl-markup)
5 5
 
6 6
 (push (cons "application" "rdf+xml") drakma:*text-content-types*)
7
+(push (cons "text" "rss+xml") drakma:*text-content-types*)
7 8
 
8 9
 (defparameter *app* (make-instance 'ningle:<app>))
9 10
 
... ...
@@ -60,7 +61,7 @@
60 61
            (link (extract-text "link"))
61 62
            (description-raw (let ((plump:*html-tags*)
62 63
                                   (ss (make-string-output-stream)))
63
-                              (plump:serialize 
64
+                              (plump:serialize
64 65
                                 (plump:parse (extract-text "description"))
65 66
                                 ss)
66 67
                               (get-output-stream-string ss)))
... ...
@@ -111,7 +112,7 @@
111 112
           (:a :href "/login/facebook" "Facebook"))
112 113
         (:div
113 114
           :class "login-button google"
114
-          (:a :href "/login/google" "Google")))))) 
115
+          (:a :href "/login/google" "Google"))))))
115 116
 
116 117
 (defparameter *feed-urls*
117 118
   #(
... ...
@@ -122,12 +123,13 @@
122 123
     "http://www.reddit.com/r/roguelikedev.rss"
123 124
     "http://www.reddit.com/r/roguelikes.rss"
124 125
     "http://www.reddit.com/r/talesfromtechsupport.rss"
126
+    "https://thomism.wordpress.com/feed/rss"
125 127
     ))
126 128
 
127 129
 (let
128 130
   ((plump-parser:*tag-dispatchers* plump-parser:*xml-tags*))
129 131
   (defparameter *docs* (map 'vector
130
-                            (lambda (x) 
132
+                            (lambda (x)
131 133
                               (format t "~a~%" x)
132 134
                               (unwind-protect (plump-parser:parse
133 135
                                                 (drakma:http-request x))))
... ...
@@ -135,31 +137,73 @@
135 137
 
136 138
 (defparameter *feeds* (map 'vector (lambda (x) (unwind-protect (make-rss-feed x))) *docs*))
137 139
 
140
+(defclass palette () ; soloarized http://ethanschoonover.com/solarized
141
+  ((base03     :accessor palette-base03      :initform "#002b36")
142
+   (base02     :accessor palette-base02      :initform "#073642")
143
+   (base01     :accessor palette-base01      :initform "#586e75")
144
+   (base00     :accessor palette-base00      :initform "#657b83")
145
+   (base0      :accessor palette-base0       :initform "#839496")
146
+   (base1      :accessor palette-base1       :initform "#93a1a1")
147
+   (base2      :accessor palette-base2       :initform "#eee8d5")
148
+   (base3      :accessor palette-base3       :initform "#fdf6e3")
149
+   (yellow     :accessor palette-yellow      :initform "#b58900")
150
+   (orange     :accessor palette-orange      :initform "#cb4b16")
151
+   (red        :accessor palette-red         :initform "#dc322f")
152
+   (magenta    :accessor palette-magenta     :initform "#d33682")
153
+   (violet     :accessor palette-violet      :initform "#6c71c4")
154
+   (blue       :accessor palette-blue        :initform "#268bd2")
155
+   (cyan       :accessor palette-cyan        :initform "#2aa198")
156
+   (green      :accessor palette-green       :initform "#859900")))
157
+
158
+(defparameter *palette* (make-instance 'palette))
159
+(defgeneric invert-palette (palette))
160
+
161
+(defmacro initialize-to (obj1-v obj2-v &body slot-swaps)
162
+  (alexandria:with-gensyms (obj1 obj2)
163
+    `(let* ((,obj1 ,obj1-v)
164
+            (,obj2 ,obj2-v))
165
+       ,@(loop for (to from) in slot-swaps
166
+               collect `(setf (,to ,obj1) (,from ,obj2))))))
167
+
168
+(defmethod invert-palette ((palette palette))
169
+  (let ((result (make-instance 'palette)))
170
+    (initialize-to result palette
171
+      (palette-base03 palette-base3)
172
+      (palette-base02 palette-base2)
173
+      (palette-base01 palette-base1)
174
+      (palette-base00 palette-base0)
175
+      (palette-base0  palette-base00)
176
+      (palette-base1  palette-base01)
177
+      (palette-base2  palette-base02)
178
+      (palette-base3  palette-base03))
179
+    result))
180
+(setf *palette* (invert-palette *palette*))
181
+
138 182
 (defclass colorscheme ()
139
-  ((background :accessor colorscheme-background :initform "#002b36")
140
-   (foreground :accessor colorscheme-foreground :initform "#839496")
141
-   (accent     :accessor colorscheme-accent     :initform "#586e75" )
142
-   (base03     :accessor colorscheme-base03      :initform "#002b36")
143
-   (base02     :accessor colorscheme-base02      :initform "#073642")
144
-   (base01     :accessor colorscheme-base01      :initform "#586e75")
145
-   (base00     :accessor colorscheme-base00      :initform "#657b83")
146
-   (base0      :accessor colorscheme-base0       :initform "#839496")
147
-   (base1      :accessor colorscheme-base1       :initform "#93a1a1")
148
-   (base2      :accessor colorscheme-base2       :initform "#eee8d5")
149
-   (base3      :accessor colorscheme-base3       :initform "#fdf6e3")
150
-   (yellow     :accessor colorscheme-yellow      :initform "#b58900")
151
-   (orange     :accessor colorscheme-orange      :initform "#cb4b16")
152
-   (red        :accessor colorscheme-red         :initform "#dc322f")
153
-   (magenta    :accessor colorscheme-magenta     :initform "#d33682")
154
-   (violet     :accessor colorscheme-violet      :initform "#6c71c4")
155
-   (blue       :accessor colorscheme-blue        :initform "#268bd2")
156
-   (cyan       :accessor colorscheme-cyan        :initform "#2aa198")
157
-   (green      :accessor colorscheme-green       :initform "#859900")))
158
-
159
-(defgeneric accentize (colorscheme accent)) 
183
+  ((bg           :accessor -colorscheme-bg           :initform 'base03)
184
+   (bg-highlight :accessor -colorscheme-bg-highlight :initform 'base02)
185
+   (fg-deemph    :accessor -colorscheme-fg-deemph    :initform 'base01)
186
+   (fg           :accessor -colorscheme-fg           :initform 'base0 )
187
+   (fg-highlight :accessor -colorscheme-fg-highlight :initform 'base1 )
188
+   (accent       :accessor -colorscheme-accent       :initform 'violet)))
189
+
190
+(defgeneric accentize (colorscheme accent))
160 191
 (defmethod accentize ((colorscheme colorscheme) accent)
161 192
   (setf (colorscheme-accent colorscheme) (funcall accent colorscheme)))
162 193
 
194
+(defmacro def-palette-accessor (scheme-slot scheme palette )
195
+  `(progn
196
+     (defgeneric ,scheme-slot (,scheme))
197
+     (defmethod ,scheme-slot ((,scheme colorscheme))
198
+       (slot-value ,palette (,(intern (concatenate 'string "-" (symbol-name scheme-slot))) ,scheme)))))
199
+
200
+(def-palette-accessor colorscheme-bg scheme *palette*)
201
+(def-palette-accessor colorscheme-bg-highlight scheme *palette*)
202
+(def-palette-accessor colorscheme-fg-deemph scheme *palette*)
203
+(def-palette-accessor colorscheme-fg scheme *palette*)
204
+(def-palette-accessor colorscheme-fg-highlight scheme *palette*)
205
+(def-palette-accessor colorscheme-accent scheme *palette*)
206
+
163 207
 (defgeneric rebase (colorscheme))
164 208
 (defmethod rebase ((colorscheme colorscheme))
165 209
   (macrolet
... ...
@@ -169,9 +213,12 @@
169 213
                (,color2 ,obj)
170 214
                (,color1 ,obj)))))
171 215
     ; Note that swap-color doesn't use gensyms: so don't run functions in invocation
172
-    (swap-color colorscheme colorscheme-foreground colorscheme-base0 colorscheme-base0)
173 216
     (swap-color colorscheme colorscheme-accent colorscheme-base1 colorscheme-base01)
174
-    (swap-color colorscheme colorscheme-background colorscheme-base3 colorscheme-base03)
217
+    (swap-color colorscheme colorscheme-bg colorscheme-base3 colorscheme-base03)
218
+    (swap-color colorscheme colorscheme-bg-highlight colorscheme-base3 colorscheme-base03)
219
+    (swap-color colorscheme colorscheme-deemph colorscheme-base0 colorscheme-base0)
220
+    (swap-color colorscheme colorscheme-fg colorscheme-base0 colorscheme-base0)
221
+    (swap-color colorscheme colorscheme-fg-highlight colorscheme-base0 colorscheme-base0)
175 222
     colorscheme))
176 223
 
177 224
 
... ...
@@ -183,50 +230,67 @@
183 230
 ;rebase $base03,$base02,$base01,$base00 ,$base0 ,$base1 ,$base2 ,$base3
184 231
 
185 232
 
186
-(cl-oid-connect:def-route ("/" (params) :app *app*)
233
+(cl-oid-connect:def-route ("/theme.css" (params) :app *app*)
187 234
   (flet ((combine-unit-q (quant unit) (format nil "~d~a" quant unit)))
188
-    (let* ((header-height 10)
235
+    (let* ((header-height 13)
189 236
            (height-units "vh")
190 237
            (ss (lass:compile-and-write
191
-                 `(* :color ,(colorscheme-foreground *colorscheme*))
238
+                 `(* :color ,(colorscheme-fg *colorscheme*))
239
+
240
+                 `(body :background-color ,(colorscheme-bg *colorscheme*))
192 241
 
193
-                 `(body :background-color ,(colorscheme-background *colorscheme*))
242
+                 `((:or h1 h2 h3)
243
+                   :color ,(colorscheme-fg-highlight *colorscheme*))
244
+                 `(.feed-header
245
+                    :background-color ,(colorscheme-bg-highlight *colorscheme*))
194 246
 
195
-                 `((:or h1 h2 h3 h4 h5 h6) :color ,(colorscheme-accent *colorscheme*))
247
+                 `((:or h4 h5 h6) :color ,(colorscheme-fg-highlight *colorscheme*))
196 248
 
197 249
                  `(header
198
-                    :border-bottom "thin" "solid" ,(colorscheme-foreground *colorscheme*)
250
+                    :border-bottom "thin" "solid" ,(colorscheme-accent *colorscheme*)
199 251
                     :height ,(combine-unit-q header-height height-units)
200 252
                     :font-size ,(combine-unit-q (* 0.75 header-height) height-units)
201 253
                     :line-height ,(combine-unit-q header-height height-units))
202 254
 
255
+                 `(main
256
+                    :height ,(combine-unit-q (- 100 header-height) height-units))
257
+
203 258
                  `((:or a (:and a :visited) (:and a :active) code.url)
204
-                   :color ,(colorscheme-accent *colorscheme*))
259
+                   :color ,(colorscheme-fg-highlight *colorscheme*))
205 260
 
206 261
                  `(section#sidebar
207
-                    ((ul.menu li a)
208
-                     ((+ a)
209
-                      :border-top "thin" "solid" ,(colorscheme-accent *colorscheme*))
210
-                     ((:and li :hover)
211
-                      :background-color ,(colorscheme-foreground *colorscheme*)
212
-                      :color ,(colorscheme-background *colorscheme*))))
213
-
214
-                 `(.feed :border thin solid ,(colorscheme-foreground *colorscheme*))
215
-                 `(.link
216
-                    :border-top thin solid ,(colorscheme-foreground *colorscheme*)
217
-                    :border-bottom thin solid ,(colorscheme-foreground *colorscheme*)
262
+                    (ul.menu
263
+                      ((li + li)
264
+                       :border-top "thin" "solid" ,(colorscheme-fg-highlight *colorscheme*))
265
+                      ((:and li :hover)
266
+                       :background-color ,(colorscheme-bg-highlight *colorscheme*)
267
+                       :color ,(colorscheme-fg-highlight *colorscheme*))))
218 268
 
219
-                    (.link-info
220
-                      :background ,(colorscheme-foreground *colorscheme*)
221
-                      :color ,(colorscheme-background *colorscheme*)
222
-                      :border "thin" "solid" ,(colorscheme-foreground *colorscheme*)
269
+                 `(.feed :border thin solid ,(colorscheme-fg *colorscheme*))
223 270
 
224
-                      (.link-url 
225
-                        ;:color ,(colorscheme-cyan *colorscheme*)
226
-                        :color ,(colorscheme-background *colorscheme*))
227
-                      (.link-date
228
-                        :color ,(colorscheme-background *colorscheme*)))))))
271
+                 `(.link
272
+                    :border-top thin solid ,(colorscheme-fg *colorscheme*)
273
+                    :border-bottom none
274
+
275
+                    (.link-header :background-color ,(colorscheme-bg-highlight *colorscheme*))
229 276
 
277
+                    (.link-info
278
+                      :color ,(colorscheme-fg-deemph *colorscheme*)
279
+                      :border-bottom "thin" "solid" ,(colorscheme-fg *colorscheme*)
280
+                      ((:or a span)
281
+                       :color inherit)
282
+                      ((:and a :hover)
283
+                       :color ,(colorscheme-fg *colorscheme*))
284
+                      ))
285
+                 `((:and .feed-header :hover)
286
+                   :background-color ,(colorscheme-bg *colorscheme*))
287
+                 `(.link.closed
288
+                    (.link-header
289
+                      :background-color ,(colorscheme-bg *colorscheme*))
290
+                    ((:and .link-header :hover)
291
+                     :background-color ,(colorscheme-bg-highlight *colorscheme*)))
292
+
293
+                 )))
230 294
       `(200 (:content-type "text/css") ,ss))))
231 295
 
232 296
 (defmacro item-markup (item)
... ...
@@ -241,17 +305,18 @@
241 305
              (:span :class "link-url" (rss-item-link ,item-s)))
242 306
             (:span :class "link-date") (rss-item-pub-date ,item-s)))
243 307
           (:section :class "link-content"
244
-           (cl-markup:raw (rss-item-description-raw ,item-s))))))))
308
+           (:div
309
+             (cl-markup:raw (rss-item-description-raw ,item-s)))))))))
245 310
 
246 311
 (defmacro feed-markup (feed-v fc-v)
247 312
   (alexandria:with-gensyms (feed fc)
248 313
     `(let ((,feed ,feed-v)
249 314
            (,fc ,fc-v))
250 315
        (cl-markup:markup
251
-         (:section :class "feed" :id (format nil "feed-~a" ,fc)
316
+         (:section :class "feed closed" :id (format nil "feed-~a" ,fc)
252 317
           (:section :class "feed-header"
253 318
            (:h2 (rss-feed-title ,feed))
254
-           (:h3 (rss-feed-description ,feed))) 
319
+           (:h3 (rss-feed-description ,feed)))
255 320
           (:ul :class "post-list"
256 321
            (loop for item in (rss-feed-items ,feed)
257 322
                  collect (item-markup item))))))))
... ...
@@ -276,6 +341,7 @@
276 341
        (:script :src "https://code.jquery.com/jquery-2.1.4.min.js" :type "text/javascript" "")
277 342
        (:script :src "/static/js/fold.js" :type "text/javascript" "")
278 343
        (:link :rel "stylesheet" :href "/static/css/main.css")
344
+       (:link :rel "stylesheet" :href "/static/css/content.css")
279 345
        (:link :rel "stylesheet" :href "/theme.css"))
280 346
      (:body
281 347
        (:header
... ...
@@ -295,12 +361,14 @@
295 361
 ;(cl-oid-connect:def-route ("/" (params) :app *app*)
296 362
 ;  (ningle:with-context-variables (session)
297 363
 ;    (cl-oid-connect:redirect-if-necessary session
298
-;      (cl-oid-connect:require-login 
364
+;      (cl-oid-connect:require-login
299 365
 ;        (anaphora:sunless (gethash :counter session) (setf anaphora:it 0))
300 366
 ;        (incf (gethash :counter session))
301 367
 ;        (format nil "~Ath visit<br/>~a<br/><br/>"
302 368
 ;                (gethash :counter session))))))
303 369
 
370
+(cl-oid-connect:def-route ("/reflect" (params) :app *app* :method :post)
371
+  (format nil "~s<hr/>" (jonathan.encode:to-json (jonathan:parse (car (elt params 0))))))
304 372
 
305 373
 (cl-oid-connect:def-route ("/feeds/:feeds/html" (params) :app *app*)
306 374
   (ningle.context:with-context-variables (session)
... ...
@@ -316,14 +384,16 @@
316 384
 (cl-oid-connect:def-route ("/" (params) :app *app*)
317 385
   (ningle.context:with-context-variables (session)
318 386
     (cl-oid-connect:require-login
319
-      (cl-oid-connect:require-login 
387
+      (cl-oid-connect:require-login
320 388
         (let ((*feeds* (gethash :feeds session *feeds*)))
321 389
           (base-template-f))))))
322 390
 
323 391
 (defvar *handler* nil)
324 392
 
393
+(defun stop ()
394
+  (clack:stop (pop *handler*)))
325 395
 
326
-(defun start (tmp)
396
+(defun start (&optional tmp)
327 397
   (let ((server (if (> (length tmp) 1)
328 398
                   (intern (string-upcase (elt tmp 1)) 'keyword)
329 399
                   :hunchentoot)))
... ...
@@ -331,16 +401,14 @@
331 401
           (lack.builder:builder
332 402
             :backtrace
333 403
             :session
334
-            :csrf
404
+            ;:csrf
335 405
             (:static :path "/static/" :root #p"./static/")
336 406
             (funcall
337 407
               (cl-oid-connect:oauth2-login-middleware
338
-                :facebook-info (truename "~/github_repos/cl-oid-connect/facebook-secrets.json") 
408
+                :facebook-info (truename "~/github_repos/cl-oid-connect/facebook-secrets.json")
339 409
                 :google-info (truename "~/github_repos/cl-oid-connect/google-secrets.json"))
340 410
               *app*)) :port 9090 :server server)
341
-        *handler*))
342
-  (loop (mp:process-wait))
343
-  )
411
+        *handler*)))
344 412
 
345 413
 
346 414
 
... ...
@@ -1,14 +1,25 @@
1 1
 (:import "url(https://fonts.googleapis.com/css?family=Lato:400,100,300,400italic,300italic,700,700italic,900&subset=latin,latin-ext)")
2 2
 (:import "url(https://fonts.googleapis.com/css?family=Caudex)")
3 3
 
4
+(.feed
5
+  :-webkit-backface-visibility hidden;
6
+  :-webkit-transform "translateZ(0)")
7
+
4 8
 (*
5 9
   :box-sizing "border-box"
6 10
   :margin "0px"
7
-  :padding "0px"
11
+  :padding "0px")
12
+
13
+(body
8 14
   :font-family "Lato")
9 15
 
10
-((:or ul ol)
11
- :list-style "none")
16
+(((:or main "#sidebar" .feed) > (:or ul ol))
17
+ :list-style "none"
18
+ :margin "0px")
19
+
20
+(ul
21
+  :margin "1em"
22
+  )
12 23
 
13 24
 ((:or h1 h2)
14 25
  :font-size "153.9%")
... ...
@@ -29,19 +40,22 @@
29 40
     :padding-left "1em"
30 41
     :font-weight 200))
31 42
 
43
+((:or "#sidebar" main)
44
+ :border-top none)
45
+
32 46
 (section#sidebar
33
-  :width "20vw"
47
+  :width "38vw"
34 48
   :height "90vh"
35 49
   :position "fixed"
36 50
   :overflow "auto"
37 51
   (ul.menu
38 52
     :text-align right
39
-    :font-variant small-cap
53
+    :font-variant small-caps
40 54
     (li
41 55
       (a
42 56
         :width "100%"
43 57
         :display block
44
-        :padding "1em"
58
+        :padding "0.5em"
45 59
         :color inherit
46 60
         :text-decoration none
47 61
         :font-weight 700
... ...
@@ -49,35 +63,33 @@
49 63
         ))))
50 64
 
51 65
 (main
52
-  :padding-right "20vw"
53
-  :width "80vw"
54
-  :height "90vh"
66
+  :width "62vw"
55 67
   :float "right"
56 68
   :clear "right"
57
-  :overflow "auto")
69
+  :overflow-x "hidden"
70
+  :overflow-y "scroll")
58 71
 
59 72
 (.feed-header
60
-  :padding "1em"
73
+  ((:or h2 h3) :padding "0.62em")
74
+  (h2 :padding-bottom "0.38em")
75
+  (h3 :padding-top "0.38em")
61 76
   :padding-bottom "0em")
62 77
 
63
-((:and .link :before)
64
- :content "-")
65
-
66
-((:and .link.closed :before)
67
- :content "+")
68
-
69 78
 ((.link.closed .link-content) 
70 79
   :max-height "0px"
71 80
   :padding "0em")  
72 81
 
82
+(.link.closed
83
+  :padding-bottom "0em")
84
+
73 85
 (.link
74 86
   :text-decoration none
75 87
   :display block
76
-  :padding "1em"
77
-  :padding-bottom "0em"
78 88
   :overflow hidden
79 89
   :font-size "0.8em"
80
-  (.link-header
90
+  (.link-header 
91
+    :padding "1em"
92
+    :padding-bottom "0em"
81 93
     :cursor pointer
82 94
     (h4
83 95
       :margin-bottom "0.5em"
... ...
@@ -87,9 +99,9 @@
87 99
     :margin-right "-1em"
88 100
     :padding-left "1em"
89 101
     :padding-right "1em"
102
+    :padding-bottom "0.32em"
90 103
     (.link-url 
91
-      :float "left"
92
-      )
104
+      :float "left")
93 105
     (.link-date
94 106
       :float "right"
95 107
       :display block))
... ...
@@ -98,9 +110,20 @@
98 110
    :display block
99 111
    :clear both)
100 112
   (.link-content
101
-    :transition "max-height 0.2s ease"))
113
+    ((> div)
114
+     :padding "1em")
115
+    :transition "max-height 0.5s ease"))
116
+
117
+(.feed.closed
118
+  (.post-list 
119
+    :max-height "0px"
120
+    :padding "0em"))
121
+
122
+((:and .feed :first-child)
123
+ :border-top none)
102 124
 
103 125
 (.feed
104 126
   :overflow "hidden"
105
-  )
127
+  (.post-list
128
+    :transition "max-height 0.5s ease"))
106 129
 
... ...
@@ -8,10 +8,24 @@
8 8
                              (siblings ".link-content")
9 9
                              (each (lambda ()
10 10
                                      (if (= (chain ($ this) (css "max-height")) "0px")
11
-                                       (chain ($ this)
12
-                                              (css "max-height" (@ this scroll-height)))
13
-                                       (chain ($ this)
14
-                                              (css "max-height" "0px"))))))
11
+                                       (let ((added-height (chain ($ this) (children) (outer-height)))
12
+                                             (parent-height (chain ($ this)
13
+                                                                   (parents ".post-list")
14
+                                                                   (css "max-height"))))
15
+                                         (chain ($ this) (css "max-height" added-height))
16
+                                         (chain ($ this)
17
+                                                (parents ".post-list")
18
+                                                (css "max-height" (+ added-height parent-height))))
19
+                                       (chain ($ this) (css "max-height" "0px"))))))
20
+                      (chain ($ this) (parent) (toggle-class "closed")))))
21
+           (chain ($ ".feed-header")
22
+                  (click
23
+                    (lambda ()
15 24
                       (chain ($ this)
16
-                             (parent)
17
-                             (toggle-class "closed"))))))))
25
+                             (siblings ".post-list")
26
+                             (each (lambda ()
27
+                                     (if (= (chain ($ this) (css "max-height")) "0px")
28
+                                       (chain ($ this) (css "max-height" (@ this scroll-height)))
29
+                                       (chain ($ this) (css "max-height" "0px"))))))
30
+                      (chain ($ this) (parent) (toggle-class "closed")))))
31
+           null)))
... ...
@@ -1 +1 @@
1
-@import url(https://fonts.googleapis.com/css?family=Lato:400,100,300,400italic,300italic,700,700italic,900&subset=latin,latin-ext);@import url(https://fonts.googleapis.com/css?family=Caudex);*{box-sizing:border-box;margin:0px;padding:0px;font-family:Lato;}ul,ol{list-style:none;}h1,h2{font-size:153.9%;}:h3{font-size:146.5%;}h4,h5,h6{font-size:138.5%;}ul + h1,ul + h2,ul + h3,ul + h4,ul + h5,ul + h6{width:initial;}header{color:white;}header h1{font-family:Caudex;font-size:inherit;margin-top:0em;padding-left:1em;font-weight:200;}section#sidebar{width:20vw;height:90vh;position:fixed;overflow:auto;}section#sidebar ul.menu{text-align:right;font-variant:small-cap;}section#sidebar ul.menu li a{width:100%;display:block;padding:1em;color:inherit;text-decoration:none;font-weight:700;font-size:125%;}main{padding-right:20vw;width:80vw;height:90vh;float:right;clear:right;overflow:auto;}.feed-header{padding:1em;padding-bottom:0em;}.link:before{content:-;}.link.closed:before{content:+;}.link.closed .link-content{max-height:0px;padding:0em;}.link{text-decoration:none;display:block;padding:1em;padding-bottom:0em;overflow:hidden;font-size:0.8em;}.link .link-header{cursor:pointer;}.link .link-header h4{margin-bottom:0.5em;display:inline-block;}.link .link-info{margin-left:-1em;margin-right:-1em;padding-left:1em;padding-right:1em;}.link .link-info .link-url{float:left;}.link .link-info .link-date{float:right;display:block;}.link .link-info:after{content:" ";display:block;clear:both;}.link .link-content{-moz-transition:max-height 0.2s ease;-o-transition:max-height 0.2s ease;-webkit-transition:max-height 0.2s ease;-ms-transition:max-height 0.2s ease;transition:max-height 0.2s ease;}.feed{overflow:hidden;}
2 1
\ No newline at end of file
2
+@import url(https://fonts.googleapis.com/css?family=Lato:400,100,300,400italic,300italic,700,700italic,900&subset=latin,latin-ext);@import url(https://fonts.googleapis.com/css?family=Caudex);.feed{-webkit-backface-visibility:hidden;-webkit-transform:translateZ(0);}*{box-sizing:border-box;margin:0px;padding:0px;}body{font-family:Lato;}main > ul,main > ol,#sidebar > ul,#sidebar > ol,.feed > ul,.feed > ol{list-style:none;margin:0px;}ul{margin:1em;}h1,h2{font-size:153.9%;}:h3{font-size:146.5%;}h4,h5,h6{font-size:138.5%;}ul + h1,ul + h2,ul + h3,ul + h4,ul + h5,ul + h6{width:initial;}header{color:white;}header h1{font-family:Caudex;font-size:inherit;margin-top:0em;padding-left:1em;font-weight:200;}#sidebar,main{border-top:none;}section#sidebar{width:38vw;height:90vh;position:fixed;overflow:auto;}section#sidebar ul.menu{text-align:right;font-variant:small-caps;}section#sidebar ul.menu li a{width:100%;display:block;padding:0.5em;color:inherit;text-decoration:none;font-weight:700;font-size:125%;}main{width:62vw;float:right;clear:right;overflow-x:hidden;overflow-y:scroll;}.feed-header{padding-bottom:0em;}.feed-header h2,.feed-header h3{padding:0.62em;}.feed-header h2{padding-bottom:0.38em;}.feed-header h3{padding-top:0.38em;}.link.closed .link-content{max-height:0px;padding:0em;}.link.closed{padding-bottom:0em;}.link{text-decoration:none;display:block;overflow:hidden;font-size:0.8em;}.link .link-header{padding:1em;padding-bottom:0em;cursor:pointer;}.link .link-header h4{margin-bottom:0.5em;display:inline-block;}.link .link-info{margin-left:-1em;margin-right:-1em;padding-left:1em;padding-right:1em;padding-bottom:0.32em;}.link .link-info .link-url{float:left;}.link .link-info .link-date{float:right;display:block;}.link .link-info:after{content:" ";display:block;clear:both;}.link .link-content{-moz-transition:max-height 0.5s ease;-o-transition:max-height 0.5s ease;-webkit-transition:max-height 0.5s ease;-ms-transition:max-height 0.5s ease;transition:max-height 0.5s ease;}.link .link-content > div{padding:1em;}.feed.closed .post-list{max-height:0px;padding:0em;}.feed:first-child{border-top:none;}.feed{overflow:hidden;}.feed .post-list{-moz-transition:max-height 0.5s ease;-o-transition:max-height 0.5s ease;-webkit-transition:max-height 0.5s ease;-ms-transition:max-height 0.5s ease;transition:max-height 0.5s ease;}
3 3
\ No newline at end of file
... ...
@@ -1,9 +1,23 @@
1 1
 $(document).ready(function () {
2
-    return $('.link-header').click(function () {
2
+    $('.link-header').click(function () {
3 3
         $(this).siblings('.link-content').each(function () {
4
+            if ($(this).css('max-height') === '0px') {
5
+                var addedHeight = $(this).children().outerHeight();
6
+                var parentHeight = $(this).parents('.post-list').css('max-height');
7
+                $(this).css('max-height', addedHeight);
8
+                return $(this).parents('.post-list').css('max-height', addedHeight + parentHeight);
9
+            } else {
10
+                return $(this).css('max-height', '0px');
11
+            };
12
+        });
13
+        return $(this).parent().toggleClass('closed');
14
+    });
15
+    $('.feed-header').click(function () {
16
+        $(this).siblings('.post-list').each(function () {
4 17
             return $(this).css('max-height') === '0px' ? $(this).css('max-height', this.scrollHeight) : $(this).css('max-height', '0px');
5 18
         });
6 19
         return $(this).parent().toggleClass('closed');
7 20
     });
21
+    return null;
8 22
 });
9 23