From 9693f4d8b3293e8773770925badc75c93578d85a Mon Sep 17 00:00:00 2001 From: Arseniy Bushyn Date: Thu, 25 Feb 2016 09:46:29 +0200 Subject: [PATCH] Add table of contents --- css/table_of_contents.css | 70 +++++++++++++++++++++++++++++ index.html | 2 + js/table_of_contents.js | 93 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 css/table_of_contents.css create mode 100644 js/table_of_contents.js diff --git a/css/table_of_contents.css b/css/table_of_contents.css new file mode 100644 index 0000000..8a991bf --- /dev/null +++ b/css/table_of_contents.css @@ -0,0 +1,70 @@ +.toc { + box-sizing: border-box; + display: none; + width: 290px; + height: 100%; + padding: .5em; + position: absolute; + overflow: auto; +} + +.toc-header { + font-size: 1.3em; + margin: 0; + padding: 0; +} + +.toc-link { + direction: ltr; + display: block; + text-decoration: none; + margin: 0 0 .2em; + padding: 0; + line-height: 1.1; + color: inherit; +} + +.toc-link:hover, .toc-link:active, .toc-link.current { + color: #1EAEDB; +} + +.toc-link.h1 { + font-size: 1em; +} + +.toc-link.h2 { + margin-left: .5em; + font-size: .95em; + font-style: italic; +} + +.toc-link.h2::before { + content: '•'; + margin-right: .5em; + text-align: left; +} + +.toc-link.h3 { + margin-left: 1em; + font-size: .9em; +} + +.toc-link.h3::before { + content: '◦'; + margin-right: .5em; + text-align: left; +} + +@media(min-width: 1070px) { + .container { + width: 100%; + max-width: 1050px; + } + .toc { + display: block; + } + .toc + .nine.columns { + margin-left: 350px; + max-width: 700px; + } +} diff --git a/index.html b/index.html index db2ae5a..8287f87 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,7 @@ + @@ -23,6 +24,7 @@ +