diff --git a/src/app/modules/news/item/news-item.html b/src/app/modules/news/item/news-item.html index 3ba5180e..ed80b55c 100644 --- a/src/app/modules/news/item/news-item.html +++ b/src/app/modules/news/item/news-item.html @@ -1,31 +1,27 @@ - - - - - - - - + + + + {{ item.datePublished | amCalendar | sentencecase diff --git a/src/app/modules/news/item/news-item.scss b/src/app/modules/news/item/news-item.scss index c22251b4..281bae5a 100644 --- a/src/app/modules/news/item/news-item.scss +++ b/src/app/modules/news/item/news-item.scss @@ -1,8 +1,28 @@ +/*! + * Copyright (C) 2022 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + ion-card-header a { color: var(--ion-color-dark-tint); text-decoration: none; } +ion-card { + height: 100%; + margin: 0; +} + ion-card ion-thumbnail { background: var(--placeholder-gray); width: 100%; diff --git a/src/app/modules/news/page/news-page.component.ts b/src/app/modules/news/page/news-page.component.ts index 5e540b48..6e854ace 100644 --- a/src/app/modules/news/page/news-page.component.ts +++ b/src/app/modules/news/page/news-page.component.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 StApps + * Copyright (C) 2022 StApps * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, version 3. @@ -35,6 +35,7 @@ import {SplashScreen} from '@capacitor/splash-screen'; @Component({ selector: 'stapps-news-page', templateUrl: 'news-page.html', + styleUrls: ['news-page.scss'], }) export class NewsPageComponent implements OnInit { /** diff --git a/src/app/modules/news/page/news-page.html b/src/app/modules/news/page/news-page.html index 4a7e535a..25057ede 100644 --- a/src/app/modules/news/page/news-page.html +++ b/src/app/modules/news/page/news-page.html @@ -1,3 +1,18 @@ + + @@ -27,17 +42,20 @@ > - - - - - - - - - - +
+ + + + + + +
{{ 'search.nothing_found' | translate | titlecase }} diff --git a/src/app/modules/news/page/news-page.scss b/src/app/modules/news/page/news-page.scss new file mode 100644 index 00000000..743c17ae --- /dev/null +++ b/src/app/modules/news/page/news-page.scss @@ -0,0 +1,36 @@ +/*! + * Copyright (C) 2022 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +@import "src/theme/util/mixins"; + +.news-grid { + display: grid; + gap: var(--spacing-sm); + margin: var(--spacing-sm); + @include auto-grid(300px); + + // force scrolling & infinite scroll + // fill in on large screens + min-height: 101%; + + > * { + height: 100%; + } +} + +ion-content.ios > .news-grid { + gap: var(--spacing-lg); + margin: var(--spacing-lg); + @include auto-grid(350px); +} diff --git a/src/theme/util/_mixins.scss b/src/theme/util/_mixins.scss index 526dc21f..d10de18f 100644 --- a/src/theme/util/_mixins.scss +++ b/src/theme/util/_mixins.scss @@ -1,3 +1,18 @@ +/*! + * Copyright (C) 2022 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + /** * Breakpoints copied from node_modules/@ionic/angular/css/display.css @@ -56,3 +71,9 @@ @content } } + +@mixin auto-grid($item-width) { + // fit as many items on the page while keeping items >$item-width, + // but also ensure items get shrunk on small screens + grid-template-columns: repeat(auto-fit, minmax(calc(min($item-width, 100%)), 1fr)) +}