项目开发日志(登录界面):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通行证

相关推荐
ai小鬼头28 分钟前
百度秒搭发布:无代码编程如何让普通人轻松打造AI应用?
前端·后端·github
漂流瓶jz28 分钟前
清除浮动/避开margin折叠:前端CSS中BFC的特点与限制
前端·css·面试
前端 贾公子30 分钟前
在移动端使用 Tailwind CSS (uniapp)
前端·uni-app
散步去海边31 分钟前
Cursor 进阶使用教程
前端·ai编程·cursor
清幽竹客32 分钟前
vue-30(理解 Nuxt.js 目录结构)
前端·javascript·vue.js
weiweiweb88833 分钟前
cesium加载Draco几何压缩数据
前端·javascript·vue.js
幼儿园技术家34 分钟前
微信小店与微信小程序简单集成指南
前端
我不吃饼干9 天前
鸽了六年的某大厂面试题:你会手写一个模板引擎吗?
前端·javascript·面试
涵信9 天前
第一节 布局与盒模型-Flex与Grid布局对比
前端·css
我不吃饼干9 天前
鸽了六年的某大厂面试题:手写 Vue 模板编译(解析篇)
前端·javascript·面试