Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
fix: some card styling
Browse files Browse the repository at this point in the history
  • Loading branch information
villetakanen committed Dec 12, 2021
1 parent 4cec139 commit db06af7
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
39 changes: 38 additions & 1 deletion src/components/layout/Card.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
<template>
<section
class="card"
:class="{ riseTwo: rise === 2, riseThree: rise === 3 , riseFour: rise === 4, riseZero: rise === 0, secondary: secondary }"
:class="{
riseTwo: rise === 2,
riseThree: rise === 3 ,
riseFour: rise === 4,
riseZero: rise === 0,
secondary: secondary,
hasBottom: hasBottom
}"
>
<slot />
<Toolbar
v-if="hasBottom"
class="bottomToolbar"
>
<slot name="bottom" />
</Toolbar>
</section>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import Toolbar from './Toolbar.vue'
export default defineComponent({
components: { Toolbar },
props: {
rise: {
type: Number,
Expand All @@ -22,6 +37,10 @@ export default defineComponent({
required: false,
default: false
}
},
setup (props, { slots }) {
const hasBottom = !!slots.bottom
return { hasBottom }
}
})
</script>
Expand All @@ -36,6 +55,8 @@ section.card
background-color: var(--chroma-clear)
padding: 16px
border-radius: 12px
position: relative
overflow: hidden
&.riseTwo
@include Rise2()
&.riseThree
Expand All @@ -46,6 +67,22 @@ section.card
box-shadow: none
&.secondary
background: linear-gradient(-42deg, var(--chroma-secondary-f) 0%, var(--chroma-secondary-c) 100%)
&.hasBottom
padding-bottom: 24px
h1
a
color: var(--card-header-color)
.bottomToolbar
position: absolute
bottom: -8px
left: 0
width: 100%
box-sizing: border-box
height: 24px
align-items: center
padding: 16px
background-color: var(--card-toolbar-background-color)
section + section.card
margin-top: 12px
Expand Down
28 changes: 23 additions & 5 deletions src/components/sites/sitecard/SiteCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<template>
<Card class="SiteCard">
<Card
class="SiteCard"
:class="{
themeDD: site.theme.name === 'dd',
themeQuick: site.theme.name === 'quick',
themeHomebrew: site.theme.name === 'homebrew'
}"
>
<div
v-if="site.theme.avatarImageURL"
class="avatar"
Expand Down Expand Up @@ -28,9 +35,18 @@
<p style="clear:both">
{{ site.description }}
</p>
<p class="TypeCaption">
{{ $t('meta.updatedAt') }} {{ toDisplayString(site.updatedAt) }}
</p>
<template #bottom>
<Icon
v-if="site.hidden"
style="opacity:0.44"
small
name="hidden"
/>
<SpacerDiv />
<p class="TypeCaption">
<i>{{ $t('meta.updatedAt') }} {{ toDisplayString(site.updatedAt) }}</i>
</p>
</template>
</Card>
</template>

Expand All @@ -42,8 +58,10 @@ import { useSites } from '@/state/sites'
import { computed, defineComponent } from 'vue'
import { toDisplayString } from '@/utils/firebaseTools'
import SpacerDiv from '@/components/layout/SpacerDiv.vue'
export default defineComponent({
components: { Card, Icon },
components: { Card, Icon, SpacerDiv },
props: {
siteid: {
type: String,
Expand Down
1 change: 1 addition & 0 deletions src/styles/base.sass
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@import charactersheets.sass
@import colors.sass
@import formcontrols.sass
@import themes/themeDD.sass

// *** Spacing ********************************************************
:root
Expand Down
1 change: 1 addition & 0 deletions src/styles/colors.sass
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

// https://imgur.com/UuoVNSc
--color-ddb-red: #C73032
--color-ddb-red-light: #e9acad
--color-ddb-sorcerer: #992e2e

--color-a-a: #002337
Expand Down
4 changes: 4 additions & 0 deletions src/styles/themes/themeDD.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.themeDD
--card-header-color: var(--color-ddb-sorcerer)
--card-toolbar-color: var(--color-ddb-sorcerer)
--card-toolbar-background-color: var(--color-ddb-red-light)

0 comments on commit db06af7

Please sign in to comment.