Makes the layout responsive
This commit is contained in:
54
src/app.scss
54
src/app.scss
@@ -10,7 +10,7 @@ body {
|
|||||||
background-image: var(--background-image);
|
background-image: var(--background-image);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
color: var(--text);
|
color: var(--text) !important;
|
||||||
transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms;
|
transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,23 +128,59 @@ main {
|
|||||||
gap: 32px;
|
gap: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.service-group {
|
.group .services.layout-column {
|
||||||
background: lime;
|
|
||||||
}
|
|
||||||
|
|
||||||
.service-group.layout-column {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.service-group.layout-row {
|
.group .services.layout-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: var(--layout-template);
|
grid-template-columns: var(--layout-template);
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.service-card {
|
@media (max-width: 768px) {
|
||||||
background: orange;
|
.layout-column {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group .services.layout-row {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.group .header {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
font-size: 1.7em;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: var(--card-background);
|
||||||
|
transition: cubic-bezier(0.165, 0.84, 0.44, 1) 300ms;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-content {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .image {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
font-size: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:hover {
|
||||||
|
transform: translate(0, -3px);
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ services:
|
|||||||
|
|
||||||
- title: 'PiHole'
|
- title: 'PiHole'
|
||||||
subtitle: 'A DNS Hole'
|
subtitle: 'A DNS Hole'
|
||||||
icon: 'fas fa-hard-drive'
|
logo: 'https://cdn.rawgit.com/pi-hole/graphics/master/Vortex/Vortex.svg'
|
||||||
target: '_blank'
|
target: '_blank'
|
||||||
url: '/pihole'
|
url: '/pihole'
|
||||||
type: 'pihole'
|
type: 'pihole'
|
||||||
@@ -43,7 +43,6 @@ services:
|
|||||||
icon: 'fas fa-hard-drive'
|
icon: 'fas fa-hard-drive'
|
||||||
target: '_blank'
|
target: '_blank'
|
||||||
url: '/NAS'
|
url: '/NAS'
|
||||||
type: prowlarr
|
|
||||||
|
|
||||||
keywords: 'cloud storage files'
|
keywords: 'cloud storage files'
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,10 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
div {
|
div {
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
color: var(--mask-color);
|
color: var(--mask-color);
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { ServiceConfig } from '$lib/config';
|
import type { ServiceConfig } from '$lib/config';
|
||||||
import { getServiceComponent } from '$lib/services/services';
|
import { getServiceComponent } from '$lib/services/services';
|
||||||
|
import Brand from './Brand.svelte';
|
||||||
|
|
||||||
export let service: ServiceConfig;
|
export let service: ServiceConfig;
|
||||||
export let data: any;
|
export let data: any;
|
||||||
@@ -8,9 +9,22 @@
|
|||||||
const component = getServiceComponent(service.type || '');
|
const component = getServiceComponent(service.type || '');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="service-card">
|
<div class="card">
|
||||||
<p>{service.title}</p>
|
<div class="card-content">
|
||||||
{#if component != undefined}
|
<div class="media">
|
||||||
<svelte:component this={component} {data} />
|
<div class="media-left">
|
||||||
{/if}
|
<figure class="image">
|
||||||
|
<Brand brand={service} />
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
<div class="media-content">
|
||||||
|
<p class="title is-4">{service.title}</p>
|
||||||
|
{#if component != undefined}
|
||||||
|
<p class="subtitle is-6"><svelte:component this={component} {data} /></p>
|
||||||
|
{:else}
|
||||||
|
<p class="subtitle is-6">{service.subtitle}</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,14 +1,26 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { ServiceGroupConfig } from '$lib/config';
|
import type { ServiceGroupConfig } from '$lib/config';
|
||||||
import { layoutDirection } from '$lib/stores/layout';
|
import { layoutDirection } from '$lib/stores/layout';
|
||||||
|
import Brand from './Brand.svelte';
|
||||||
import ServiceCard from './ServiceCard.svelte';
|
import ServiceCard from './ServiceCard.svelte';
|
||||||
|
|
||||||
export let group: ServiceGroupConfig;
|
export let group: ServiceGroupConfig;
|
||||||
export let groupData: Array<unknown>;
|
export let groupData: Array<unknown>;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="service-group layout-{$layoutDirection}">
|
<div class="group">
|
||||||
{#each group.items as service, i}
|
<div class="header">
|
||||||
<ServiceCard {service} data={groupData[i]} />
|
<h3>
|
||||||
{/each}
|
{#if group.icon}
|
||||||
|
<i class={group.icon} />
|
||||||
|
{/if}
|
||||||
|
{group.title}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="services layout-{$layoutDirection}">
|
||||||
|
{#each group.items as service, i}
|
||||||
|
<ServiceCard {service} data={groupData[i]} />
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user