🎨 login

This commit is contained in:
Van 2019-05-17 11:29:15 +08:00
parent 8b0b1503c3
commit ade8fa8892
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
5 changed files with 15 additions and 90 deletions

View File

@ -1,6 +1,6 @@
# [Wide](https://github.com/b3log/wide) [![Build Status](https://img.shields.io/travis/b3log/wide.svg?style=flat)](https://travis-ci.org/b3log/wide) [![Go Report Card](https://goreportcard.com/badge/github.com/b3log/wide)](https://goreportcard.com/report/github.com/b3log/wide) [![Coverage Status](https://img.shields.io/coveralls/b3log/wide.svg?style=flat)](https://coveralls.io/r/b3log/wide) [![Apache License](https://img.shields.io/badge/license-apache2-orange.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) [![API Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/b3log/wide) [![Download](https://img.shields.io/badge/download-~4.3K-red.svg?style=flat)](https://pan.baidu.com/s/1dD3XwOT)
先试试我们搭建好的[在线服务](https://wide.b3log.org/signup),你可以在这里[下载](https://pan.baidu.com/s/1dD3XwOT)并在本地环境运行,然后邀请小伙伴们来玩吧!
先试试我们搭建好的[在线服务](https://wide.b3log.org),你可以在这里[下载](https://pan.baidu.com/s/1dD3XwOT)并在本地环境运行,然后邀请小伙伴们来玩吧!
## 简介

View File

@ -187,9 +187,6 @@ button {
.ico-report:before {
content: "\e605";
}
.ico-signup:before {
content: "\e606";
}
.ico-git:before {
content: "\e624";
}

View File

@ -14,6 +14,12 @@
* limitations under the License.
*/
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
.wrapper {
margin: 0 auto;
width: 980px;
@ -50,9 +56,10 @@
.content {
border-top: 1px solid #A4A4A4;
border-bottom: 1px solid #919191;
background-color: #202021;
height: 632px;
padding-top: 222px;
background-color: #3b3e43;
flex: 1;
display: flex;
align-items: center;
}
.content h2 {
@ -62,7 +69,7 @@
}
.content h3 {
color: #4183c4;
color: #4285f4;
font-size: 21px;
}

View File

@ -293,17 +293,6 @@
</ul>
</div>
</li>
<li>
<span>{{.i18n.team}}</span>
<div class="frame">
<ul>
<li class="signup" onclick="window.open('/signup')">
<span class="ico-signup font-ico"></span>
<span>{{.i18n.sign_up}}</span>
</li>
</ul>
</div>
</li>
<li onclick="menu.openPreference()">
<span>{{.i18n.preference}}</span>
</li>

View File

@ -8,21 +8,20 @@
<meta name="description" content="A Web-based Go IDE , do your development anytime, anywrhere."/>
<meta name="author" content="B3log">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/base.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/sign.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="/static/css/base.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="/static/css/sign.css?{{.conf.StaticResourceVersion}}">
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
</head>
<body>
<div class="header">
<div class="wrapper fn-clear">
<a href="/login" rel="login">
<img title="A Web-based Go IDE" src="{{.conf.StaticServer}}/static/images/wide-logo.png" class="logo"/></a>
<img title="A Web-based Go IDE" src="/static/images/wide-logo.png" class="logo"/></a>
<ul class="fn-right">
<li><a href="/playground" target="_blank" style="color: #cd504a">Play</a></li>
<li><a rel="bookmark" href="https://github.com/b3log/wide" target="_blank">GitHub</a></li>
<li><a rel="help" href="https://hacpai.com/article/1538873544275" target="_blank">{{.i18n.help}}</a></li>
<li><a rel="bookmark" href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.issues}}</a></li>
<li><button class="btn" onclick="window.location.href = '/signup'">{{.i18n.sign_up}}</button></li>
</ul>
</div>
</div>
@ -50,72 +49,5 @@
<iframe src="https://ghbtns.com/github-btn.html?user=b3log&repo=wide&type=star&count=true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
</div>
</div>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery.form.js"></script>
<script type="text/javascript">
(function () {
var contentH = $(window).height() - $(".footer").height() - $(".header").height() - 18;
$(".content").outerHeight(contentH)
.css("padding-top", (contentH - $(".content .fn-left").height()) / 2 + "px");
$('#loginForm').submit(function () {
var options = {
url: '/login',
type: 'POST',
dataType: 'json',
beforeSubmit: function () {
var username = $.trim($("#username").val());
var password = $.trim($("#password").val());
if (username === "") {
$("#msg").text("{{.i18n.login_error}}").show();
$("#username").focus();
return false;
} else if (password === "") {
$("#msg").text("{{.i18n.login_error}}").show();
$("#password").focus();
return false;
}
},
success: function (result) {
if (!result.succ) {
$("#msg").text('{{.i18n.login_error}}').show();
return;
}
window.location.href = "/";
}
};
$('#loginForm').ajaxSubmit(options);
return false;
});
$("#username").keydown(function (event) {
if (event.which === 13) {
if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.login_error}}").show();
} else {
$("#password").focus();
return false;
}
} else {
$("#msg").hide();
}
}).focus();
$("#password").keydown(function (event) {
if (event.which === 13) {
if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.login_error}}").show();
}
} else {
$("#msg").hide();
}
});
})();
</script>
</body>
</html>