feat: improved on ui so that user can see the spaces they want to view easier #33
@@ -24,15 +24,18 @@
|
|||||||
height: 4rem;
|
height: 4rem;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
right: 0;
|
||||||
background: linear-gradient(-77deg, #2e4653, #3a5b56);
|
background: linear-gradient(-77deg, #2e4653, #3a5b56);
|
||||||
box-shadow: 0rem 0rem 0.5rem #182125;
|
box-shadow: 0rem 0rem 0.5rem #182125;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo img {
|
.logo img {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from "svelte";
|
import type { Table } from "$lib";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
space: Table<"study_spaces">;
|
||||||
alt: string;
|
alt: string;
|
||||||
imgSrc: string;
|
imgSrc: string;
|
||||||
title?: Snippet;
|
|
||||||
description?: Snippet;
|
|
||||||
href?: string;
|
href?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { alt, imgSrc, title, description, href }: Props = $props();
|
const { space, alt, imgSrc, href }: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a class="card" {href}>
|
<a class="card" {href}>
|
||||||
<img src={imgSrc} {alt} />
|
<img src={imgSrc} {alt} />
|
||||||
<div class="description">
|
<div class="description">
|
||||||
{@render title?.()}
|
<h1>{space.location}</h1>
|
||||||
{@render description?.()}
|
<p>{space.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@@ -25,6 +24,11 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #49bd85;
|
background-color: #49bd85;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 20rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
overflow: hidden;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.description {
|
.description {
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
@@ -32,7 +36,9 @@
|
|||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
width: 16rem;
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
aspect-ratio: 1 / 1;
|
aspect-ratio: 1 / 1;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -26,28 +26,30 @@
|
|||||||
alt="Photo of {studySpace.description}"
|
alt="Photo of {studySpace.description}"
|
||||||
href="/space/{studySpace.id}"
|
href="/space/{studySpace.id}"
|
||||||
imgSrc={imgUrl}
|
imgSrc={imgUrl}
|
||||||
>
|
space={studySpace}
|
||||||
{#snippet title()}
|
/>
|
||||||
<h1>{studySpace.location}</h1>
|
|
||||||
{/snippet}
|
|
||||||
|
|
||||||
{#snippet description()}
|
|
||||||
<p>{studySpace.description}</p>
|
|
||||||
{/snippet}
|
|
||||||
</SpaceCard>
|
|
||||||
{/each}
|
{/each}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
main {
|
main {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
box-sizing: border-box;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
width: min(600px, 100vw);
|
max-width: 600px;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.new-space {
|
.new-space {
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 20rem) {
|
||||||
|
main {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user