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

LoginTitle组件

样式

说明

属性

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

样式

@mainColor -> 主题颜色

代码

javascript 复制代码
<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 分钟前
【前端性能优化全链路指南】从开发编写到构建运行的多维度实践
前端·性能优化
女生也可以敲代码23 分钟前
AI时代下的50道前端开发面试题:从基础到大模型应用
前端·面试
ZhengEnCi30 分钟前
M5-markconv自定义CSS样式指南 📝
前端·css·python
IT_陈寒1 小时前
SpringBoot自动配置的坑差点让我加班到天亮
前端·人工智能·后端
xingpanvip1 小时前
星盘接口开发文档:星相日历接口指南
android·开发语言·前端·css·php·lua
@PHARAOH1 小时前
WHAT - GitLens supercharged 插件
前端
TT模板1 小时前
苹果cms整合西瓜播放器XGplayer插件支持跳过片头尾
前端·html5
Wect2 小时前
React 性能优化精讲
前端·react.js·性能优化
追风筝的人er3 小时前
SpringBoot+Vue3 企业考勤如何处理法定假期?节假日方案、调休补班与工作日判断链路拆解
前端·vue.js·后端
无敌的黑星星3 小时前
Java8 CompletableFuture 实战指南
linux·前端·python