Skip to content

Commit 5980821

Browse files
author
Jordan McCullough
committed
Merge pull request #198 from github/fix-dark-ship-collision
Correct dark-ship parallel with current curriculum
2 parents 522f756 + adf363e commit 5980821

31 files changed

+6471
-7734
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "slides/dependencies/snap-svg"]
1414
path = slides/dependencies/snap-svg
1515
url = https://github.com/adobe-webplatform/Snap.svg.git
16+
[submodule "_javascript/jquery-scrollsnap-plugin"]
17+
path = _javascript/jquery-scrollsnap-plugin
18+
url = https://github.com/benoitpointet/jquery-scrollsnap-plugin.git

_includes/dependencies

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<link rel="stylesheet" media="all" href="{{ leadingpath }}/_stylesheets/page.css" />
2+
3+
<link rel="stylesheet" media="screen" href="{{ leadingpath }}/_stylesheets/page.css" type="text/css" />
4+
5+
{% include analytics.html %}
6+
7+
<script src="{{ leadingpath }}/_javascript/jquery-1.11.0.min.js"></script>
8+
<script src="{{ leadingpath }}/_javascript/page.js"></script>
9+
10+
<!-- Latest compiled and minified CSS -->
11+
<link rel="stylesheet" href="{{ leadingpath }}/_javascript/bootstrap/css/bootstrap.min.css">
12+
13+
<!-- Latest compiled and minified JavaScript -->
14+
<script src="{{ leadingpath }}/_javascript/bootstrap/js/bootstrap.min.js"></script>

_includes/slide-section

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
<section class="slide">
3+
<div class="alignment">
4+
{{slide | markdownify}}
5+
</div>
6+
</section>

_javascript/curriculum.js

Lines changed: 11 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ $(function(){
22

33
buildToc();
44

5-
// SnapSVG
6-
// Run once at startup to inject all SVGs
7-
loadAllSvg();
5+
$(document).scrollsnap({
6+
snaps: 'section',
7+
proximity: 250
8+
});
89

910
function buildToc(){
1011
var headings = $("h3"),
@@ -26,85 +27,17 @@ $(function(){
2627

2728
item = $('<li><a href="#' + headingSep + '">' + headings[h].innerHTML + '</a></li>');
2829
toc.append(item);
29-
headings[h].setAttribute("id", headingSep);
30-
$('.curriculum').scrollspy({ target: '#toc' });
31-
}
32-
}
33-
34-
function loadAllSvg(){
35-
var els = document.getElementsByTagName("svg"),
36-
elCount = 0;
37-
38-
for(elCount = 0; elCount < els.length; elCount++){
39-
injectSvg(els[elCount]);
40-
}
41-
}
42-
43-
function injectSvg(canvasTarget){
44-
if(canvasTarget){
45-
Snap.load(
46-
canvasTarget.getAttribute("data-path"),
47-
function (frag) {
48-
sCanvas = Snap("#" + canvasTarget.getAttribute("id"));
49-
fCanvas = Snap();
50-
sCanvas.clear();
30+
// console.log(headings[h].parentElement);
5131

52-
//Determine if grouped build-steps present
53-
var buildStepBase = frag.select("#base");
54-
buildStepGroups = frag.selectAll("[id^=step-]"),
55-
buildStepCount = buildStepGroups.length,
56-
buildStep = 0;
32+
// var hiddenTitle = document.createElement("h3");
33+
// hiddenTitle.setAttribute("id", headingSep);
34+
// console.log(hiddenTitle);
5735

58-
//Setup the container canvas boundary sizing
59-
setCanvasBBox(frag, canvasTarget);
36+
// $(headings[h].parentElement).prepend(hiddenTitle);
6037

61-
// Show the first build step when available
62-
// Otherwise just show entire graphic
63-
if(buildStepCount > 0){
64-
// Include the non-fragment base layout/visuals
65-
fCanvas.append(buildStepBase);
66-
// fCanvas.append(buildStepGroups[buildStep]);
38+
headings[h].parentElement.setAttribute("id", headingSep);
6739

68-
for(; buildStep < buildStepCount; buildStep++){
69-
70-
// Supports fragment in-out transitions by
71-
// wrapping in a group and applying a second
72-
// fragment class
73-
if(buildStepGroups[buildStep].node.id.match(/in-out/)){
74-
var tG = fCanvas.g(buildStepGroups[buildStep]);
75-
buildStepGroups[buildStep].attr("class", "fragment fade-out");
76-
tG.attr("class", "fragment");
77-
fCanvas.append(tG);
78-
}
79-
else{
80-
buildStepGroups[buildStep].attr("class", "fragment");
81-
fCanvas.append(buildStepGroups[buildStep]);
82-
}
83-
}
84-
} else{
85-
//No "steps" to build out, ensure boundary guide
86-
//is not rendered
87-
frag.select("#boundary").remove();
88-
fCanvas.append(frag);
89-
}
90-
91-
sCanvas.append(fCanvas);
92-
}
93-
);
40+
$('.curriculum').scrollspy({ target: '#toc' });
9441
}
9542
}
96-
97-
function setCanvasBBox(canvas, target){
98-
var boundary,
99-
maxWidth,
100-
maxHeight;
101-
102-
boundary = canvas.select("#boundary").select(":first-child").getBBox();
103-
maxWidth = Math.ceil(boundary.width);
104-
maxHeight = Math.ceil(boundary.height);
105-
106-
target.setAttribute("height", (((maxHeight/maxWidth)*100)+"%"));
107-
target.setAttribute("viewBox", "0 0 " + maxWidth + " " + maxHeight);
108-
return canvas;
109-
}
11043
});

_javascript/jquery-scrollsnap-plugin

_layouts/bare.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,7 @@
1717
{% endif %}
1818
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
1919

20-
<link rel="stylesheet" media="all" href="{{ leadingpath }}/_stylesheets/page.css" />
21-
22-
<link rel="stylesheet" media="screen" href="{{ leadingpath }}/_stylesheets/page.css" type="text/css" />
23-
24-
{% include analytics.html %}
25-
26-
<script src="{{ leadingpath }}/_javascript/jquery-1.11.0.min.js"></script>
27-
<script src="{{ leadingpath }}/_javascript/page.js"></script>
28-
29-
<!-- Latest compiled and minified CSS -->
30-
<link rel="stylesheet" href="{{ leadingpath }}/_javascript/bootstrap/css/bootstrap.min.css">
31-
32-
<!-- Latest compiled and minified JavaScript -->
33-
<script src="{{ leadingpath }}/_javascript/bootstrap/js/bootstrap.min.js"></script>
20+
{% include dependencies %}
3421
</head>
3522
<body data-spy="scroll" data-target="#toc">
3623
{% include navigation.html %}

_layouts/curriculum-beta.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
3+
---
4+
5+
6+
<!DOCTYPE html>
7+
<html lang="{% if page.lang %}{{ page.lang }}{% else %}{{ site.lang }}{% endif %}">
8+
<head>
9+
<title>{% if page.title %}{{ page.title }} · {% endif %}{{ site.title }}</title>
10+
{% if page.description %}
11+
<meta name="description" content="{{ page.description }}" />
12+
{% endif %}
13+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
14+
15+
<script src="{{ leadingpath }}/_javascript/jquery-1.11.0.min.js"></script>
16+
<script src="{{ leadingpath }}/_javascript/bootstrap/js/bootstrap.min.js"></script>
17+
<script src="{{ leadingpath }}/_javascript/jquery-scrollsnap-plugin/src/jquery.scrollstop.js"></script>
18+
<script src="{{ leadingpath }}/_javascript/jquery-scrollsnap-plugin/src/jquery.easing.min.js"></script>
19+
<script src="{{ leadingpath }}/_javascript/jquery-scrollsnap-plugin/src/jquery.scrollsnap.js"></script>
20+
21+
<script src="{{ leadingpath }}/_javascript/curriculum.js"></script>
22+
23+
<link rel="stylesheet" href="{{ leadingpath }}/_javascript/bootstrap/css/bootstrap.min.css">
24+
<link rel="stylesheet" href="{{ leadingpath }}/_stylesheets/curriculum-beta.css" type="text/css" />
25+
</head>
26+
<body data-spy="scroll" data-target="#toc">
27+
<div id="toc-wrapper">
28+
<div id="toc" data-spy="affix" data-offset-top="165">
29+
<ul id="toc-list" class="nav" role="tablist"></ul>
30+
</div>
31+
</div>
32+
33+
<div class="curriculum">{{ content }}</div>
34+
35+
<!-- {% include footer.html %} -->
36+
</body>
37+
</html>

_stylesheets/curriculum-beta.css

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/* Imports */
2+
/* Color Definitions */
3+
@import url(octicons.css);
4+
footer {
5+
float: left;
6+
position: relative;
7+
font-size: 12px;
8+
line-height: 1.5;
9+
color: #777;
10+
clear: both;
11+
width: 100%;
12+
height: 40px;
13+
margin: 0 auto 0 auto;
14+
padding: 20px 0 20px 0;
15+
border-top: 1px solid #eee; }
16+
footer ul li {
17+
margin: 0;
18+
padding: 0;
19+
font-size: 12px; }
20+
footer .left {
21+
float: left;
22+
margin: 0; }
23+
footer .right {
24+
float: right;
25+
margin: 0; }
26+
footer .octicon-mark-github {
27+
position: absolute;
28+
left: 50%;
29+
color: #ccc;
30+
height: 24px;
31+
width: 24px;
32+
margin-left: -12px;
33+
font-size: 24px;
34+
line-height: 1; }
35+
footer a {
36+
color: #1875c6;
37+
text-decoration: none; }
38+
39+
ul.site-footer-links {
40+
padding: 0 10px; }
41+
ul.site-footer-links li {
42+
display: inline-block;
43+
margin-left: 5px; }
44+
ul.site-footer-links li:first-child {
45+
margin-left: 0; }
46+
47+
@media screen and (max-width: 568px) {
48+
ul.site-footer-links {
49+
display: none; } }
50+
html, body {
51+
height: 100%;
52+
background: #f4f4f4;
53+
font-size: 16px; }
54+
55+
.nav-list > li > a {
56+
font-size: 8pt; }
57+
58+
.curriculum {
59+
height: 100%;
60+
width: 100%;
61+
/* General external link */
62+
/* GitHub Links */
63+
/* GitHub Book Links, Guide Links */
64+
/* YouTube Links */ }
65+
.curriculum h1, .curriculum h2, .curriculum h3, .curriculum h4, .curriculum h5, .curriculum h6, .curriculum p, .curriculum ul, .curriculum pre, .curriculum svg {
66+
font-weight: normal;
67+
padding: 0 30%; }
68+
.curriculum h3 {
69+
font-size: 400%;
70+
line-height: 1.25em;
71+
margin-bottom: .5em; }
72+
.curriculum h4 {
73+
font-size: 250%;
74+
margin-bottom: .5em; }
75+
.curriculum p {
76+
line-height: 1.75em;
77+
margin: 2em 0; }
78+
.curriculum ul {
79+
display: inline-block;
80+
text-align: left; }
81+
.curriculum .diagram {
82+
width: 60%;
83+
/*margin: 0 auto;*/
84+
text-align: center; }
85+
.curriculum .slide {
86+
min-height: 100%;
87+
width: 100%;
88+
background: #ffffff;
89+
display: table;
90+
text-align: center; }
91+
.curriculum .slide h1, .curriculum .slide h2, .curriculum .slide h3, .curriculum .slide h4, .curriculum .slide h5, .curriculum .slide h6, .curriculum .slide p, .curriculum .slide ul, .curriculum .slide pre, .curriculum .slide svg {
92+
font-weight: normal;
93+
padding: 0 0; }
94+
.curriculum .slide .alignment {
95+
padding: 0 20%;
96+
display: table-cell;
97+
vertical-align: middle; }
98+
.curriculum a[href^="http://"],
99+
.curriculum a[href^="https://"] {
100+
font: normal normal 1em octicons;
101+
text-decoration: none;
102+
color: #1875c6; }
103+
.curriculum a[href^="http://"]:after,
104+
.curriculum a[href^="https://"]:after {
105+
content: "\f0b6";
106+
margin-left: 5px; }
107+
.curriculum a[href^="https://github.com"],
108+
.curriculum a[href^="https://www.github.com"],
109+
.curriculum a[href^="https://help.github.com"] {
110+
font: normal normal 1em octicons;
111+
text-decoration: none;
112+
color: #1875c6; }
113+
.curriculum a[href^="https://github.com"]:after,
114+
.curriculum a[href^="https://www.github.com"]:after,
115+
.curriculum a[href^="https://help.github.com"]:after {
116+
content: "\f008";
117+
margin-left: 5px; }
118+
.curriculum a[href^="http://git-scm.com/book"],
119+
.curriculum a[href^="https://guides.github.com"] {
120+
font: normal normal 1em octicons;
121+
text-decoration: none;
122+
color: #1875c6; }
123+
.curriculum a[href^="http://git-scm.com/book"]:after,
124+
.curriculum a[href^="https://guides.github.com"]:after {
125+
content: "\f007";
126+
margin-left: 5px; }
127+
.curriculum a[href^="https://youtube.com"],
128+
.curriculum a[href^="https://www.youtube.com"] {
129+
font: normal normal 1em octicons;
130+
text-decoration: none;
131+
color: #1875c6; }
132+
.curriculum a[href^="https://youtube.com"]:after,
133+
.curriculum a[href^="https://www.youtube.com"]:after {
134+
content: "\f0b9";
135+
margin-left: 5px; }
136+
.curriculum .summary h2:before, .curriculum .outline h2:before, .curriculum .details h2:before {
137+
padding: 5px;
138+
color: #CCCCCC;
139+
content: "\f078";
140+
font: normal normal 20px octicons; }
141+
.curriculum pre {
142+
padding: 10px auto;
143+
margin: 1em auto 2em;
144+
width: auto;
145+
/* To ensure scrolling of long code lines */
146+
overflow: auto;
147+
word-wrap: normal;
148+
white-space: pre; }
149+
.curriculum pre:before {
150+
content: "\f0c8";
151+
font: normal normal 22px octicons;
152+
float: right;
153+
opacity: .4; }
154+
155+
#toc-wrapper {
156+
position: fixed;
157+
right: 0;
158+
width: 15%;
159+
z-index: 10000; }
160+
161+
#toc .active {
162+
font-weight: 700; }
163+
#toc .active a {
164+
color: #222222; }

0 commit comments

Comments
 (0)