hippofish/packages/client/src/components/MkInfo.vue

59 lines
948 B
Vue
Raw Normal View History

<template>
2023-05-29 15:11:42 +02:00
<div class="info" :class="{ warn, card }">
2023-04-08 02:01:42 +02:00
<i v-if="warn" class="ph-warning ph-bold ph-lg"></i>
2023-05-29 15:11:42 +02:00
<i v-else class="ph-bold ph-lg" :class="icon ? `ph-${icon}` : 'ph-info'"></i>
2023-04-08 02:01:42 +02:00
<slot></slot>
</div>
</template>
2022-09-06 11:09:17 +02:00
<script lang="ts" setup>
2023-04-08 02:01:42 +02:00
import {} from "vue";
2022-12-07 05:12:44 +01:00
defineProps<{
2023-05-29 15:11:42 +02:00
icon?: string;
2022-09-06 11:09:17 +02:00
warn?: boolean;
2023-05-29 15:11:42 +02:00
card?: boolean;
2022-09-06 11:09:17 +02:00
}>();
</script>
<style lang="scss" scoped>
2023-05-29 15:11:42 +02:00
.info {
padding: 16px;
font-size: 90%;
background: var(--infoBg);
color: var(--infoFg);
border-radius: var(--radius);
&.warn {
background: var(--infoWarnBg);
color: var(--infoWarnFg);
}
2023-05-29 15:11:42 +02:00
&.card {
background: var(--panel);
color: var(--fg);
padding: 48px;
font-size: 1em;
text-align: center;
> i {
display: block;
font-size: 4em;
margin: 0;
}
> :deep(*) {
margin-inline: auto;
}
> :deep(:not(:last-child)) {
margin-bottom: 20px;
}
> :deep(p) {
max-width: 30em;
}
}
> i {
margin-right: 4px;
}
}
</style>