2022-08-08 17:49:35 -04:00
|
|
|
<script setup lang="ts">
|
2022-08-09 15:37:32 -04:00
|
|
|
import type { Color, ViewportLength } from "csstype";
|
|
|
|
|
|
|
|
// fix ReferenceError: _unref is not defined
|
|
|
|
// https://github.com/nuxt/framework/issues/5546
|
|
|
|
import { unref as _unref } from "vue";
|
2022-08-08 17:49:35 -04:00
|
|
|
|
2022-08-09 11:43:20 -04:00
|
|
|
const {
|
|
|
|
href,
|
|
|
|
color = "pink",
|
2022-08-09 16:25:23 -04:00
|
|
|
darkcolor = "#c88994",
|
2022-08-09 11:43:20 -04:00
|
|
|
title,
|
|
|
|
clearstyles = false,
|
2022-08-09 15:37:32 -04:00
|
|
|
forceheight,
|
2022-08-09 11:43:20 -04:00
|
|
|
} = defineProps<{
|
2022-08-08 17:49:35 -04:00
|
|
|
href?: string;
|
|
|
|
color?: Color;
|
2022-08-09 16:25:23 -04:00
|
|
|
darkcolor?: Color;
|
2022-08-08 17:49:35 -04:00
|
|
|
title?: string;
|
2022-08-09 11:43:20 -04:00
|
|
|
clearstyles?: boolean;
|
2022-08-09 15:37:32 -04:00
|
|
|
forceheight?: ViewportLength<"rem">;
|
2022-08-08 17:49:35 -04:00
|
|
|
}>();
|
2022-08-09 11:43:20 -04:00
|
|
|
|
|
|
|
const padding = clearstyles ? "0" : "1rem";
|
2022-08-09 15:37:32 -04:00
|
|
|
const height = forceheight ?? "auto";
|
2022-08-08 17:49:35 -04:00
|
|
|
</script>
|
2022-07-22 16:08:55 -04:00
|
|
|
|
2022-07-22 15:32:00 -04:00
|
|
|
<template>
|
2022-08-09 15:37:32 -04:00
|
|
|
<a class="no-underline inline-block flex" :href="href">
|
2022-08-08 17:49:35 -04:00
|
|
|
<div class="container box">
|
|
|
|
<p class="m-0 w-full title">{{ title }}</p>
|
2022-08-08 18:41:29 -04:00
|
|
|
<div class="main-content">
|
|
|
|
<slot />
|
|
|
|
</div>
|
2022-08-08 17:49:35 -04:00
|
|
|
</div>
|
|
|
|
</a>
|
2022-07-22 15:32:00 -04:00
|
|
|
</template>
|
2022-07-22 16:08:55 -04:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.container {
|
2022-08-08 17:49:35 -04:00
|
|
|
/* make sure width is good for fullscreen 1080p,
|
|
|
|
* fullscreen 1080p at 1.25 scaling,
|
|
|
|
* mobile
|
|
|
|
*/
|
|
|
|
width: 28rem;
|
2022-08-09 15:37:32 -04:00
|
|
|
height: v-bind(height);
|
2022-08-08 17:49:35 -04:00
|
|
|
border: 0.5rem solid v-bind(color);
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
}
|
|
|
|
|
2022-08-09 16:25:23 -04:00
|
|
|
html.dark .container {
|
|
|
|
border: 0.5rem solid v-bind(darkcolor);
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:49:35 -04:00
|
|
|
.main-content {
|
2022-08-09 11:43:20 -04:00
|
|
|
padding: v-bind(padding);
|
2022-08-08 17:49:35 -04:00
|
|
|
padding-top: 0;
|
2022-08-09 15:54:17 -04:00
|
|
|
overflow-wrap: break-word;
|
2022-08-08 17:49:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
background: v-bind(color);
|
|
|
|
}
|
|
|
|
|
2022-08-09 16:25:23 -04:00
|
|
|
html.dark .title {
|
|
|
|
background: v-bind(darkcolor);
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:49:35 -04:00
|
|
|
@media screen and (max-width: 600px) {
|
|
|
|
.container {
|
2022-08-09 16:00:55 -04:00
|
|
|
width: 90vw;
|
2022-08-08 17:49:35 -04:00
|
|
|
}
|
2022-07-22 16:08:55 -04:00
|
|
|
}
|
|
|
|
</style>
|