-
Notifications
You must be signed in to change notification settings - Fork 0
/
studies.html
126 lines (117 loc) · 3.95 KB
/
studies.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
/*global $*/
const topics = [ 'variables', 'datatypes', 'string-manipulation', 'operators', 'control-flow', 'loops', 'functions' ];
const topicElements = topics.forEach(function(topic, index) {
const $header = $('<h2>').addClass('topic-heading').text(topic);
const $div = $('<div>').addClass('code').attr('id', topic).append($header);
$.get(`studies/${topic}.js`, function (response) {
const split = response.split('\n');
const $splitElements = split.map(function(line, index) {
const $line = $('<div>').addClass('line');
const $lineNumber = $('<div>').addClass('line-number').text(index);
const $content = $('<div>').addClass('line-content').text(line);
return $line.append($lineNumber, $content);
});
$div.append($splitElements);
$div.appendTo('.content');
}, 'text'); // 'text' makes sure the JS file isn't executed
});
</script>
<link rel="stylesheet" href="css/studies.css" type="text/css" />
<title>Studies</title>
<style type="text/css">
body {
background: rgb(125, 198, 205);
color: rgb(45, 45, 45);
padding: 10px;
font-family: arial;
}
header {
font-size: 1.5em;
font-weight: bold;
}
h1 {
margin: 10px;
}
#all-contents {
max-width: 800px;
margin: auto;
}
/* navigation menu */
nav {
background: rgb(239, 80, 41);
margin: 0 auto;
margin-bottom: 20px;
display: flex;
padding: 10px;
border-radius: 15px;
}
nav header {
display: flex;
align-items: center;
color: rgb(255, 255, 255);
flex: 1;
}
nav ul {
list-style-image: none;
}
nav li {
display: inline-block;
padding: 0 10px;
}
nav a {
text-decoration: none;
color: #fff;
}
/* main container area beneath menu */
main {
background: rgb(245, 238, 219);
display: flex;
border-radius: 15px;
}
.content {
flex: 1;
padding: 15px;
}
/* portfolio styles */
#portfolio {
list-style-type: none;
padding-left: 0;
}
#portfolio li {
background: #fff;
padding: 10px;
border-radius: 10px;
margin-bottom: 10px;
}
#portfolio li:hover {
background: #eee;
}
#portfolio a {
text-decoration: none;
color: #454545;
}
</style>
</head>
<body>
<div id="all-contents">
<nav>
<header>Dow's Studies</header>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="studies.html">Studies</a></li>
</ul>
</nav>
<main>
<div class="content">
<h1>Javascript</h1>
</div>
</main>
</div>
</body>
</html>