+ Added link to toast card

This commit is contained in:
Alexis
2021-03-29 15:15:50 +02:00
parent cb505812c5
commit 03c7328bfb
5 changed files with 42 additions and 11 deletions

View File

@@ -63,6 +63,13 @@ a {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
&.fs-link {
color: $primary-xxlight;
text-decoration: underline;
&:hover {
color: $primary-xlight;
}
}
} }
button { button {

View File

@@ -91,6 +91,10 @@ export default {
id: uuidv4(), id: uuidv4(),
title: 'Favori ajouté', title: 'Favori ajouté',
message: `${this.celestial.name} a été ajouté à la liste des favoris.`, message: `${this.celestial.name} a été ajouté à la liste des favoris.`,
link: {
text: 'Consultez vos favoris.',
url: '/favoris'
},
category: 'valid', category: 'valid',
timer: 3 timer: 3
}) })
@@ -99,6 +103,10 @@ export default {
id: uuidv4(), id: uuidv4(),
title: 'Favori retiré', title: 'Favori retiré',
message: `${this.celestial.name} a été retiré de la liste des favoris.`, message: `${this.celestial.name} a été retiré de la liste des favoris.`,
link: {
text: 'Consultez vos favoris.',
url: '/favoris'
},
category: 'valid', category: 'valid',
timer: 3 timer: 3
}) })

View File

@@ -6,6 +6,9 @@
<div class="toast-message"> <div class="toast-message">
<slot name="message" /> <slot name="message" />
</div> </div>
<div class="toast-link">
<slot name="link" />
</div>
</div> </div>
</template> </template>
@@ -62,11 +65,23 @@ export default defineComponent({
animation: fadeIn 1s cubic-bezier(0.175, 1, 0.32, 1), animation: fadeIn 1s cubic-bezier(0.175, 1, 0.32, 1),
slideFromRight 1s cubic-bezier(0.175, 1, 0.32, 1); slideFromRight 1s cubic-bezier(0.175, 1, 0.32, 1);
overflow: hidden; overflow: hidden;
.toast-title { .toast-title {
margin-bottom: 5px; margin-bottom: 5px;
font-size: 16px; font-size: 16px;
font-weight: $fw-bold; font-weight: $fw-bold;
} }
.toast-link {
a {
color: $primary-xxlight;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
&:after { &:after {
position: absolute; position: absolute;
display: block; display: block;
@@ -78,6 +93,7 @@ export default defineComponent({
height: 6px; height: 6px;
background: rgba($fs-black, 33%); background: rgba($fs-black, 33%);
} }
&.info { &.info {
background-color: $info; background-color: $info;
} }
@@ -91,6 +107,7 @@ export default defineComponent({
&.danger { &.danger {
background-color: $danger; background-color: $danger;
} }
&.closing { &.closing {
animation: fadeOut 1.2s cubic-bezier(0.175, 1, 0.32, 1), animation: fadeOut 1.2s cubic-bezier(0.175, 1, 0.32, 1),
slideFromLeft 1.2s cubic-bezier(0.175, 1, 0.32, 1); slideFromLeft 1.2s cubic-bezier(0.175, 1, 0.32, 1);

View File

@@ -8,6 +8,11 @@
<template #message> <template #message>
{{ toast.message }} {{ toast.message }}
</template> </template>
<template #link>
<nuxt-link :to="toast.link.url">
{{ toast.link.text }}
</nuxt-link>
</template>
</toast-card> </toast-card>
</div> </div>
</div> </div>

View File

@@ -8,6 +8,7 @@
<span class="txt-capitalize">- {{ celestial.type }}</span> <span class="txt-capitalize">- {{ celestial.type }}</span>
</h1> </h1>
</header> </header>
<div class="section-content"> <div class="section-content">
<div class="celestial-body"> <div class="celestial-body">
<div> <div>
@@ -18,11 +19,12 @@
Orbite autour de Orbite autour de
<nuxt-link <nuxt-link
:to="`/astres/${celestial.aroundPlanet.planet}`" :to="`/astres/${celestial.aroundPlanet.planet}`"
class="txt-capitalize" class="txt-capitalize fs-link"
> >
{{ celestial.aroundPlanet.planet }} {{ celestial.aroundPlanet.planet }}
</nuxt-link> </nuxt-link>
</p> </p>
<p v-if="celestial.discoveredBy"> <p v-if="celestial.discoveredBy">
Découvert par {{ celestial.discoveredBy }} le {{ celestial.discoveryDate }} Découvert par {{ celestial.discoveredBy }} le {{ celestial.discoveryDate }}
</p> </p>
@@ -30,10 +32,12 @@
<p>Facteur Densité : {{ celestial.density }}</p> <p>Facteur Densité : {{ celestial.density }}</p>
<p>Inclinaison : {{ celestial.inclination }}</p> <p>Inclinaison : {{ celestial.inclination }}</p>
</div> </div>
<div v-if="celestial.moons" class="celestial-moons"> <div v-if="celestial.moons" class="celestial-moons">
<h2 class="heading-2"> <h2 class="heading-2">
Astres orbitant {{ celestial.name }} Astres orbitant {{ celestial.name }}
</h2> </h2>
<celestials-list :celestials="celestial.moons" :has-filters="false" /> <celestials-list :celestials="celestial.moons" :has-filters="false" />
</div> </div>
</div> </div>
@@ -78,15 +82,5 @@ export default {
&:after { &:after {
background-image: url("/celestials_bg-min.jpg"); background-image: url("/celestials_bg-min.jpg");
} }
.celestial-body {
a {
color: $primary-xxlight;
text-decoration: underline;
&:hover {
color: $primary-xlight;
}
}
}
} }
</style> </style>