From d31a4ae6d634ac86325ccbe424110525c14a5589 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 29 Apr 2021 14:53:57 +0200 Subject: final fixes? --- frontend/site/projects/museum/views/artists.css | 4 +- frontend/site/projects/museum/views/artists.js | 6 ++- .../site/projects/museum/views/jakrawal.links.js | 43 +++++++++------------- frontend/site/projects/museum/views/nav.overlay.js | 2 +- .../site/projects/museum/views/titles.overlay.js | 4 +- 5 files changed, 26 insertions(+), 33 deletions(-) (limited to 'frontend/site/projects/museum/views') diff --git a/frontend/site/projects/museum/views/artists.css b/frontend/site/projects/museum/views/artists.css index 312407a..66c7005 100644 --- a/frontend/site/projects/museum/views/artists.css +++ b/frontend/site/projects/museum/views/artists.css @@ -84,8 +84,8 @@ text-shadow: 0 0 5px #FF790D; cursor: pointer; } -.page-artists .artist-detail-name, -.page-artists .artist-detail-name:hover { +.page-artists .artist-detail-name a, +.page-artists .artist-detail-name a:hover { text-decoration: none; } .page-artists .nav-arrow { diff --git a/frontend/site/projects/museum/views/artists.js b/frontend/site/projects/museum/views/artists.js index fe07598..b6af721 100644 --- a/frontend/site/projects/museum/views/artists.js +++ b/frontend/site/projects/museum/views/artists.js @@ -129,9 +129,11 @@ const ArtistDetail = ({ artist, index, isCurrent, language, onClose }) => {
- {artist.name} + {artist.name} +
+
+
-
{artist.location[language]}
) diff --git a/frontend/site/projects/museum/views/jakrawal.links.js b/frontend/site/projects/museum/views/jakrawal.links.js index 90c4871..2447728 100644 --- a/frontend/site/projects/museum/views/jakrawal.links.js +++ b/frontend/site/projects/museum/views/jakrawal.links.js @@ -5,25 +5,13 @@ import './jakrawal.links.css' import { history } from "site/store" -const JAKRAWAL_TEXTS = [ - "Wildfires occur frequently during the dry season in northern Thailand’s high mountains. The source of fire is not natural but arson.", - "In the past it was hypothesized that local people set the fires to clear land for agricultural use, or for hunting.", - "There were efforts to solve the problem at the community level, but the fires only became more severe.", - "Strangely, the blazes often occurred in the national park—an area difficult for villagers to access.", - "During the wildfire suppression efforts of May 2020, a group of scholars and volunteers discovered important evidence that would change the original hypothesis.", - "They found several instances of improvised devices made of clothes pegs connected to a small battery by a power cable.", - "Combustion was triggered by a small clod of clay positioned in the middle between the pegs, acting as a timer. After melting in the heat the wires attached to the batteries would ignite.", - "Villagers who were interviewed said that this was not a technique that they were familiar with.", - "Although we cannot know the intention of the burners, it is likely that the park’s natural resources are being used to benefit some group of people. And the poor have always been condemned.", -] - const RESET_STATE = { left: null, right: null, vertical: false, + curtain: false, lateralLink: null, verticalLink: null, - text: null, hovering: false, } @@ -77,24 +65,28 @@ class JakrawalLinks extends Component { this.autoadvanceTimeout = setTimeout(this.goVertical, AUTOADVANCE_TIMEOUT) this.setState({ ...RESET_STATE, + curtain: true, verticalLink: "home", }) + clearTimeout(this.timeout) + this.timeout = setTimeout(() => { + this.setState({ vertical: true }) + }, VERTICAL_TIMEOUT) return } const partz = page_partz[1].split("") const isOnA = partz[0] === 'a'; const lateralLink = (isOnA ? 'b' : 'a') + partz[1] - const verticalLink = partz[0] + (parseInt(partz[1]) + 1) - const text = JAKRAWAL_TEXTS[parseInt(partz[1]) - 1] + const verticalLink = lateralLink === 'a8' ? "home" : partz[0] + (parseInt(partz[1]) + 1) this.setState({ left: !isOnA, right: isOnA, lateralLink, verticalLink, - text, + curtain: true, hovering: false, }) - if (!lastParams || lastParams.page_name !== ('nilthamrong' + lateralLink)) { + if (!lastParams || lastParams.page_name !== ('nilthamrong-' + lateralLink)) { clearTimeout(this.autoadvanceTimeout) this.autoadvanceTimeout = setTimeout(this.goVertical, AUTOADVANCE_TIMEOUT) clearTimeout(this.timeout) @@ -111,16 +103,20 @@ class JakrawalLinks extends Component { this.setState({ hovering: false }) } goLateral() { - history.push(`/thelastmuseum/nilthamrong-${this.state.lateralLink}/`) + history.push(`/thelastmuseum/nilthamrong-${this.state.lateralLink}`) } goVertical() { this.setState({ vertical: false }) - history.push(`/thelastmuseum/nilthamrong-${this.state.verticalLink}/`) + if (this.state.verticalLink === 'home') { + history.push(`/thelastmuseum/home`) + } else { + history.push(`/thelastmuseum/nilthamrong-${this.state.verticalLink}`) + } } render() { - const { left, right, vertical } = this.state - if (!this.props.interactive || (!left && !right && !vertical)) return null + const { left, right, vertical, curtain } = this.state + if (!this.props.interactive || (!left && !right && !vertical && !curtain)) return null return (
@@ -137,8 +133,3 @@ const mapStateToProps = state => ({ }) export default connect(mapStateToProps)(JakrawalLinks) - -/* - {text &&
} - {text &&
} - */ \ No newline at end of file diff --git a/frontend/site/projects/museum/views/nav.overlay.js b/frontend/site/projects/museum/views/nav.overlay.js index bf43c52..37d30d3 100644 --- a/frontend/site/projects/museum/views/nav.overlay.js +++ b/frontend/site/projects/museum/views/nav.overlay.js @@ -168,7 +168,7 @@ class NavOverlay extends Component { nextPage.tiles.forEach(tile => { if (tile.type === 'video' && !this.preloaded[tile.settings.url]) { this.preloaded[tile.settings.url] = true - preloadVideo(tile.settings.url) + preloadVideo(tile.settings.url, { canplaythrough: true }) .then(video => { // console.log("preloaded", video.src) // video.src = null diff --git a/frontend/site/projects/museum/views/titles.overlay.js b/frontend/site/projects/museum/views/titles.overlay.js index bf7bb97..32e7344 100644 --- a/frontend/site/projects/museum/views/titles.overlay.js +++ b/frontend/site/projects/museum/views/titles.overlay.js @@ -99,9 +99,9 @@ class TitlesOverlay extends Component { showHeadphones() { if (!this.headphonesRef.current) return - this.titleTimeout = setTimeout(() => { + this.headphonesTimeout = setTimeout(() => { this.headphonesRef.current.style.opacity = 1 - this.titleTimeout = setTimeout(() => { + this.headphonesTimeout = setTimeout(() => { this.headphonesRef.current.style.opacity = 0 setTimeout(this.showTitle, TITLE_SHOW_DELAY) }, HEADPHONES_HIDE_DELAY) -- cgit v1.2.3-70-g09d2