项目开发日志(登录界面):2. LoginTitle组件

本文详细介绍了LoginTitle组件的结构,包括welcomeTitle和mainTitle属性,以及使用Less编写的样式,如主题颜色、图标动画等。
摘要由CSDN通过智能技术生成

LoginTitle组件

        样式

        说明

                属性

属性名含义类型是否必填默认值
welcomeTitle欢迎标语String
mainTitle标题String

                样式

                        @mainColor -> 主题颜色

        代码

<template>
    <div class="logintitle-container">
        <p class="subtitle">{{ welcomeTitle }}</p>
        <h1>
            <span>{{ mainTitle }}</span>
        </h1>
        <p class="icon-box">
            <i></i>
            <i></i>
        </p>
    </div>
</template>

<script>

export default {
    props:{
        welcomeTitle:{
            type:String,
            require:true,
        },
        mainTitle:{
            type:String,
            require:true,
        },
    },
}
</script>

<style lang="less" scoped>
@import url("~@/styles/init.less");
    .logintitle-container{
        width: 100%;
        flex-direction: column;
        text-align: left;
        position: relative;
    }
    .subtitle {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    h1 {
        position: relative;
        display: inline-block;
    }

    h1 span {
        z-index: 1;
        position: relative;

    }

    h1::after {
        width: 59%;
        height: 0.7rem;
        position: absolute;
        content: "";
        z-index: 0;
        right: -1.5rem;
        top: 2rem;
        transition: all 0.3s;
        background-color: @mainColor;
    }

    .icon-box {
        width: 100%;
        display: flex;
        justify-content: end;

        i:nth-child(1) {
            margin-right: 0.45rem;
        }

        i:nth-child(2) {
            margin-right: 0.7rem;
        }

        i:nth-child(1)::before {
            display: flex;
            content: "";
            width: 0.813rem;
            height: 1rem;
            transform-origin: left top;
            transform: skew(35deg);
            transition: all 0.3s;
            background-color: @mainColor;
        }

        i:nth-child(1)::after {
            display: flex;
            content: "";
            width: 0.813rem;
            height: 1rem;
            transform-origin: left bottom;
            transform: skew(-35deg);
            transition: all 0.3s;
            background-color: @mainColor;
        }

        i:nth-child(2)::before {
            display: flex;
            content: "";
            width: 0.813rem;
            height: 1rem;
            background-color: #efefef;
            transform-origin: left top;
            transform: skew(35deg);
            transition: all 0.3s;
        }

        i:nth-child(2)::after {
            display: flex;
            content: "";
            width: 0.813rem;
            height: 1rem;
            background-color: #efefef;
            transform-origin: left bottom;
            transform: skew(-35deg);
            transition: all 0.3s;
        }
    }
</style>

        页面参考:yostar通行证

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

博丽七七

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值