资讯专栏INFORMATION COLUMN

electron仿制百度网盘客户端2(登录界面制作)

刘东 / 1578人阅读

摘要:效果预览尺寸测量百度网盘客户端的尺寸是主界面顶部开始制作下载安装制作登录界面首先将主界面隐藏掉只需要在主进程里面设置就可以了之后制作一个登录界面创建一个在主进程之中引入代码创建路由创建登录界面样式代码微软雅黑图标下载去阿里

效果预览

尺寸测量

百度网盘客户端的尺寸是:
主界面 w:662px h:442px
顶部header h:75px bg:#EFF2F6

开始制作 下载安装electron-vue

制作登录界面

首先将主界面 mainWindow 隐藏掉 只需要在主进程index.js 里面设置show: false就可以了
之后制作一个登录界面
创建一个login.js 在主进程index.js之中引入
login.js 代码

import {BrowserWindow} from "electron"

let loginWindow = null;

const loginUrl = process.env.NODE_ENV === "development" ? `http://localhost:9080/#/login` : `file://${__dirname}/index.html/#/login`;

function createLoginWindow() {
    loginWindow = new BrowserWindow({
        width: 662,
        height: 442,
        useContentSize: true,
        frame: false,
        resizable: false
    });

    loginWindow.setMenu(null);

    loginWindow.loadURL(loginUrl);
}

createLoginWindow();
创建login路由
  {path: "/login", name: "login", component: () => import("@/view/login")},
创建登录界面
样式代码
    * {
        padding: 0;
        margin: 0;
    }

    .login {
        width: 662px;
        height: 442px;
        border: 1px solid #999999;
        font-family: "微软雅黑";
        -webkit-user-select: none;
    }

    header {
        height: 75px;
        background-color: #EFF2F6;
        -webkit-app-region: drag;
        position: relative;
    }
图标下载

去阿里矢量素材中心下载一致的图标, 耐心掉 因为有时候很难找到一样的!
下载完毕之后丢到 assets/fonts目录下
在 login.vue中引入

import "./assets/fonts/iconfont.css"
头部制作 头部代码
头部样式
    header {
        height: 75px;
        background-color: #EFF2F6;
        -webkit-app-region: drag;
        position: relative;
    }

    header .logo {
        width: 140px;
        height: 75px;
        background: url("../../assets/img/logo@2x.png") no-repeat 0 20px;
        background-size: 140px 33px;
        margin: 0 auto;
    }

    header .menu {
        width: 100px;
        height: 30px;
        position: absolute;
        right: 0;
        top: 0;
        text-align: right;
        padding-top: 8px;
        padding-right: 8px;
    }

    header .menu span {
        display: inline-block;
        width: 22px;
        height: 22px;
        margin-left: 5px;
        cursor: pointer;
        text-align: center;
        line-height: 22px;
    }
左侧扫码 模板代码
 

扫一扫登录

请使用xxxxxApp扫码登录

刷新二维码
样式
 main {
        height: 365px;
        padding-top: 30px;
        background: #FFFFFF;
    }

    main .scan p.title {
        text-align: center;
        font-size: 14px;
        color: #666666;
        font-weight: normal;
        margin-top: 30px;
    }

    .scan p.title i {
        display: inline-block;
        font-style: normal;
        margin-right: 5px;
        margin-left: 5px;
        color: #398CFF;
        cursor: pointer;
    }

    .scan p.title i:hover {
        border-bottom: 1px solid #398CFF;
    }

    main .scan h2 {
        text-align: center;
        font-size: 16px;
        font-weight: normal;
    }

    main .scan h2 i {
        margin-right: 5px;
        font-size: 14px;
    }

    .scan .qrcode {
        width: 154px;
        height: 154px;
        margin: 20px auto 0 auto;
        padding: 10px;
        border-radius: 3px;
        border: 1px solid #ECEDEE;
    }

    .scan .qrcode img {
        width: 100%;
        height: 100%;
    }

    .scan span.refresh {
        display: block;
        width: 94px;
        height: 30px;
        border: 1px solid #BAD4FD;
        margin: 22px auto 0 auto;
        font-size: 12px;
        text-align: center;
        line-height: 30px;
        cursor: pointer;
        border-radius: 4px;
        color: #3482F9;
    }
右侧表单 模板代码
  
样式代码
.form {
        padding-right: 30px;
        padding-left: 10px;
    }

    .form .validate_msg {
        height: 37px;
    }

    .form .header {
        display: flex;
    }

    .form .header i {
        font-style: normal;
        color: #3482F9;
        cursor: pointer;
        margin-left: auto;
        font-size: 12px;
    }

    .form input, .form button {
        outline: none;
    }

    .form input.text {
        height: 40px;
        width: 290px;
        border: 1px solid #C7C7C7;
        padding-left: 35px;
        border-radius: 1px;
    }

    .form .form_item {
        margin-bottom: 16px;
        position: relative;
    }
    .form .form_item:nth-last-child(2){
        /*margin-bottom: 10px;*/
    }

    .form .form_item i {
        position: absolute;
        font-size: 16px;
        top: 12px;
        left: 10px;
        color: #000000;
    }

    .form .form_options {
        display: flex;
    }

    .form .form_options i {
        margin-left: auto;
        font-style: normal;
        font-size: 12px;
        color: #3482F9;
        cursor: pointer;
        position: relative;
        top:3px;
    }

    .form .form_options i:hover {
        text-decoration: underline;
    }

    .login_options .option_item {
        display: inline-block;
        width: 13px;
        height: 13px;
        margin-right: 5px;
        position: relative;
        border: 1px solid #B3B3B3;
        vertical-align: middle;
        cursor: pointer;
        top: -1px;
    }

    .login_options .option_item input {
        opacity: 0;
    }

    .login_options span.text {
        display: inline-block;
        margin-right: 14px;
        font-size: 13px;
    }

    .login_options .option_item span.checked {
        position: absolute;
        top: -5px;
        right: -1px;
        font-weight: bold;
        display: inline-block;
        width: 13px;
        height: 13px;
        cursor: pointer;
    }

    .form_options label {
        cursor: pointer;
    }

    .option_item span.checked img {
        width: 100%;
        height: 100%;
    }

    input[type="checkbox"] + span {
        opacity: 0;
    }

    input[type="checkbox"]:checked + span {
        opacity: 1;
    }

    button.submit {
        margin-top: 25px;
        width: 100%;
        height: 38px;
        background-color: #398CFF;
        color: #FFFFFF;
        border:none;
        border-radius: 3px;
        font-size: 16px;
        font-family: 微软雅黑;
    }

    .form .footer{
        display: flex;
        position: absolute;
        bottom: 15px;
        width:300px;
    }

    .form .footer i.register{
        font-style: normal;
        font-size: 13px;
        color: #3482F9;
        cursor: pointer;

    }
    .form .footer i.register:hover{
        text-decoration: underline;
    }
    .form .footer div{
        margin-left: auto;
        color:#5D9BFA;
    }
    .form .footer div i{
        display: inline-block;
        margin-left: 10px;
        width:20px;
        height: 20px;
        text-align: center;
        line-height: 20px;
        cursor: pointer;
        font-size: 18px;
    }
    .form .footer div i:hover{
        background-color: #EBF3FF;
    }
完结

到这里就完成了,没有制作短信登录的界面!

声明:

本项目只用于学习使用,请不要用于商业用途,项目中使用的百度网盘的Logo只作为学习使用!

下载代码

github: https://github.com/lihaotian0...
码云地址: https://gitee.com/leehaotian/...
qq群: 814270669

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/98639.html

相关文章

  • electron 仿制QQ登录界面

    摘要:首先来看看的登录界面准备开发制作一个窗口先主进程代码暂时调用界面基本布局我们先大概做一个这样的界面页面代码样式代码取消全部的外边距和内边距设置窗口的样式设置手型加一个边框调试样式最后要删除或者更改设置宽度必须要和主进程中设置的一样不能大于主 首先来看看qq的登录界面:showImg(https://segmentfault.com/img/bVbiu16?w=483&h=458); 准...

    youkede 评论0 收藏0
  • electron制作聊天界面(仿制qq)

    摘要:将炙啖朱亥,持觞劝侯嬴。三杯吐然诺,五岳倒为轻眼花耳热后,意气素霓生。救赵挥金槌,邯郸先震惊。千秋二壮士,烜赫大梁城。纵死侠骨香,不惭世上英。谁能书阁下,白首太玄经。是唐代大诗人李白借乐府古题创作的一首诗。 效果图:showImg(https://segmentfault.com/img/bVbj3Yd?w=1215&h=735); 样式使用scss和flex布局 这也是制作IM系统的...

    LucasTwilight 评论0 收藏0

发表评论

0条评论

刘东

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<