🚧 Adds the grid layout to minimal view

This commit is contained in:
Alicia Sykes 2021-08-08 17:16:31 +01:00
parent 0c130b0d4b
commit 88ae71cb6b
3 changed files with 46 additions and 35 deletions

View File

@ -31,6 +31,10 @@ div.minimal-section-heading {
cursor: pointer; cursor: pointer;
padding: 0.5rem 0.25rem; padding: 0.5rem 0.25rem;
border-radius: var(--curve-factor); border-radius: var(--curve-factor);
border: 1px solid var(--primary);
border-bottom: none;
border-radius: var(--curve-factor) var(--curve-factor) 0 0;
margin-bottom: 0;
h3 { h3 {
margin: 0; margin: 0;
color: var(--primary); color: var(--primary);
@ -38,7 +42,7 @@ div.minimal-section-heading {
&.selected { &.selected {
background: var(--primary); background: var(--primary);
h3 { h3 {
color: var(--background); color: var(--item-group-heading-text-color);
} }
} }
} }

View File

@ -92,9 +92,16 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: column; flex-direction: column;
background: var(--item-group-background);
border-radius: 0 0 var(--curve-factor) var(--curve-factor);
.section-items { .section-items {
display: flex; display: grid;
flex-direction: column; @include phone { grid-template-columns: repeat(1, 1fr); }
@include tablet { grid-template-columns: repeat(2, 1fr); }
@include laptop { grid-template-columns: repeat(3, 1fr); }
@include monitor { grid-template-columns: repeat(4, 1fr); }
@include big-screen { grid-template-columns: repeat(5, 1fr); }
@include big-screen-up { grid-template-columns: repeat(6, 1fr); }
} }
&.selected { &.selected {
border: 1px solid var(--primary); border: 1px solid var(--primary);

View File

@ -1,8 +1,13 @@
<template> <template>
<div class="minimal-home" :style="getBackgroundImage() + setColumnCount()"> <div class="minimal-home" :style="getBackgroundImage() + setColumnCount()">
<!-- Main content, section for each group of items --> <div class="title-and-search">
<div v-if="checkTheresData(sections)" <router-link to="/">
:class="`item-group-container item-size-small`"> <h1>{{ pageInfo.title }}</h1>
</router-link>
<MinimalSearch />
</div>
<div v-if="checkTheresData(sections)" class="item-group-container">
<!-- Section heading buttons -->
<MinimalHeading <MinimalHeading
v-for="(section, index) in getSections(sections)" v-for="(section, index) in getSections(sections)"
:key="`heading-${index}`" :key="`heading-${index}`"
@ -11,6 +16,7 @@
:selected="selectedSection === index" :selected="selectedSection === index"
@sectionSelected="sectionSelected" @sectionSelected="sectionSelected"
/> />
<!-- Section item groups -->
<MinimalSection <MinimalSection
v-for="(section, index) in getSections(sections)" v-for="(section, index) in getSections(sections)"
:key="`body-${index}`" :key="`body-${index}`"
@ -34,6 +40,7 @@
import MinimalSection from '@/components/MinimalView/MinimalSection.vue'; import MinimalSection from '@/components/MinimalView/MinimalSection.vue';
import MinimalHeading from '@/components/MinimalView/MinimalHeading.vue'; import MinimalHeading from '@/components/MinimalView/MinimalHeading.vue';
import MinimalSearch from '@/components/MinimalView/MinimalSearch.vue';
import Defaults, { localStorageKeys } from '@/utils/defaults'; import Defaults, { localStorageKeys } from '@/utils/defaults';
export default { export default {
@ -41,10 +48,12 @@ export default {
props: { props: {
sections: Array, // Main site content sections: Array, // Main site content
appConfig: Object, // Main site configuation (optional) appConfig: Object, // Main site configuation (optional)
pageInfo: Object,
}, },
components: { components: {
MinimalSection, MinimalSection,
MinimalHeading, MinimalHeading,
MinimalSearch,
}, },
data: () => ({ data: () => ({
searchValue: '', searchValue: '',
@ -158,39 +167,37 @@ export default {
@import '@/styles/style-helpers.scss'; @import '@/styles/style-helpers.scss';
.minimal-home { .minimal-home {
display: flex;
flex-direction: column;
justify-content: center;
margin: 1rem auto;
padding-bottom: 1px; padding-bottom: 1px;
background: var(--background);
min-height: calc(99.9vh - var(--footer-height)); min-height: calc(99.9vh - var(--footer-height));
width: 90%; width: 90%;
max-width: 1000px; max-width: 1000px;
margin: 1rem auto; background: var(--background);
}
.title-and-search {
text-align: center;
h1 {
color: var(--heading-text-color);
margin: 0;
font-size: 3rem;
}
a {
text-decoration: none;
}
} }
/* Outside container wrapping the item groups*/ /* Outside container wrapping the item groups*/
.item-group-container { .item-group-container {
display: grid; display: grid;
gap: 0.5rem; gap: 0 0.5rem;
margin: 0 auto; margin: 3rem auto;
max-width: 90%; width: 90%;
overflow: auto;
grid-template-columns: repeat(var(--col-count), 1fr); grid-template-columns: repeat(var(--col-count), 1fr);
@extend .scroll-bar; @extend .scroll-bar;
@include monitor-up {
max-width: 1400px;
}
/* Options for alternate layouts, triggered by buttons */
&.orientation-horizontal {
display: flex;
flex-direction: column;
}
&.orientation-vertical {
max-width: 100%;
@include tablet-up {
display: flex;
flex-direction: row;
}
}
/* Hide when search term returns nothing */ /* Hide when search term returns nothing */
.no-results { display: none; } .no-results { display: none; }
@ -206,11 +213,4 @@ export default {
border-radius: var(--curve-factor); border-radius: var(--curve-factor);
} }
section.filter-container {
border-bottom: 1px solid var(--outline-color);
@include phone {
flex-direction: column;
}
}
</style> </style>