Fix homepage and menu overlapping

tree@88abd89677
This commit is contained in:
Galen Wolfe-Pauly 2016-02-24 16:19:25 -08:00
parent 378e4587c2
commit e3f9bc8038
2 changed files with 188 additions and 39 deletions

View File

@ -1,5 +1,6 @@
@charset "UTF-8";
.col-md-10.body {
padding-left: 2.8125rem; }
padding-left: 0; }
@media (max-width: 767px) {
.col-md-10.body {
@ -83,7 +84,6 @@ img.logo.first {
padding-left: 0;
padding-right: 0;
background-color: #fff;
max-width: 16.66667%;
transition: max-width .2s ease-in-out;
position: fixed;
z-index: 100; }
@ -101,8 +101,7 @@ img.logo.first {
.ctrl a.nav-link {
letter-spacing: 1px; }
.ctrl .selected a.nav-link {
font-weight: 500;
letter-spacing: 0; }
font-weight: 500; }
.ctrl.open,
.ctrl:hover {
@ -253,6 +252,9 @@ img.logo.first {
[data-path^='/docs'] .selected .nav-link {
color: #02D124; }
[data-path^='/docs'] .nav-link {
font-weight: 500; }
[data-path^='/docs'] .home {
background-color: #0500F0;
border-color: #0500F0; }
@ -280,6 +282,13 @@ img.logo.first {
margin-left: .05rem;
font-size: 1rem; } }
[data-path^='/docs/system/hoon/runes'] .nav-link {
font-family: 'scp'; }
[data-path^='/docs/system/hoon/runes'] .nav-link,
[data-path^='/docs/system/hoon/runes'] .ctrl .selected a.nav-link {
font-weight: 600; }
.app {
vertical-align: top;
font-size: 1.6rem;
@ -313,9 +322,46 @@ img.logo.first {
line-height: 1rem;
margin-bottom: 1rem; } }
.lead h1:first-of-type {
padding-bottom: 0; }
.body[data-path^='/docs'] h1 {
color: #0500F0; }
.body[data-path^='/docs'] h1 code {
background-color: transparent;
color: #0500F0;
padding: 0; }
.body[data-path^='/docs'] .book h2 {
color: #B1B7BD; }
.body[data-path^='/docs'] .book h2 code {
color: #0500F0;
background-color: transparent; }
.body[data-path^='/docs'] .book h2 a {
color: #0500F0; }
.body[data-path^='/docs'] .book hr {
margin-bottom: 3rem; }
.body[data-path^='/docs/system/hoon/runes/'] h1 {
color: #B1B7BD; }
.body[data-path^='/docs/system/hoon/runes/basic'] h1 {
color: #0500F0; }
.body[data-path^='/docs/system/hoon/library/'] h3 {
font-size: 1.5rem; }
.body[data-path^='/docs/system/hoon/library/'] h2 {
font-size: 1rem; }
.body[data-path^='/docs/system/hoon/library/'] .toc h3 {
padding-top: 0;
margin-bottom: 0; }
@keyframes menu-open {
0% {
visibility: hidden; }
@ -406,9 +452,13 @@ img.logo.first {
.menu.open .contents {
top: 3rem; } }
.list h1 {
.list h1,
.list h1:first-of-type {
font-size: inherit;
font-weight: inherit; }
font-weight: inherit;
padding-bottom: 0;
margin-bottom: 0;
line-height: 2rem; }
.list h1.error {
font-size: 1.6rem;
@ -427,10 +477,64 @@ img.logo.first {
font-weight: 500;
height: 2rem; }
.body[data-path^='/docs'] .list.runes {
margin-top: 3rem; }
.body[data-path^='/docs'] .list.runes li {
height: 3rem; }
.body[data-path^='/docs'] .list.runes a h1,
.body[data-path^='/docs'] .list.runes a div,
.body[data-path^='/docs'] .list.runes a p {
display: inline; }
.body[data-path^='/docs'] .list.runes a {
text-decoration: none; }
.body[data-path^='/docs'] .list.runes a,
.body[data-path^='/docs'] .list.runes a h1 code {
color: #000; }
.body[data-path^='/docs'] .list.runes a h1 code {
margin-right: 1rem;
background-color: transparent;
color: #0500F0; }
.body[data-path^='/docs'] .list.runes a code {
background-color: #eceeef; }
.body[data-path^='/docs'] .list.runes a code {
padding: .3rem; }
.body[data-path^='/docs'] .list.runes a:after {
content: "▶";
width: 1rem;
font-size: .6rem;
vertical-align: middle;
padding: .3rem;
padding-top: .4rem;
line-height: 1rem;
margin-left: 1rem;
background-color: #B1B7BD;
color: #fff; }
.body[data-path^='/docs'] .list.runes a:hover:after {
background-color: #0500F0; }
.kids.runes h1 {
padding-top: 3rem; }
.kids.runes h2 {
font-size: 1.5rem;
margin-bottom: 1rem; }
.kids.runes > div {
margin-top: 6rem; }
.kids.runes > hr {
display: none; }
.kids.runes > div p:first-of-type {
font-weight: 500; }
.sections h1 {
font-size: 2rem;
color: #0500F0; }
.sections h1:first-of-type {
padding-bottom: 0; }
.sections li h1 {
font-size: 1.2rem; }
@ -449,6 +553,7 @@ img.logo.first {
display: inline-block;
vertical-align: top;
margin-right: 3rem;
margin-top: 2rem;
min-width: 14rem;
margin-bottom: 3rem; }

View File

@ -275,6 +275,9 @@ module.exports = query({
return $('body').on('click', 'a', function(e) {
var href;
href = $(this).attr('href');
if (href[0] === "#") {
return true;
}
if (href && !/^https?:\/\//i.test(href)) {
e.preventDefault();
if ((href != null ? href[0] : void 0) !== "/") {
@ -301,10 +304,10 @@ module.exports = query({
}
href_parts[0] = next;
if (hist !== false) {
history.pushState({}, "", util.basepath(href_parts.join("")));
history.pushState({}, "", util.basepath(href_parts.join("#")));
}
if (next !== this.props.path) {
React.unmountComponentAtNode($('#body')[0]);
ReactDOM.unmountComponentAtNode($('#body')[0]);
TreeActions.setCurr(next);
return rend(BodyComponent({}, ""), $('#body')[0]);
}
@ -396,15 +399,22 @@ module.exports = function(queries, Child, load) {
}
},
stateFromStore: function() {
var fresh, ref1;
fresh = TreeStore.fulfill(this.getPath(), queries);
var fresh, got, path;
path = this.getPath();
fresh = TreeStore.fulfill(path, queries);
if (!((this.state != null) && path === this.state.path)) {
got = fresh;
} else {
got = this.mergeWith(this.state.got, fresh);
}
return {
path: path,
fresh: fresh,
got: this.mergeWith((ref1 = this.state) != null ? ref1.got : void 0, fresh)
got: got
};
},
mergeWith: function(have, fresh, _queries) {
var got, k, kid, ref1, ref2, ref3, ref4;
var got, k, kid, ref1, ref2, ref3;
if (have == null) {
have = {};
}
@ -424,11 +434,11 @@ module.exports = function(queries, Child, load) {
if (fresh.kids == null) {
got.kids = have.kids;
} else {
got.kids = (ref2 = _.clone(have.kids)) != null ? ref2 : {};
ref3 = fresh.kids;
for (k in ref3) {
kid = ref3[k];
got.kids[k] = this.mergeWith((ref4 = got.kids) != null ? ref4[k] : void 0, kid, _queries.kids);
got.kids = {};
ref2 = fresh.kids;
for (k in ref2) {
kid = ref2[k];
got.kids[k] = this.mergeWith((ref3 = have.kids) != null ? ref3[k] : void 0, kid, _queries.kids);
}
}
}
@ -629,7 +639,7 @@ module.exports = query({
})(this);
containerClas = clas({
"col-md-10": true,
"col-md-offset-2": this.props.meta.anchor !== 'none',
"col-md-offset-3": this.props.meta.anchor !== 'none',
body: true
});
bodyClas = clas((ref1 = this.props.meta.layout) != null ? ref1.split(',') : void 0);
@ -648,6 +658,12 @@ module.exports = query({
}), extra('comments'), extra('footer'))
]);
}
}), recl({
render: function() {
return div({
className: "col-md-offset-3 col-md-10"
}, rele(load));
}
}));
@ -933,7 +949,9 @@ module.exports = recl({
},{"./Reactify.coffee":14}],10:[function(require,module,exports){
var a, div, hr, li, query, reactify, recl, ref, ul;
var a, clas, div, hr, li, query, reactify, recl, ref, ul;
clas = require('classnames');
reactify = require('./Reactify.coffee');
@ -951,11 +969,7 @@ module.exports = query({
}, recl({
displayName: "Kids",
render: function() {
var _k, d, elem, k, keyed, keys, klass, ref1, ref2, ref3, ref4, sorted, str, v;
klass = "kids";
if (this.props.dataType) {
klass += " " + this.props.dataType;
}
var _k, d, elem, k, keyed, keys, ref1, ref2, ref3, ref4, sorted, str, v;
sorted = true;
keyed = {};
ref1 = this.props.kids;
@ -993,8 +1007,12 @@ module.exports = query({
if (this.props.sortBy === 'date') {
keys.reverse();
}
k = clas({
kids: true
}, this.props.className);
return div({
className: klass
className: k,
key: "kids"
}, (function() {
var i, len, ref5, results;
results = [];
@ -1003,7 +1021,8 @@ module.exports = query({
elem = (ref5 = this.props.kids[keyed[k]]) != null ? ref5 : "";
results.push([
div({
key: keyed[k]
key: keyed[k],
id: keyed[k]
}, reactify(elem.body)), hr({})
]);
}
@ -1013,7 +1032,7 @@ module.exports = query({
}));
},{"./Async.coffee":3,"./Reactify.coffee":14}],11:[function(require,module,exports){
},{"./Async.coffee":3,"./Reactify.coffee":14,"classnames":25}],11:[function(require,module,exports){
var a, clas, div, h1, li, pre, query, reactify, recl, ref, span, ul, util;
clas = require('classnames');
@ -1098,6 +1117,12 @@ module.exports = query({
continue;
}
href = util.basepath(path);
if (this.props.linkToFragments != null) {
href = "#" + item;
}
if (this.props.childIsFragment != null) {
href = (util.basepath(this.props.path)) + "#" + item;
}
if (elem.meta.link) {
href = elem.meta.link;
}
@ -1640,9 +1665,14 @@ module.exports = query({
return clearInterval(this.int);
},
collectHeader: function(arg) {
var c, ga, gn;
var c, comp, ga, gn;
gn = arg.gn, ga = arg.ga, c = arg.c;
if (gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN) {
if (this.props.match) {
comp = gn === this.props.match;
} else {
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN;
}
if (comp) {
ga = _.clone(ga);
ga.onClick = this._click(ga.id);
delete ga.id;
@ -1654,24 +1684,28 @@ module.exports = query({
}
},
parseHeaders: function() {
var i, len, ref, ref1, v;
var contents, i, len, ref, ref1, v;
if (this.props.body.c) {
ref = this.props.body.c;
for (i = 0, len = ref.length; i < len; i++) {
v = ref[i];
if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") {
contents = [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))));
if (this.props.noHeader) {
contents.shift();
}
return {
gn: "div",
ga: {
className: "toc"
},
c: [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))))
c: contents
};
}
}
@ -1729,12 +1763,16 @@ $(function() {
},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":7,"./utils/scroll.coffee":23,"./utils/util.coffee":24}],21:[function(require,module,exports){
var dedup, util;
var dedup, pending, util, waspWait;
util = require('../utils/util.coffee');
dedup = {};
pending = {};
waspWait = [];
module.exports = {
refresh: function() {
return dedup = {};
@ -1749,11 +1787,17 @@ module.exports = {
return;
}
dedup[url] = true;
pending[url] = true;
return $.get(url, {}, function(data, status, xhr) {
var dep;
delete pending[url];
dep = urb.getXHRWasp(xhr);
urb.sources[dep] = url;
urb.waspData(dep);
waspWait.push(dep);
if (_.isEmpty(pending)) {
waspWait.map(urb.waspData);
waspWait = [];
}
if (cb) {
return cb(null, data);
}