Skip to content

Commit c22323b

Browse files
author
jordanmccullough
committed
Revert "Revert "Slide-like cover + all curriculum resources layout beta""
This reverts commit a0117ad.
1 parent 522f756 commit c22323b

32 files changed

+6428
-7801
lines changed

.gitmodules

+3
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

+14
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

+6
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

+11-78
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

+1-14
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

+37
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>

_layouts/curriculum.html

+41-19
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,53 @@
11
---
2-
layout: bare
2+
33
---
44

5-
<script src="../_javascript/snap-svg/dist/snap.svg-min.js"></script>
6-
<script src="../_javascript/curriculum.js"></script>
75

8-
<section class="hero overview">
9-
<div class="container">
10-
<div class="content">
11-
<h2>{{ page.title }}</h2>
12-
<p>{{ page.description }}</p>
13-
</div>
14-
</div>
15-
</section>
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+
{% include dependencies %}
1616

17-
<div class="container curriculum">
18-
<div class="two-thirds markdown-content">
19-
{{ content }}
20-
</div>
2117

22-
<div class="third">
18+
<script src="../_javascript/snap-svg/dist/snap.svg-min.js"></script>
19+
<script src="../_javascript/curriculum.js"></script>
20+
</head>
21+
<body data-spy="scroll" data-target="#toc">
22+
{% include navigation.html %}
23+
<section class="hero overview">
24+
<div class="container">
25+
<div class="content">
26+
<h2>{{ page.title }}</h2>
27+
<p>{{ page.description }}</p>
28+
</div>
29+
</div>
30+
</section>
31+
2332
<div id="toc-wrapper">
2433
<div id="toc" data-spy="affix" data-offset-top="165">
2534
<ul id="toc-list" class="nav" role="tablist"></ul>
2635
</div>
2736
</div>
28-
</div>
29-
</div>
37+
38+
<div class="curriculum">
39+
<!-- <div class="two-thirds"> -->
40+
{{ content }}
41+
<!-- </div> -->
42+
</div>
43+
44+
<!-- {% include footer.html %} -->
45+
46+
47+
</body>
48+
</html>
49+
50+
51+
52+
3053

31-
{% include footer.html %}

0 commit comments

Comments
 (0)