From 1895a716c30b6a217536532784d554a892357355 Mon Sep 17 00:00:00 2001 From: Harry Minsky Date: Thu, 5 Sep 2024 16:59:28 -0400 Subject: [PATCH] Implement first pass desktop layout This commit introduces a first-pass desktop layout for the application, primarily handled through media queries on the base css. It also introduces a new set of css variables for setting font size. --- .github/workflows/lint.yml | 4 +- front-end/src/assets/base.css | 17 ++- front-end/src/assets/main.css | 3 - front-end/src/components/LeafletMap.vue | 18 +++ .../src/components/MoreArtworksByArtist.vue | 2 +- front-end/src/components/ResourceDetail.vue | 8 +- .../src/components/ResourceDetailItem.vue | 7 +- front-end/src/components/ResourcePanel.vue | 41 ++--- front-end/src/components/SearchList.vue | 16 +- front-end/src/components/SearchListItem.vue | 20 ++- front-end/src/pages/HomePage.vue | 144 ++++++++++++------ 11 files changed, 189 insertions(+), 91 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c926c6b..63dbe87 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,9 +10,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: 'front-end/.node-version' - - name: Enter frontend directory - run: cd front-end - name: Install dependencies + working-directory: ./front-end run: npm ci - name: Run ESLint + working-directory: ./front-end run: npm run lint diff --git a/front-end/src/assets/base.css b/front-end/src/assets/base.css index 33b01d6..dafc776 100644 --- a/front-end/src/assets/base.css +++ b/front-end/src/assets/base.css @@ -6,9 +6,24 @@ :root { --color-black: #363636; --color-white: #ffffff; + --font-size-base: 16px; + --wac-font-size--small: calc(var(--font-size-base) * 0.75); + --wac-font-size--med: var(--font-size-base); + --wac-font-size--lg: calc(var(--font-size-base) * 1.25); + --wac-font-size--xl: calc(var(--font-size-base) * 1.5); + --wac-font-size--xxl: calc(var(--font-size-base) * 2); + --wac-font-size--xxxl: calc(var(--font-size-base) * 3); + --wac-font-size--xxxxl: calc(var(--font-size-base) * 4); +} + +@media screen and (max-width: 940px) { + :root { + --font-size-base: 16px; + } } body { - background-color: var(--color-background); + background-color: var(--color-white); font-family: 'Inter', sans-serif; + font-size: var(--wac-font-size--med); } diff --git a/front-end/src/assets/main.css b/front-end/src/assets/main.css index 5b6cdb5..d181494 100644 --- a/front-end/src/assets/main.css +++ b/front-end/src/assets/main.css @@ -1,8 +1,5 @@ @import './base.css'; -:root { -} - .v-enter-active, .v-leave-active { transition: opacity 0.5s ease; diff --git a/front-end/src/components/LeafletMap.vue b/front-end/src/components/LeafletMap.vue index c98e179..2c07852 100644 --- a/front-end/src/components/LeafletMap.vue +++ b/front-end/src/components/LeafletMap.vue @@ -98,6 +98,8 @@ watch( diff --git a/front-end/src/components/MoreArtworksByArtist.vue b/front-end/src/components/MoreArtworksByArtist.vue index 499dbd3..f63edaf 100644 --- a/front-end/src/components/MoreArtworksByArtist.vue +++ b/front-end/src/components/MoreArtworksByArtist.vue @@ -70,7 +70,7 @@ const setActiveResource = (newResourceId: string) => { .more-artworks-by-artist-title { font-style: normal; font-weight: 700; - font-size: 16px; + font-size: var(--wac-font-size--med); line-height: 100%; color: #000000; diff --git a/front-end/src/components/ResourceDetail.vue b/front-end/src/components/ResourceDetail.vue index d66a92d..a692098 100644 --- a/front-end/src/components/ResourceDetail.vue +++ b/front-end/src/components/ResourceDetail.vue @@ -51,7 +51,7 @@ .resource-detail-metadata-title { font-style: normal; font-weight: 700; - font-size: 16px; + font-size: var(--wac-font-size--med); line-height: 100%; color: #999999; @@ -60,7 +60,7 @@ .resource-detail-metadata-content { font-style: normal; font-weight: 400; - font-size: 16px; + font-size: var(--wac-font-size--med); line-height: 140%; color: #999999; @@ -69,14 +69,14 @@ .resource-detail-header-label { font-style: normal; font-weight: 400; - font-size: 24px; + font-size: var(--wac-font-size--lg); line-height: 100%; } .resource-detail-header-title { font-style: normal; font-weight: 900; - font-size: 32px; + font-size: var(--wac-font-size--xxl); line-height: 100%; } diff --git a/front-end/src/components/ResourceDetailItem.vue b/front-end/src/components/ResourceDetailItem.vue index d1f28e9..cad3616 100644 --- a/front-end/src/components/ResourceDetailItem.vue +++ b/front-end/src/components/ResourceDetailItem.vue @@ -51,13 +51,12 @@ const imageUrl = props.imageUrl ? import.meta.env.VITE_ARCHES_API_URL + props.im flex-direction: column; align-items: flex-start; padding: 0px; - gap: 8px; } .resource-detail-item-header-byline { font-style: normal; font-weight: 700; - font-size: 16px; + font-size: var(--wac-font-size--med); line-height: 100%; color: #000000; @@ -66,7 +65,7 @@ const imageUrl = props.imageUrl ? import.meta.env.VITE_ARCHES_API_URL + props.im .resource-detail-item-header-title { font-style: normal; font-weight: 900; - font-size: 24px; + font-size: var(--wac-font-size--xxl); line-height: 120%; text-decoration-line: underline; @@ -76,7 +75,7 @@ const imageUrl = props.imageUrl ? import.meta.env.VITE_ARCHES_API_URL + props.im .resource-detail-item-credit { font-style: normal; font-weight: 400; - font-size: 16px; + font-size: var(--wac-font-size--med); line-height: 140%; color: #000000; diff --git a/front-end/src/components/ResourcePanel.vue b/front-end/src/components/ResourcePanel.vue index ccc7422..0280372 100644 --- a/front-end/src/components/ResourcePanel.vue +++ b/front-end/src/components/ResourcePanel.vue @@ -22,10 +22,7 @@ v-for="relatedArtwork in resourceRelations.filter( (resourceRelation) => graphIdToNameTable[resourceRelation.graph_id] === 'Artwork' )" - v-else-if=" - validateArtistSchema(props.resource.resource) && - graphIdToNameTable[props.resource.graph_id] === 'Artist' - " + v-else-if="graphIdToNameTable[props.resource.graph_id] === 'Artist'" :key="relatedArtwork.graph_id" :related-artwork="relatedArtwork" :id-references="props.idReferences" @@ -35,10 +32,7 @@ v-for="relatedArtwork in resourceRelations.filter( (resourceRelation) => graphIdToNameTable[resourceRelation.graph_id] === 'Artwork' )" - v-else-if=" - validateStructureSchema(props.resource.resource) && - graphIdToNameTable[props.resource.graph_id] === 'Structure' - " + v-else-if="graphIdToNameTable[props.resource.graph_id] === 'Structure'" :key="relatedArtwork.resourceinstanceid" :related-artwork="relatedArtwork" :id-references="props.idReferences" @@ -48,23 +42,14 @@ v-for="relatedArtwork in resourceRelations.filter( (resourceRelation) => graphIdToNameTable[resourceRelation.graph_id] === 'Artwork' )" - v-else-if=" - validatePhotographerSchema(props.resource.resource) && - graphIdToNameTable[props.resource.graph_id] === 'Photographer' - " + v-else-if="graphIdToNameTable[props.resource.graph_id] === 'Photographer'" :key="relatedArtwork.root_ontology_class" :related-artwork="relatedArtwork" :id-references="props.idReferences" :panel-resource-type="PanelResourceEnum.PHOTOGRAPHER" /> -