Skip to content

Commit 6545822

Browse files
committed
Make the TOC appear to the left of the cover when screen is wide enough
(On the HTML front page)
1 parent e8950c1 commit 6545822

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

html/index.html

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@
44
<meta name="viewport" content="width=device-width, initial-scale=1">
55
<title>Eloquent JavaScript</title>
66
<link rel=stylesheet href="css/ejs.css">
7+
<style>
8+
article { display: flex; margin: 0 2em; flex-wrap: wrap; max-width: none; }
9+
#cover { flex-basis: 480px; max-width: 35em; flex-grow: 1; margin-right: 3em; }
10+
#contents { flex-basis: 500px; position: relative; }
11+
#links { flex-basis: 500px; max-width: 35em; flex-grow: 1; }
12+
li.contents-intro:before { display: none; }
13+
.toc h3 { position: absolute; margin: 0; top: -2px; right: 0; font-family: inherit; font-weight: normal; font-size: 90%; }
14+
@media screen and (max-width: 500px) { .toc h3 { display: none } }
15+
ul.links { list-style-type: circle; }
16+
img.logo { vertical-align: text-top; padding: 0px 4px; border: 0; }
17+
</style>
718
</head>
819

920
<article>
21+
<div id=cover>
22+
1023
<h1>Eloquent JavaScript<div style="font-size: 70%">3rd edition</div></h2>
1124

1225
<p>This is a book about JavaScript, programming, and the wonders of
@@ -15,7 +28,7 @@ <h1>Eloquent JavaScript<div style="font-size: 70%">3rd edition</div></h2>
1528
copy</a> of the <em>second</em> edition. A paper third edition is
1629
being worked on, but it isn't clear yet when it'll be available.</p>
1730

18-
<p style="text-align: center; margin: 3em 0 2.5em">
31+
<p style="text-align: center; margin: 2em 0">
1932
<img src="img/cover.jpg" alt="Cover image" style="border: 1px solid black; max-width: 100%; box-shadow: 4px 4px 7px rgba(0, 0, 0, 0.4)">
2033
</p>
2134

@@ -50,15 +63,11 @@ <h1>Eloquent JavaScript<div style="font-size: 70%">3rd edition</div></h2>
5063
alt="Ghostery" class=logo></a>.</p>
5164
</div>
5265

53-
<h2>Contents</h2>
66+
</div>
5467

55-
<style>
56-
li.contents-intro:before { display: none; }
57-
.toc h3 { position: absolute; margin: 0; top: -2px; right: 0; font-family: inherit; font-weight: normal; font-size: 90%; }
58-
@media screen and (max-width: 500px) { .toc h3 { display: none } }
59-
ul.links { list-style-type: circle; }
60-
img.logo { vertical-align: text-top; padding: 0px 4px; border: 0; }
61-
</style>
68+
<div id=contents>
69+
70+
<h2>Contents</h2>
6271

6372
<ol class=toc>
6473
<li class="contents-intro"><a href="00_intro.html">Introduction</a>
@@ -94,6 +103,10 @@ <h3>(Part 3: Node)</h3>
94103
<li><a href="21_skillsharing.html">Project: Skill-Sharing Website</a>
95104
</ol>
96105

106+
</div>
107+
108+
<div id=links>
109+
97110
<p>A paper version of Eloquent JavaScript, including an additional
98111
chapter, is being brought out
99112
by <a href="http://www.nostarch.com/ejs2">No Starch Press</a>. The
@@ -121,4 +134,5 @@ <h2>Translations of the second edition</h2>
121134
<li><a href="https://karmazzin.gitbooks.io/eloquentjavascript_ru/content/">Русский (Russian)</a></li>
122135
</ul>
123136

137+
</div>
124138
</article>

0 commit comments

Comments
 (0)