Skip to content

Commit ed4c45e

Browse files
committed
styles: update panels, add semantic HTML
1 parent ab3ca00 commit ed4c45e

File tree

4 files changed

+72
-48
lines changed

4 files changed

+72
-48
lines changed

src/data.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/**
2+
* The left hand values and their assosiated links and images
3+
*/
14
export const definitions = [
2-
//Items displayed in a bullet point style must be inluded in the bullet point property
35
{
46
title: "variables",
57
text: "Variables can be denoted with the keywords let or const. The accepted convention is to use const as much as possible, and let when the variable is likely to be re-assigned",

src/index.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
<title>Javascript in 30 Words</title>
99
</head>
10+
1011
<body>
11-
<div class="flex-container">
12-
<ul class="list-container">
13-
<h2 class="subtitles">Fundamentals</h2>
12+
<main class="main">
13+
<section class="section-left">
14+
<ul>
15+
<h2 class="section-left-subtitle">Fundamentals</h2>
1416
<li id="variables">Variables</li>
1517
<li id="functions">Functions</li>
1618
<li id="functional-expressions">Functional Expressions</li>
@@ -27,7 +29,7 @@ <h2 class="subtitles">Fundamentals</h2>
2729
<li id="classes">Classes (ES6)</li>
2830
<li id="scope">Scope</li>
2931
<br></br>
30-
<h2 class="subtitles"class="subtitles">Advanced</h2>
32+
<h2 class="section-left-subtitle">Advanced</h2>
3133
<li id="the-call-stack">The Call Stack</li>
3234
<li id="event-loop">The Event Loop</li>
3335
<li id="IIFEs">IIFEs</li>
@@ -49,8 +51,9 @@ <h2 class="subtitles"class="subtitles">Advanced</h2>
4951
<li id="prototypal-inheritance">Prototypal Inheritance</li>
5052
<li id="polymorphism">Polymorphism</li>
5153
</ul>
52-
<div id="display-container">A refresher on Javascript concepts in less than 30 words. This is an open source project. Contributions are welcome via <a target ="_blank" href="https://github.com/msmfa/javascript-in-30">Github</a></div>
53-
</div>
54+
</section>
55+
<section class="section-right">A refresher on Javascript concepts in less than 30 words. This is an open source project. Contributions are welcome via <a target ="_blank" href="https://github.com/msmfa/javascript-in-30">Github</a></section>
56+
</main>
5457
<script type="module" src="main.js"></script>
5558
</body>
5659
</html>

src/main.css

Lines changed: 54 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
/* global styles */
2+
13
* {
24
margin: 0;
35
padding: 0;
46
font-family: "San Francisco";
7+
box-sizing: border-box;
58
}
69

710
@font-face {
@@ -10,23 +13,67 @@
1013
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff");
1114
}
1215

16+
html,
17+
body {
18+
height: 100%;
19+
}
20+
1321
ul li {
1422
list-style-type: none;
1523
color: rgb(63, 63, 63);
1624
}
25+
26+
a {
27+
color: rgb(240, 158, 8);
28+
text-decoration: none;
29+
}
30+
31+
/* main app */
32+
33+
.main {
34+
display: flex;
35+
align-items: center;
36+
height: 100%;
37+
}
38+
39+
.section-left {
40+
flex: 1;
41+
padding: 30px;
42+
background-color: rgb(215, 215, 215);
43+
height: 100%;
44+
}
45+
46+
.section-left-subtitle {
47+
color: rgb(61, 61, 61);
48+
margin-bottom: 10px;
49+
}
50+
51+
.section-left li:hover {
52+
color: rgb(101, 180, 226);
53+
cursor: pointer;
54+
}
55+
56+
.section-right {
57+
flex: 2;
58+
display: flex;
59+
flex-direction: column;
60+
align-items: center;
61+
justify-content: center;
62+
text-align: center;
63+
padding: 30px;
64+
height: 100%;
65+
}
66+
1767
.list {
1868
list-style-type: none;
1969
padding: 0.3em;
2070
font-size: 0.8em;
2171
}
22-
.list-container li:hover {
23-
color: rgb(101, 180, 226);
24-
cursor: pointer;
25-
}
2672

2773
.def-text {
2874
margin: 0.8em 5em;
2975
}
76+
3077
.images {
3178
width: 80%;
3279
border-radius: 3px;
@@ -36,39 +83,6 @@ ul li {
3683
box-shadow: 6px 10px 11px 3px rgba(199, 199, 199, 1);
3784
}
3885

39-
#display-container {
40-
font-size: 1.4em;
41-
text-align: center;
42-
width: 62vw;
43-
margin-top: -2em;
44-
position: fixed;
45-
margin-left: 33vw;
46-
padding: 1em;
47-
}
48-
49-
#display-container a {
50-
color: rgb(240, 158, 8);
51-
text-decoration: none;
52-
}
53-
54-
.flex-container {
55-
display: flex;
56-
align-items: center;
57-
}
58-
59-
.list-container {
60-
border-right: 1px solid rgb(202, 202, 202);
61-
background-color: rgb(243, 243, 243);
62-
padding: 1rem;
63-
width: 30vw;
64-
font-size: 0.85em;
65-
}
66-
67-
.subtitles {
68-
color: rgb(61, 61, 61);
69-
margin-bottom: 0.3rem;
70-
}
71-
7286
@media only screen and (max-width: 875px) {
7387
.def-text {
7488
margin: 0.8em 1em;
@@ -77,4 +91,7 @@ ul li {
7791
width: 95%;
7892
height: 20%;
7993
}
94+
.section-left {
95+
padding: 10px;
96+
}
8097
}

src/main.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { definitions } from "./data.js";
22

3-
const listContainer = document.querySelector(".list-container");
3+
// the left hand side panel that contains the list of
4+
// links to be clicked
5+
const sectionLeft = document.querySelector(".section-left");
46

5-
listContainer.addEventListener("click", function (e) {
6-
const display = document.getElementById("display-container");
7+
sectionLeft.addEventListener("click", function (e) {
8+
const sectionRight = document.querySelector(".section-right");
79

810
const mainText = definitions
911
.map((item) => {
@@ -25,7 +27,7 @@ listContainer.addEventListener("click", function (e) {
2527
.join("");
2628

2729
const bulletPointText = displayTextAsList(listText);
28-
displayContent(display, mainText, bulletPointText, exampleImage);
30+
displayContent(sectionRight, mainText, bulletPointText, exampleImage);
2931
});
3032

3133
function displayContent(display, mainText, bulletPointText, exampleImage) {

0 commit comments

Comments
 (0)