<template>
  <div class="card-wrapper" :class="{ 'no-bg': noBg }">
    <div class="card-title">
      <p>
        {{ title }}
      </p>
    </div>
    <div class="card-content">
      <span class="border" />
      <span class="border" />
      <slot />
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue'

export default defineComponent({
  name: 'Mode1',
  props: {
    title: {
      type: String as PropType<string>,
      required: true,
    },
    noBg: {
      type: Boolean as PropType<boolean>,
      default: false,
    },
  },
})
</script>

<style scoped lang="stylus">
@import '../main.styl'
.card-wrapper
  &.no-bg
    .card-title
      margin-bottom 0
    .card-content
      background transparent
  .card-title
    display flex
    align-items center
    background linear-gradient(to right, rgba(59,85,102,.8), transparent)
    position relative
    border-bottom .01rem solid rgba(105,110,114,.15)
    margin-bottom .05rem
    &:before
      content ''
      display block
      position absolute
      left 0
      width .02rem
      height 60%
      background #FADB71
    >p
      color $card-title-color
      font-size $card-title-size
      font-weight bold
      margin 0
      margin-left .1rem
  .card-content
    position relative
    box-sizing border-box
    background rgba(105,110,114,.15)
    padding .05rem .08rem
    &.no-bg
      background transparent
    >.border
      display block
      position absolute
      top 0
      left 0
      bottom 0
      width .01rem
      &:nth-of-type(2)
        left auto
        right 0
    >div
      $full()
</style>
