2022-05-21 21:10:00 +00:00
|
|
|
<template>
|
2022-05-22 16:15:42 +00:00
|
|
|
<a v-if="isExternal" target="_blank" rel="nofollow noreferrer" class="card" :href="to">
|
2022-05-22 15:57:52 +00:00
|
|
|
<p>{{ title }} →</p>
|
2022-05-21 21:10:00 +00:00
|
|
|
</a>
|
2022-05-22 16:35:47 +00:00
|
|
|
<NuxtLink v-else v-bind="$props" class="card">
|
2022-05-22 16:15:42 +00:00
|
|
|
<p>{{ title }} →</p>
|
2022-05-22 16:35:47 +00:00
|
|
|
</NuxtLink>
|
2022-05-21 21:10:00 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-05-22 16:15:42 +00:00
|
|
|
import { RouterLink } from 'vue-router';
|
|
|
|
|
2022-05-22 16:35:47 +00:00
|
|
|
|
2022-05-21 21:10:00 +00:00
|
|
|
export default {
|
2022-05-22 16:15:42 +00:00
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
to: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
...RouterLink.props,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isExternal() {
|
|
|
|
return (
|
|
|
|
typeof this.to === 'string' && this.to.startsWith('http')
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
2022-05-21 21:10:00 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.card {
|
|
|
|
margin: 1rem;
|
|
|
|
padding: 1.5rem;
|
|
|
|
text-align: left;
|
|
|
|
color: inherit;
|
|
|
|
text-decoration: none;
|
|
|
|
border: 2px solid #000;
|
2022-05-21 21:42:40 +00:00
|
|
|
border-radius: 20px;
|
2022-05-21 21:10:00 +00:00
|
|
|
transition: color 0.15s ease, border-color 0.15s ease;
|
|
|
|
}
|
2022-05-22 15:57:52 +00:00
|
|
|
.card p {
|
|
|
|
margin: 0;
|
|
|
|
font-size: 1.25rem;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
2022-05-21 21:10:00 +00:00
|
|
|
|
|
|
|
.card:link,
|
|
|
|
.card:visited {
|
|
|
|
color: #000;
|
|
|
|
}
|
|
|
|
|
|
|
|
.card:hover,
|
|
|
|
.card:focus,
|
|
|
|
.card:active {
|
|
|
|
color: #0070f3 !important;
|
|
|
|
border-color: #0070f3;
|
|
|
|
}
|
2022-05-21 21:42:40 +00:00
|
|
|
|
|
|
|
@media (max-width: 600px) {
|
|
|
|
.card {
|
|
|
|
margin: 0.5rem;
|
|
|
|
padding: 1.25rem;
|
|
|
|
width: 9rem;
|
|
|
|
}
|
|
|
|
}
|
2022-05-21 21:10:00 +00:00
|
|
|
</style>
|