From 21e0028ed35e957db261e047789b5c3805634032 Mon Sep 17 00:00:00 2001 From: printempw Date: Thu, 21 Jan 2016 19:03:39 +0800 Subject: [PATCH] add alert for msg in query string of index.php and fixed some shit --- assets/css/style.css | 51 +++++++++++++++++----------------------- assets/js/index.utils.js | 14 ++++++++--- index.php | 47 +++++++++++++++++++++++++++++++++--- 3 files changed, 76 insertions(+), 36 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 611a9d98..f1555252 100755 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-01-21 07:57:38 * @Last Modified by: prpr -* @Last Modified time: 2016-01-21 18:20:11 +* @Last Modified time: 2016-01-21 19:01:48 */ @font-face { @@ -31,7 +31,6 @@ body { /* for firefox */ white-space: normal; } - .home-menu .pure-menu-heading { color: #5e5e5e; font-weight: 400; @@ -42,15 +41,16 @@ body { .pure-menu-heading:hover { color: #444; } - -.home-menu .pure-menu-selected a { - color: #5e5e5e; -} - .home-menu a { color: #fff; font-size: 15px; } +.pure-menu-selected { + font-weight: bold; +} +.pure-menu-link { + color: #5e5e5e !important; +} .pure-menu-link:hover, .pure-menu-link:focus { background: none; @@ -101,6 +101,20 @@ body { left: 0; position: fixed !important; } +.container .pure-button { + color: white; + padding: 0.8em 2.5em; + border-radius: 5px; + background: transparent; + border: 1px solid #fff; + font-size: 120%; + transition: color 0.25s ease-in-out, + border-color 0.25s ease-in-out, + background-color 0.25s ease-in-out; +} +.container .pure-button:hover { + background-color: rgba(255, 255, 255, 0.2); +} .splash { width: 80%; @@ -110,7 +124,6 @@ body { top: 100px; left: 0; bottom: 0; right: 0; text-align: center; } - .splash-head { font-size: 20px; font-weight: bold; @@ -125,32 +138,12 @@ body { 0px 8px 13px rgba(0,0,0,0.1), 0px 18px 23px rgba(0,0,0,0.1); } - .splash-subhead { letter-spacing: 0.05em; margin-top: 0.8em; margin-bottom: 1.5em; } -.container .pure-button { - color: white; - padding: 0.8em 2.5em; - border-radius: 5px; - background: transparent; - border: 1px solid #fff; - font-size: 120%; - transition: color 0.25s ease-in-out, - border-color 0.25s ease-in-out, - background-color 0.25s ease-in-out; -} - -.container .pure-button:hover { - background-color: rgba(255, 255, 255, 0.2); -} -/*.container a.pure-button-primary { - -}*/ - .footer { color: #fff; position: absolute; @@ -159,12 +152,10 @@ body { text-align: center; letter-spacing: 0.05em; } - .footer a { text-decoration: none; color: white; } - .footer a:hover { color: #1f8dd6; } diff --git a/assets/js/index.utils.js b/assets/js/index.utils.js index ec233551..dafee983 100644 --- a/assets/js/index.utils.js +++ b/assets/js/index.utils.js @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-01-21 13:55:44 * @Last Modified by: prpr -* @Last Modified time: 2016-01-21 18:18:37 +* @Last Modified time: 2016-01-21 18:47:03 */ 'use strict'; @@ -11,6 +11,14 @@ function showMsg(type, msg) { $("[id=msg]").removeClass().addClass("alert").addClass(type).html(msg); } +$('#login').click(function(){ + $('[data-remodal-id=login-modal]').remodal().open(); +}) + +$('#register').click(function(){ + $('[data-remodal-id=register-modal]').remodal().open(); +}) + // Login Button Click Event $("body").on("click", "#login-button", function(){ var uname = $("#uname").val(); @@ -34,7 +42,7 @@ $("body").on("click", "#login-button", function(){ docCookies.setItem("token", json.token, 604800, '/'); } showMsg("alert-success", "Logging succeed!"); - window.setTimeout("window.location = './user/index.php'", 1000); + window.setTimeout("$('[data-remodal-id=login-modal]').remodal().close(); window.location = './user/index.php'", 1000); } else { showMsg("alert-danger", json.msg); } @@ -59,7 +67,7 @@ $("body").on("click", "#register-button", function(){ success: function(json) { if (json.errno == 0) { showMsg("alert-success", json.msg); - window.setTimeout("window.location = './index.php?action=login&msg=Successfully Registered, please log in.'", 1000); + window.setTimeout("$('[data-remodal-id=register-modal]').remodal().close(); window.location = './index.php?action=login&msg=Successfully Registered, please log in.'", 1000); } else { showMsg("alert-danger", json.msg); } diff --git a/index.php b/index.php index 9e1ac799..337be201 100755 --- a/index.php +++ b/index.php @@ -1,3 +1,30 @@ + getToken()) { + $_SESSION['uname'] = $_COOKIE['uname']; + $_SESSION['token'] = $user -> getToken(); + } +} +function getValue($key, $array) { + if (array_key_exists($key, $array)) { + return $array[$key]; + } + return false; +} +?> @@ -20,7 +47,12 @@ Home
  • - Sign In + + Welcome, + + Sign In +
  • @@ -37,9 +69,12 @@

    Just a simple open-source Minecraft skin server

    +

    - Sign Up + Sign Up

    +
    @@ -79,6 +114,12 @@ - + +
    +

    +
    + +