Skip to content

Commit 0fc59b4

Browse files
authored
Merge pull request #253 from HarvardOpenData/kh-scrollytelling-schema
Scrollytelling Implementation
2 parents e53e242 + b7179af commit 0fc59b4

File tree

10 files changed

+607
-323
lines changed

10 files changed

+607
-323
lines changed

package-lock.json

Lines changed: 71 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"prettier": "^2.3.0",
4848
"react": "^16.14.0",
4949
"react-icons": "^3.11.0",
50+
"react-scrollama": "^2.2.16",
5051
"react-social-icons": "^4.1.0",
5152
"save": "^2.4.0"
5253
}

studio/schemas/blockContent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,8 @@ export default {
128128
{
129129
type: "iframe",
130130
},
131+
{
132+
type: "scrollytellingComponent",
133+
},
131134
],
132135
};

studio/schemas/schemas.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import preview from "./preview";
2626
import project from "./project";
2727
import projectMember from "./projectMember";
2828
import redirect from "./redirect";
29+
import scrollytellingBlock from "./scrollytellingBlock";
30+
import scrollytellingComponent from "./scrollytellingComponent";
2931
import shortForm from "./shortForm";
3032
import siteSettings from "./siteSettings";
3133
import slideshow from "./slideshow";
@@ -63,6 +65,8 @@ export default createSchema({
6365
project,
6466
projectMember,
6567
redirect,
68+
scrollytellingBlock,
69+
scrollytellingComponent,
6670
shortForm,
6771
siteSettings,
6872
slideshow,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export default {
2+
name: "scrollytellingBlock",
3+
title: "Scrollytelling Block",
4+
type: "object",
5+
description: "Scrollytelling Block to be used Scrollytelling Component",
6+
preview: {
7+
select: {
8+
media: 'graphic',
9+
},
10+
},
11+
fields: [
12+
{
13+
name: "graphic",
14+
title: "Graphic",
15+
description: "Array of contents blocks and associated images",
16+
type: "figure",
17+
options: {
18+
isHighlighted: true,
19+
},
20+
},
21+
{
22+
name: "textContent",
23+
title: "Text Content",
24+
description: "Array of contents blocks and associated images",
25+
type: 'blockContent',
26+
options: {
27+
isHighlighted: true,
28+
},
29+
},
30+
],
31+
};
32+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export default {
2+
title: "Scrollytelling Component",
3+
name: "scrollytellingComponent",
4+
type: "object",
5+
description: "Scrollytelling Component to be used inside articles",
6+
preview: {
7+
select: {
8+
blocks: 'scrollyTellingBlocks',
9+
},
10+
prepare(selection) {
11+
const {blocks} = selection;
12+
return {
13+
subtitle: `There are ${blocks.length} Scrollytelling Blocks`,
14+
};
15+
},
16+
},
17+
fields: [
18+
{
19+
name: "scrollyTellingBlocks",
20+
title: "Scrollytelling Blocks",
21+
description: "Array of Scrollytelling blocks",
22+
type: "array",
23+
of: [{type: "scrollytellingBlock"}],
24+
options: {
25+
isHighlighted: true,
26+
},
27+
},
28+
],
29+
};
30+

0 commit comments

Comments
 (0)