Commit 085dc1da authored by David Rhoderick's avatar David Rhoderick
Browse files

Adding hours to website as per MVM-201 and fixing

deployment
parent 9f86de64
......@@ -3,8 +3,8 @@ const settings = {
state: {
frontity: {
url: 'https://mvmuseum.org',
title: 'Test Frontity Blog',
description: 'WordPress installation for Frontity development'
title: 'Martha’s Vineyard Museum',
description: 'The historical epicenter of the island of Marth’s Vineyard.'
}
},
packages: [
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var surrogate_pairs_1 = require("./surrogate-pairs");
var HTML_ALPHA = ['apos', 'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'AElig', 'Ccedil', 'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml', 'quot', 'amp', 'lt', 'gt', 'OElig', 'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde', 'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm', 'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo', 'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil', 'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym', 'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime', 'oline', 'frasl', 'weierp', 'image', 'real', 'trade', 'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr', 'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr', 'forall', 'part', 'exist', 'empty', 'nabla', 'isin', 'notin', 'ni', 'prod', 'sum', 'minus', 'lowast', 'radic', 'prop', 'infin', 'ang', 'and', 'or', 'cap', 'cup', 'int', 'there4', 'sim', 'cong', 'asymp', 'ne', 'equiv', 'le', 'ge', 'sub', 'sup', 'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp', 'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang', 'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams'];
var HTML_CODES = [39, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 34, 38, 60, 62, 338, 339, 352, 353, 376, 710, 732, 8194, 8195, 8201, 8204, 8205, 8206, 8207, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8240, 8249, 8250, 8364, 402, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 977, 978, 982, 8226, 8230, 8242, 8243, 8254, 8260, 8472, 8465, 8476, 8482, 8501, 8592, 8593, 8594, 8595, 8596, 8629, 8656, 8657, 8658, 8659, 8660, 8704, 8706, 8707, 8709, 8711, 8712, 8713, 8715, 8719, 8721, 8722, 8727, 8730, 8733, 8734, 8736, 8743, 8744, 8745, 8746, 8747, 8756, 8764, 8773, 8776, 8800, 8801, 8804, 8805, 8834, 8835, 8836, 8838, 8839, 8853, 8855, 8869, 8901, 8968, 8969, 8970, 8971, 9001, 9002, 9674, 9824, 9827, 9829, 9830];
var alphaIndex = {};
......@@ -28,8 +29,13 @@ var Html4Entities = /** @class */ (function () {
var code = entity.charAt(1).toLowerCase() === 'x' ?
parseInt(entity.substr(2), 16) :
parseInt(entity.substr(1));
if (!(isNaN(code) || code < -32768 || code > 65535)) {
chr = String.fromCharCode(code);
if (!isNaN(code) || code >= -32768) {
if (code <= 65535) {
chr = String.fromCharCode(code);
}
else {
chr = surrogate_pairs_1.fromCodePoint(code);
}
}
}
else {
......@@ -72,7 +78,13 @@ var Html4Entities = /** @class */ (function () {
result += "&" + alpha + ";";
}
else if (cc < 32 || cc > 126) {
result += "&#" + cc + ";";
if (cc >= surrogate_pairs_1.highSurrogateFrom && cc <= surrogate_pairs_1.highSurrogateTo) {
result += '&#' + surrogate_pairs_1.getCodePoint(str, i) + ';';
i++;
}
else {
result += '&#' + cc + ';';
}
}
else {
result += str.charAt(i);
......@@ -97,7 +109,13 @@ var Html4Entities = /** @class */ (function () {
result += str[i++];
continue;
}
result += '&#' + c + ';';
if (c >= surrogate_pairs_1.highSurrogateFrom && c <= surrogate_pairs_1.highSurrogateTo) {
result += '&#' + surrogate_pairs_1.getCodePoint(str, i) + ';';
i++;
}
else {
result += '&#' + c + ';';
}
i++;
}
return result;
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var surrogate_pairs_1 = require("./surrogate-pairs");
var ALPHA_INDEX = {
'&lt': '<',
'&gt': '>',
......@@ -49,10 +50,15 @@ var XmlEntities = /** @class */ (function () {
var code = s.charAt(2).toLowerCase() === 'x' ?
parseInt(s.substr(3), 16) :
parseInt(s.substr(2));
if (isNaN(code) || code < -32768 || code > 65535) {
return '';
if (!isNaN(code) || code >= -32768) {
if (code <= 65535) {
return String.fromCharCode(code);
}
else {
return surrogate_pairs_1.fromCodePoint(code);
}
}
return String.fromCharCode(code);
return '';
}
return ALPHA_INDEX[s] || s;
});
......@@ -76,7 +82,13 @@ var XmlEntities = /** @class */ (function () {
continue;
}
if (c < 32 || c > 126) {
result += '&#' + c + ';';
if (c >= surrogate_pairs_1.highSurrogateFrom && c <= surrogate_pairs_1.highSurrogateTo) {
result += '&#' + surrogate_pairs_1.getCodePoint(str, i) + ';';
i++;
}
else {
result += '&#' + c + ';';
}
}
else {
result += str.charAt(i);
......@@ -101,7 +113,13 @@ var XmlEntities = /** @class */ (function () {
result += str[i++];
continue;
}
result += '&#' + c + ';';
if (c >= surrogate_pairs_1.highSurrogateFrom && c <= surrogate_pairs_1.highSurrogateTo) {
result += '&#' + surrogate_pairs_1.getCodePoint(str, i) + ';';
i++;
}
else {
result += '&#' + c + ';';
}
i++;
}
return result;
......
{
"_from": "html-entities@^1.2.0",
"_id": "html-entities@1.3.3",
"_id": "html-entities@1.4.0",
"_inBundle": false,
"_integrity": "sha512-/VulV3SYni1taM7a4RMdceqzJWR39gpZHjBwUnsCFKWV/GJkD14CJ5F7eWcZozmHJK0/f/H5U3b3SiPkuvxMgg==",
"_integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==",
"_location": "/html-entities",
"_phantomChildren": {},
"_requested": {
......@@ -18,8 +18,8 @@
"_requiredBy": [
"/webpack-hot-middleware"
],
"_resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.3.tgz",
"_shasum": "3dca638a43ee7de316fc23067398491152ad4736",
"_resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz",
"_shasum": "cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc",
"_spec": "html-entities@^1.2.0",
"_where": "/home/davidrhoderick/Development/mvm/mvm-frontity/node_modules/webpack-hot-middleware",
"author": {
......@@ -34,9 +34,11 @@
"deprecated": false,
"description": "Faster HTML entities encode/decode library.",
"devDependencies": {
"@types/benchmark": "^2.1.0",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
"@types/node": "^13.13.4",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"coveralls": "^3.1.0",
"entities": "^2.0.0",
......@@ -76,5 +78,5 @@
},
"types": "./lib/index.d.ts",
"typings": "./lib/index.d.ts",
"version": "1.3.3"
"version": "1.4.0"
}
......@@ -3883,9 +3883,9 @@
"integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ=="
},
"html-entities": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.3.tgz",
"integrity": "sha512-/VulV3SYni1taM7a4RMdceqzJWR39gpZHjBwUnsCFKWV/GJkD14CJ5F7eWcZozmHJK0/f/H5U3b3SiPkuvxMgg=="
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz",
"integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA=="
},
"htmlescape": {
"version": "1.1.1",
......@@ -4740,9 +4740,14 @@
"mvmuseum-theme": {
"version": "file:packages/mvmuseum-theme",
"requires": {
"@fortawesome/fontawesome-svg-core": "^1.2.32",
"@fortawesome/free-brands-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@fortawesome/react-fontawesome": "^0.1.13",
"frontity": "^1.13.0",
"global": "^4.4.0",
"react-loader-spinner": "^3.1.14",
"react-scroll-parallax": "^2.3.5",
"react-slick": "^0.27.13",
"slick-carousel": "^1.8.1"
},
......@@ -4924,6 +4929,43 @@
"resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz",
"integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA=="
},
"@fortawesome/fontawesome-common-types": {
"version": "0.2.32",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.32.tgz",
"integrity": "sha512-ux2EDjKMpcdHBVLi/eWZynnPxs0BtFVXJkgHIxXRl+9ZFaHPvYamAfCzeeQFqHRjuJtX90wVnMRaMQAAlctz3w=="
},
"@fortawesome/fontawesome-svg-core": {
"version": "1.2.32",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.32.tgz",
"integrity": "sha512-XjqyeLCsR/c/usUpdWcOdVtWFVjPbDFBTQkn2fQRrWhhUoxriQohO2RWDxLyUM8XpD+Zzg5xwJ8gqTYGDLeGaQ==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.32"
}
},
"@fortawesome/free-brands-svg-icons": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.15.1.tgz",
"integrity": "sha512-pkTZIWn7iuliCCgV+huDfZmZb2UjslalXGDA2PcqOVUYJmYL11y6ooFiMJkJvUZu+xgAc1gZgQe+Px12mZF0CA==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.32"
}
},
"@fortawesome/free-solid-svg-icons": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.1.tgz",
"integrity": "sha512-EFMuKtzRMNbvjab/SvJBaOOpaqJfdSap/Nl6hst7CgrJxwfORR1drdTV6q1Ib/JVzq4xObdTDcT6sqTaXMqfdg==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.32"
}
},
"@fortawesome/react-fontawesome": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.13.tgz",
"integrity": "sha512-/HrLnIft5Ks2511Pz6TxHBIctC9QalVscAC64sufQ4sJH/sXaQlG3uR9LCu6VpEwkBemgcBLrz/QPNP/ddbjDg==",
"requires": {
"prop-types": "^15.7.2"
}
},
"@frontity/error": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@frontity/error/-/error-0.1.1.tgz",
......@@ -5932,6 +5974,14 @@
"prop-types": "^15.7.2"
}
},
"react-scroll-parallax": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/react-scroll-parallax/-/react-scroll-parallax-2.3.5.tgz",
"integrity": "sha512-+bcye104p4rKZoilT7243gQyLgiKjLTFVtUketp7t6V6Fd6/TrOAeuTtjUfy+nQE92JumG2jQtw6/9bY5YhPrg==",
"requires": {
"prop-types": "^15.5.10"
}
},
"react-slick": {
"version": "0.27.13",
"resolved": "https://registry.npmjs.org/react-slick/-/react-slick-0.27.13.tgz",
......
import React, {children, useState, useEffect} from 'react'
import {connect, styled} from 'frontity'
const Container = ({state, children, className}) => {
return (
<StyledContainer className={className}>
{children}
</StyledContainer>
)
}
export default connect(Container)
const StyledContainer = styled.div`
margin: 0 auto;
width: 992px;
`
\ No newline at end of file
import React from 'react'
import {styled, connect} from 'frontity'
import Container from './container'
const Footer = ({state}) => {
console.log('loaded yo')
return (
<footer>Footer</footer>
<StyledFooter>
<Container>
&copy; {new Date().getFullYear()} Martha's Vineyard Museum
</Container>
</StyledFooter>
)
}
export default connect(Footer)
\ No newline at end of file
export default connect(Footer)
const StyledFooter = styled.footer`
position: relative;
z-index: 1;
background: white;
text-align: center;
`
\ No newline at end of file
......@@ -3,15 +3,20 @@ import {connect} from 'frontity'
import Switch from '@frontity/components/switch'
import HeroSlideshow from './home/hero-slideshow'
import Hours from './home/hours'
const Home = ({state}) => {
const data = state.source.get(state.router.link)
const post = state.source[data.type][data.id]
console.log(post.acf.hours)
return (
<>
<HeroSlideshow heroSlideshow={post.acf.hero_slideshow} />
<Hours hours={post.acf.hours} />
{/* {post.acf.content.map((section, index) =>
<Switch key={index}>
......
......@@ -7,7 +7,7 @@ import {faAngleDown} from '@fortawesome/free-solid-svg-icons'
import Link from '../partials/link'
const HeroSlideshow = ({heroSlideshow, state, libraries}) => {
const HeroSlideshow = ({heroSlideshow, state}) => {
const [activeSlide, setActiveSlide] = useState(0)
useEffect(() => {
......@@ -23,27 +23,27 @@ const HeroSlideshow = ({heroSlideshow, state, libraries}) => {
<Slideshow>
{heroSlideshow.map(({image, title, link}, index) => {
console.log(link)
return(<>
<Parallax y={[200, -200]} key={index}>
<SlideImage src={image.sizes.large} activeSlide={index === activeSlide} previousSlide={index === activeSlide - 1} />
<ScrollDownContainer>
<ScrollDown theme={state.theme}>
<FontAwesomeIcon icon={faAngleDown} />
<FontAwesomeIcon icon={faAngleDown} />
<FontAwesomeIcon icon={faAngleDown} />
</ScrollDown>
</ScrollDownContainer>
</Parallax>
return(<div key={index}>
{/* <Parallax y={[200, -200]} styleInner={{background: state.theme.colors.white}}> */}
<SlideImage image={image.sizes.large} activeSlide={index === activeSlide} previousSlide={index === activeSlide - 1} />
{/* </Parallax> */}
<TextContainer theme={state.theme}>
<h1>{title}</h1>
<Link link={link.url}>{link.title}</Link>
</TextContainer>
</>);
</div>);
})}
</Slideshow>
<ScrollDownContainer>
<ScrollDown theme={state.theme}>
<FontAwesomeIcon icon={faAngleDown} />
<FontAwesomeIcon icon={faAngleDown} />
<FontAwesomeIcon icon={faAngleDown} />
</ScrollDown>
</ScrollDownContainer>
</HeroContainer>
)
}
......@@ -56,12 +56,13 @@ const HeroContainer = styled.section`
const Slideshow = styled.div`
position: relative;
height: 100vh;
`
const SlideImage = styled(Image)`
position: relative;
const SlideImage = styled.div`
position: fixed;
top: 0;
height: calc(100vh);
height: 100%;
left: 0;
width: 100%;
object-fit: cover;
......@@ -69,6 +70,10 @@ const SlideImage = styled(Image)`
z-index: -2;
opacity: 0;
background-image: url(${props => props.image});
background-size: cover;
background-position: center;
${props => props.activeSlide ? `opacity: 1; z-index: 1;` : ``}
`
......@@ -141,6 +146,10 @@ const TextContainer = styled.div`
text-decoration: underline;
color: ${props => props.theme.colors.white};
&:visited {
color: ${props => props.theme.colors.white};
}
&:hover {
color: ${props => props.theme.colors.grey};
}
......
import React from 'react'
import {connect, styled} from 'frontity'
import Image from '@frontity/components/image'
import Container from '../global/container.js'
const Hours = ({hours, state, libraries}) => {
const Html2React = libraries.html2react.Component
console.log(hours)
return(
<HoursSection>
<PropertyRow>
{hours.map(({property, hours}, index) => {
return(
<PropertyColumn key={index} theme={state.theme}>
<h2>{property}</h2>
<Html2React html={hours} />
</PropertyColumn>
);
})}
</PropertyRow>
</HoursSection>
)
}
export default connect(Hours)
const HoursSection = styled.section`
position: relative;
background: white;
z-index: 100;
`
const PropertyRow = styled(Container)`
padding: 3rem 1rem;
display: flex;
justify-content: center;
`
const PropertyColumn = styled.div`
padding: 0 2rem;
&:not(:last-of-type) {
content: '';
display: block;
height: 100%;
border-right: 1px solid ${props => props.theme.colors.body};
}
`
\ No newline at end of file
......@@ -57,6 +57,7 @@ const StyledDropdownContainer = styled.div`
const Dropdown = styled.div`
position: absolute;
padding: .5rem;
margin-top: 0.5rem;
display: ${props => props.showDropdown ? 'flex' : 'none'};
flex-direction: column;
background: ${props => props.theme.colors.purple};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment