123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <div class="video-card" >
- <div class="img-box">
- <img :src="cardData.imgUrl">
- <i @click="cardClick"></i>
- </div>
- <h4 v-if="cardData.title">{{cardData.title}}</h4>
- <p v-if="cardData.des">{{cardData.des}}</p>
- </div>
- </template>
- <script>
- export default {
- name: "videoCard",
- props: {
- cardData: {
- type: Object,
- default: () => ({})
- }
- },
- methods: {
- cardClick() {
- this.$emit('card-click', this.cardData)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .video-card {
- width: 370px;
- height: 210px;
- .img-box {
- position: relative;
- background: greenyellow;
- width: inherit;
- height: inherit;
- overflow: hidden;
- img {
- width: 100%;
- height: 100%;
- transition: all .5s ease;
- }
- &:hover{img{transform: scale(1.1);}}
- i {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-30px,-30px);
- display: inline-block;
- width: 60px;
- height: 60px;
- background-image: url("~static/images/client/course/course-video-icon.svg");
- background-repeat: no-repeat;
- cursor: pointer;
- }
- }
- h4 {
- font-size: 24px;
- font-weight: 800;
- color: #333;
- text-align: center;
- margin-top: 25px;
- }
- p {
- font-size: 16px;
- font-weight: 500;
- color: #333;
- text-align: center;
- margin-top: 25px;
- }
- }
- @media (max-width: 768px) {
- .video-card {
- width: 100%;
- height: 100%;
- .img-box {
- position: relative;
- background: greenyellow;
- width: inherit;
- height: inherit;
- overflow: hidden;
- img {
- width: 100%;
- min-height: 160px;
- transition: all .5s ease;
- }
- }
- h4 {
- font-size: 16px;
- font-weight: 800;
- color: #333;
- text-align: center;
- margin-top: 15px;
- }
- p {
- font-size: 12px;
- font-weight: 500;
- color: #333;
- text-align: center;
- margin-top: 15px;
- }
- }
- }
- </style>
|