Permalink
Browse files

some UI changes.

  • Loading branch information...
1 parent 40c5c85 commit a38370845aabd73699dfb14410cf8ee3a9521aa6 @winbomb committed Jul 20, 2012
Showing with 22 additions and 8 deletions.
  1. BIN resources/login_bg.png
  2. +1 −1 resources/main.css
  3. +1 −0 resources/page.css
  4. +11 −4 src/login.opa
  5. +9 −3 src/page.opa
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -76,7 +76,7 @@ button {
margin: 0 auto;
position: relative;
width:340px;
- height: 230px;
+ height: 240px;
top: 350px;
color: #ebebeb;
font: 12px Arial, Helvetica, sans-serif;
View
@@ -25,6 +25,7 @@ body {
.tb_game_list {
background: #d7d7d7;
width: 480px;
+ height: 398px;
border: 1px solid black;
}
View
@@ -39,7 +39,6 @@ type Player.status = {online}
type Login.user = {unlogged} or {Player.t user};
-module Login {
state = UserContext.make({unlogged})
function get_user(){
@@ -51,7 +50,7 @@ module Login {
}
function logout(){
- UserContext.change(function(_){{unlogged}},state)
+ UserContext.remove(state)
}
function is_logged_in(){
@@ -60,6 +59,8 @@ module Login {
case {user:_}: {true}
}
}
+
+module Login {
function get_agent(user_compat){
match(user_compat.environment){
@@ -103,7 +104,7 @@ module Login {
}
function login_view(){
- Resource.styled_page("Mahjong", ["/resources/main.css"],
+ Resource.styled_page("China Mahjong", ["/resources/main.css"],
<>
<div id="container" onready={function(_){page_ready()}}>
<div id="content">
@@ -114,7 +115,13 @@ module Login {
<button class="btn btn-primary btn-large" style="margin-top:10px" onclick={function(_){attempt_login()}}>Play</button>
<hr style="margin-bottom:5px">
<p>Note: This game need HTML5 canvas support, please use IE9+, Firefox4+, Chrome10+, Opera11+, Safari5+</p>
- <p>Mahjong Rule: <a href="/how_to_play.html" target="_blank">How to play mahjong</a></p>
+ <div style="padding:0px 5px">
+ <button class="btn btn-info" style="float:left;width:60px;"
+ onclick={function(_){Tutor.show_tutor()}}>Tutorial</button>
+ <button class="btn btn-info" style="width:120px">Add to Chrome</button>
+ <a class="btn btn-info" style="float:right;width:105px;"
+ href="https://github.com/winbomb/mahjong" target="_blank">Fork on Github</a>
+ </div>
</div>
</div>
<div id="footer">
View
@@ -88,18 +88,24 @@ module Page {
}}
}
+ function leave(){
+ logout();
+ Client.goto("/login");
+ }
+
function game_list_view(){
- Resource.styled_page("Welcome",["/resources/page.css"],
+ Resource.styled_page("Welcome to play China Mahjong",["/resources/page.css"],
<>
<div class="dragon_bg"></div>
<div id="game_list" onready={function(_){ page_ready()}} >
- <div class="title"><h2>Welcome xxxx </h2></div>
+ <div class="title"><h2>{get_username()}</h2></div>
<div class="quick-start">
<input type="button" class="btn btn-primary" value="Play With Bots"
onclick={function(_){join_game({true})}}/>
<input type="button" class="btn btn-primary" value="Quick Start"
onclick={function(_){join_game({false})}}/>
- <input type="button" class="btn btn-primary" value="Leave"/>
+ <input type="button" class="btn btn-primary" value="Leave"
+ onclick={function(_){leave()}}/>
</div>
<div class="game_list_pannel">
<table class="tb_game_list">

0 comments on commit a383708

Please sign in to comment.