diff --git a/src/components/Card.jsx b/src/components/Card.jsx index 895b299..0184063 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -139,7 +139,7 @@ class Card extends React.Component { {this.renderTimestamp()} {this.renderLocation()} - {this.renderCategory()} + {this.renderCategory()} {this.renderSummary()} ); diff --git a/src/components/presentational/CardCategory.js b/src/components/presentational/CardCategory.js index a99a9e4..fd9691b 100644 --- a/src/components/presentational/CardCategory.js +++ b/src/components/presentational/CardCategory.js @@ -1,11 +1,13 @@ import React from 'react'; +import { capitalizeFirstLetter } from '../../js/data/utilities.js'; + const CardCategory = ({ categoryTitle, categoryLabel, color }) => ( -
+

{categoryTitle}

+ {capitalizeFirstLetter(categoryLabel)} - {categoryLabel}

); diff --git a/src/components/presentational/CardLocation.js b/src/components/presentational/CardLocation.js index 092a66a..e9598fa 100644 --- a/src/components/presentational/CardLocation.js +++ b/src/components/presentational/CardLocation.js @@ -7,22 +7,22 @@ const CardLocation = ({ language, location }) => { if (isNotNullNorUndefined(location)) { return ( -

+

location_on {location}

-

+
); } else { const unknown = copy[language].cardstack.unknown_location; return ( -

+

location_on {unknown}

-

+
); } } diff --git a/src/components/presentational/CardNarrative.js b/src/components/presentational/CardNarrative.js index 587c5f3..49f590d 100644 --- a/src/components/presentational/CardNarrative.js +++ b/src/components/presentational/CardNarrative.js @@ -3,10 +3,12 @@ import React from 'react'; import CardNarrativeLink from './CardNarrativeLink'; const CardNarrative = (props) => ( -
+

Connected events

-

Next:

-

Previous:

+
+

+

+
); diff --git a/src/components/presentational/CardSource.js b/src/components/presentational/CardSource.js index 42ac8cf..4abb38a 100644 --- a/src/components/presentational/CardSource.js +++ b/src/components/presentational/CardSource.js @@ -4,10 +4,11 @@ import copy from '../../js/data/copy.json'; const CardSource = ({ source, language }) => { const source_lang = copy[language].cardstack.source; + if (!source) source = copy[language].cardstack.unknown_source; return ( -
-

{source_lang}

+
+

{source_lang}:

{source}

); diff --git a/src/components/presentational/CardSummary.js b/src/components/presentational/CardSummary.js index a34a9b3..8dd9d8d 100644 --- a/src/components/presentational/CardSummary.js +++ b/src/components/presentational/CardSummary.js @@ -8,9 +8,11 @@ const CardSummary = ({ language, description, isHighlighted }) => { const descriptionText = (isHighlighted) ? description : `${description.substring(0, 40)}...`; return ( -
-

{summary}

-

{descriptionText}

+
+
+

{summary}

+

{descriptionText}

+
); } diff --git a/src/components/presentational/CardTags.js b/src/components/presentational/CardTags.js index 0e44961..b4b48b6 100644 --- a/src/components/presentational/CardTags.js +++ b/src/components/presentational/CardTags.js @@ -8,8 +8,8 @@ const CardTags = ({ tags, language }) => { if (tags.length > 0) { return ( -
-

{tags_lang}

+
+

{tags_lang}:

{tags.map((tag, idx) => { return ( @@ -26,7 +26,7 @@ const CardTags = ({ tags, language }) => { ); } return ( -

+

{tags_lang}

{no_tags_lang}

diff --git a/src/js/data/copy.json b/src/js/data/copy.json index 29a139b..5fd1890 100644 --- a/src/js/data/copy.json +++ b/src/js/data/copy.json @@ -137,6 +137,7 @@ "tags": "Tags", "notags": "No known tags for this event.", "source": "Source", + "unknown_source": "Unknown source. The relability of this event cannot be confirmed.", "category": "Category", "communication": "Communication", "transmitter": "Transmitter", diff --git a/src/js/utilities.js b/src/js/utilities.js index c9c9309..c51596c 100644 --- a/src/js/utilities.js +++ b/src/js/utilities.js @@ -36,6 +36,14 @@ export function isNotNullNorUndefined(variable) { return (typeof variable !== 'undefined' && variable !== null); } +/* +* Capitalizes _only_ the first letter of a string +* Taken from: https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript +*/ +export function capitalizeFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + /** * Return a Date object given a datetime string of the format: "2016-09-10T07:00:00" * @param {string} datetime diff --git a/src/scss/_colors.scss b/src/scss/_colors.scss index 5b8f0e2..fa96ae6 100644 --- a/src/scss/_colors.scss +++ b/src/scss/_colors.scss @@ -1,6 +1,7 @@ $event_default: red; $offwhite: #efefef; +$lightwhite: #dfdfdf; $midwhite: #a0a0a0; $darkwhite: darken($midwhite, 15%); $yellow: #ffd800; diff --git a/src/scss/card.scss b/src/scss/card.scss index fc471bf..5a544bf 100644 --- a/src/scss/card.scss +++ b/src/scss/card.scss @@ -10,43 +10,18 @@ box-shadow: 0 19px 19px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22); font-size: $large; line-height: $xxlarge; - transition: 0.2s ease; height: auto; + opacity: 0.9; + transition: opacity 0.2s ease; &:hover { - border: 1px solid $yellow; - } - - .material-icons { - font-size: $normal; - color: $darkwhite; - margin-right: 5px; - } - - .card-row { - display: flex; - flex-direction: row; - border-bottom: 1px solid $midwhite; - margin-bottom: 10px; - - .card-cell { - flex: 1; - } - } - - .card-bottomhalf { - transition: 0.4s ease; - height: auto; - - &.folded { - transition: 0.4s ease; - height: 0; - overflow: hidden; - } + opacity: 1; + transition: opacity 0.2s ease; } h4 { margin-bottom: 0; + margin-right: 5px; text-transform: uppercase; font-size: $xsmall; color: $darkwhite; @@ -61,19 +36,58 @@ margin: 0; } - .card-cell { - margin-bottom: 10px; + .material-icons { + font-size: $normal; + color: $darkwhite; + margin-right: 5px; + } + .card-row { + display: flex; + flex-direction: row; + border-bottom: 1px solid $lightwhite; + margin: 5px 0 10px 0; + padding-bottom: 10px; + + .card-cell { + flex: 1; + } + + h4 { + min-width: 80px; + max-width: 80px; + } + } + + .card-cell { + a { + font-weight: bold; + transition: color 0.2s; + } a:hover { - color: $red; + color: $darkwhite; cursor: pointer; + transition: color 0.2s; } a.disabled { color: $midgrey; + font-weight: normal; cursor: default; } } + + .card-bottomhalf { + transition: 0.4s ease; + height: auto; + + &.folded { + transition: 0.4s ease; + height: 0; + overflow: hidden; + } + } + .card-toggle p { text-align: center; cursor: pointer; @@ -126,28 +140,19 @@ } .category { + margin-bottom: 5px; + .color-category { width: 12px; height: 12px; border-radius: 20px; display: inline-block; - margin: 0px 5px 0 0; + margin: 0 0 0 5px; } - } - .event-type { - margin: 0 0 10px 0; - - span { - display: inline-block; - margin: 0 5px 2px 0; - color: $darkgrey; - - &.flagged { - background: $red; - color: $offwhite; - padding: 0 5px; - } + p { + text-align: right; + flex: 1; } } diff --git a/src/scss/timeline.scss b/src/scss/timeline.scss index 2ffda13..6e8cddf 100644 --- a/src/scss/timeline.scss +++ b/src/scss/timeline.scss @@ -78,7 +78,7 @@ &:first-child { text-transform: none; font-size: $normal; - letter-spacing: 0.05; + letter-spacing: 0.05em; } } }