<script setup>
import { getImageUrl } from '@/utils/function.js'
const props=defineProps({
  imgUrl:{
    type:String,
    default:''
  },
  title:{
    type:String,
    default:''
  },
  content:{
    type:String,
    default:''
  },
  time:{
    type:String,
    default:''
  }
})
</script>

<template>
<div class="item">
  <div class="time">{{time}}</div>
  <img :src="getImageUrl(imgUrl)" alt="动态">
  <div class="content">
    <h1>{{title}}</h1>
    <p>{{content}}</p>
  </div>
</div>
</template>

<style scoped lang="less">
.item{
  width: 457px;
  height: 573px;
  border-radius: 20px;
  box-shadow: 0 6px 25.4px 0 #DBE4F0FC;
  background-color: #FFFFFF;
  overflow: hidden;
  position: relative;
  .time{
    position: absolute;
    top: 20px;
    left: 20px;
    font-weight: 400;
    color: #fff;
    z-index: 10;
    background-color: #00000080;
    border-radius: 71px;
    width: 167px;
    height: 38px;
    text-align: center;
    font-size: 20px;
    line-height: 38px;
    letter-spacing: 0.03em;

  }
  img{
    width: 100%;
    height: 395.02734375px;
    object-fit: cover;
  }
  .content{
    padding: 20px;
  }
  h1{
    font-weight: 500;
    font-size: 30px;
    line-height: 100%;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
  }
  p{
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5em;
    letter-spacing: 0.03em;
    padding: 10px;
  }
}
</style>
