diff --git a/admin/admin_ajax.php b/admin/admin_ajax.php index 26f579fb..070cdc5c 100644 --- a/admin/admin_ajax.php +++ b/admin/admin_ajax.php @@ -3,12 +3,11 @@ * @Author: prpr * @Date: 2016-02-04 13:53:55 * @Last Modified by: prpr - * @Last Modified time: 2016-02-04 18:09:26 + * @Last Modified time: 2016-02-04 18:42:22 */ session_start(); $dir = dirname(dirname(__FILE__)); require "$dir/includes/autoload.inc.php"; -require "$dir/config.php"; if(isset($_COOKIE['uname']) && isset($_COOKIE['token'])) { $_SESSION['uname'] = $_COOKIE['uname']; diff --git a/admin/index.php b/admin/index.php index eaf8464b..d1d0ede8 100644 --- a/admin/index.php +++ b/admin/index.php @@ -3,7 +3,7 @@ * @Author: prpr * @Date: 2016-02-03 14:39:50 * @Last Modified by: prpr - * @Last Modified time: 2016-02-04 18:34:32 + * @Last Modified time: 2016-02-04 23:45:06 */ session_start(); @@ -51,7 +51,7 @@ if (isset($_SESSION['uname'])) { Profile
  • - Welcome, ! + Welcome, ! | Log out?
  • @@ -105,6 +105,7 @@ if (isset($_SESSION['uname'])) { + diff --git a/admin/install.php b/admin/install.php index a2da67f5..5183e50f 100644 --- a/admin/install.php +++ b/admin/install.php @@ -3,14 +3,13 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: prpr - * @Last Modified time: 2016-02-03 15:51:27 + * @Last Modified time: 2016-02-04 18:42:51 * * Create tables automatically */ $dir = dirname(dirname(__FILE__)); require "$dir/includes/autoload.inc.php"; -require "$dir/config.php"; echo ""; diff --git a/ajax.php b/ajax.php index 685dea31..b1da2cea 100644 --- a/ajax.php +++ b/ajax.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: prpr - * @Last Modified time: 2016-02-03 21:10:24 + * @Last Modified time: 2016-02-04 18:48:30 * * - login, register, logout * - upload, change, delete @@ -11,16 +11,14 @@ * All ajax requests will be handled here */ +session_start(); header('Access-Control-Allow-Origin: *'); header('Content-type: application/json'); $dir = dirname(__FILE__); require "$dir/includes/autoload.inc.php"; -require "$dir/config.php"; database::checkConfig(); -session_start(); - if (isset($_POST['uname'])) { $user = new user($_POST['uname']); } else { diff --git a/assets/css/profile.style.css b/assets/css/profile.style.css index e7e0eddc..133dc68c 100644 --- a/assets/css/profile.style.css +++ b/assets/css/profile.style.css @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-02-03 17:11:53 * @Last Modified by: prpr -* @Last Modified time: 2016-02-03 17:18:56 +* @Last Modified time: 2016-02-04 22:50:43 */ .pure-form > *, .pure-button { width: 100%; @@ -20,48 +20,6 @@ body { color: #444; } -@media screen and (max-width: 550px) { - .pure-g:first-child { - margin-top: 100px !important; - } -} -.pure-g:first-child { - margin-top: 75px; -} -.panel-default { - border-color: #ddd!important; -} -.panel-danger { - border-color: #ebccd1!important; -} -.panel { - background-color: #fff; - border: 1px solid transparent; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - width: 90%; - margin: 0 auto 20px; -} -.panel-danger>.panel-heading { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; -} -.panel-default>.panel-heading { - color: #333; - background-color: #f5f5f5; - border-color: #ddd; -} -.panel-heading { - padding: 10px 15px; - border-bottom: 1px solid transparent; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel-body { - padding: 10px 15px 15px; -} .home-menu-blur { position: absolute; @@ -94,7 +52,3 @@ body { url("../images/bg_stone.png"); background-repeat: repeat; } -.pure-button-error { - background: rgb(202, 60, 60); - color: #fff; -} diff --git a/assets/css/style.css b/assets/css/style.css index 274b7b07..07cc93ce 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-02-03 23:20:04 +* @Last Modified time: 2016-02-04 23:15:08 */ @import url(https://fonts.googleapis.com/css?family=Ubuntu); @@ -53,9 +53,16 @@ p { .pure-menu-selected { font-weight: bold; } -.pure-menu-link { +.pure-menu-item { color: #5e5e5e !important; } +.pure-menu-link { + display: inline-block; + color: #5e5e5e !important; + font-size: 15px; + cursor: pointer; + padding: .5em .5em; +} .pure-menu-link:hover, .pure-menu-link:focus { background: none; @@ -65,7 +72,10 @@ p { .pure-button { margin: .5em 1em; } - +.pure-button-error { + background: rgb(202, 60, 60); + color: #fff; +} .container { width: 100%; height: 100%; @@ -112,5 +122,45 @@ p { } -@media (min-width: 78em) { +.panel-default { + border-color: #ddd!important; +} +.panel-danger { + border-color: #ebccd1!important; +} +.panel { + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + width: 90%; + margin: 0 auto 20px; +} +.panel-danger>.panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-default>.panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-body { + padding: 10px 15px 15px; +} +.pure-g:first-child { + margin-top: 75px; +} +@media screen and (max-width: 40em) { + .pure-g:first-child { + margin-top: 100px; + } } diff --git a/assets/css/user.style.css b/assets/css/user.style.css index b4528f84..627c9f81 100644 --- a/assets/css/user.style.css +++ b/assets/css/user.style.css @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-01-21 19:12:06 * @Last Modified by: prpr -* @Last Modified time: 2016-02-04 12:56:15 +* @Last Modified time: 2016-02-04 22:57:13 */ .home-menu-blur { @@ -32,6 +32,7 @@ } body { + color: #444; background-image: url("../images/bg_stone.png"); background-repeat: repeat; @@ -59,8 +60,7 @@ body { } #canvas3d { - margin-top: 8%; - margin-left: 20%; + margin: 0 auto; display: block; } @@ -81,9 +81,22 @@ button { } span { padding: .5em .5em; - color: #5e5e5e; - margin-top: 0.1em; + display: inline !important; } .alert { margin: 20px 0 0; } +input[type=radio] { + margin: 20px 0 0; +} +.operations { + display: inline; + float: right; +} +.operations > span:hover { + color: #555; + cursor: pointer; +} +.container { + position: initial !important; +} diff --git a/assets/js/user.utils.js b/assets/js/user.utils.js index d2a9be52..d673f147 100644 --- a/assets/js/user.utils.js +++ b/assets/js/user.utils.js @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-01-21 13:56:40 * @Last Modified by: prpr -* @Last Modified time: 2016-02-03 19:58:45 +* @Last Modified time: 2016-02-04 23:38:39 */ 'use strict'; @@ -43,39 +43,34 @@ var handleFiles = function (files, type) { } }; -var canvas = MSP.get3dSkinCanvas(500, 500); -$("#skinpreview").append($(canvas).prop("id", "canvas3d")); +if ($(window).width() < 600) { + var canvas = MSP.get3dSkinCanvas($('#skinpreview').width(), $('#skinpreview').width()); + $("#skinpreview").append($(canvas).prop("id", "canvas3d")); +} else { + var canvas = MSP.get3dSkinCanvas(400, 400); + $("#skinpreview").append($(canvas).prop("id", "canvas3d")); +} + +$(window).resize(function(){ + if ($(document).height() <= $(window).height() || $(window).width() < 600) { + var canvas = MSP.get3dSkinCanvas($('#skinpreview').width(), $('#skinpreview').width()); + $("#skinpreview").append($(canvas).prop("id", "canvas3d")); + } else { + var canvas = MSP.get3dSkinCanvas(400, 400); + $("#skinpreview").append($(canvas).prop("id", "canvas3d")); + } +}); $("[title='Movements']").click(function(){ - if (MSP.getStatus("movements")) { - MSP.setStatus("movements", false); - } else { - MSP.setStatus("movements", true); - } + MSP.setStatus("movements", !MSP.getStatus("movements")); }); $("[title='Running']").click(function(){ - if (MSP.getStatus("running")) { - MSP.setStatus("running", false); - } else { - MSP.setStatus("running", true); - } + MSP.setStatus("running", !MSP.getStatus("running")); }); $("[title='Rotation']").click(function(){ - if (MSP.getStatus("rotation")) { - MSP.setStatus("rotation", false); - } else { - MSP.setStatus("rotation", true); - } -}); - -$("#logout").click(function(){ - logout(function(json){ - showAlert(json.msg + " Successfully logged out.", function(){ - window.location = "../index.php"; - }); - }); + MSP.setStatus("rotation", !MSP.getStatus("rotation")); }); $("#upload").click(function(){ @@ -117,7 +112,6 @@ $("#upload").click(function(){ } else { showMsg("alert-warning", "No input file selected"); } - }); diff --git a/assets/js/utils.js b/assets/js/utils.js index b0d0f8c7..b666010a 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-02-03 18:23:21 * @Last Modified by: prpr -* @Last Modified time: 2016-02-03 19:19:14 +* @Last Modified time: 2016-02-04 23:02:46 */ 'use strict'; @@ -30,3 +30,11 @@ function logout(callback) { } }); } + +$("#logout").click(function(){ + logout(function(json){ + showAlert(json.msg + " Successfully logged out.", function(){ + window.location = "../index.php"; + }); + }); +}); diff --git a/includes/utils.class.php b/includes/utils.class.php index 9623f56f..b416ae7f 100644 --- a/includes/utils.class.php +++ b/includes/utils.class.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: prpr - * @Last Modified time: 2016-02-04 16:20:19 + * @Last Modified time: 2016-02-04 23:43:07 */ class utils @@ -29,9 +29,10 @@ class utils * @return string $hash, sha256 hash of file */ public static function upload($file) { - move_uploaded_file($file["tmp_name"], DIR."/textures/tmp.png"); - $hash = hash_file('sha256', DIR."/textures/tmp.png"); - rename(DIR."/textures/tmp.png", DIR."/textures/".$hash); + $dir = dirname(dirname(__FILE__)); + move_uploaded_file($file["tmp_name"], "$dir/textures/tmp.png"); + $hash = hash_file('sha256', "$dir/textures/tmp.png"); + rename("$dir/textures/tmp.png", "$dir/textures/".$hash); return $hash; } @@ -76,4 +77,3 @@ class utils } } -?> diff --git a/index.php b/index.php index 01711b38..d2f69504 100755 --- a/index.php +++ b/index.php @@ -3,12 +3,12 @@ * @Author: printempw * @Date: 2016-01-17 13:55:20 * @Last Modified by: prpr - * @Last Modified time: 2016-02-03 22:20:07 + * @Last Modified time: 2016-02-04 23:16:26 */ session_start(); $dir = dirname(__FILE__); require "$dir/includes/autoload.inc.php"; -require "$dir/config.php"; + database::checkConfig(); // Auto load cookie value to session if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) { @@ -17,7 +17,8 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) { $_SESSION['uname'] = $_COOKIE['uname']; $_SESSION['token'] = $user->getToken(); } -} ?> +} +?> @@ -39,12 +40,10 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
    Blessing Skin Server
    @@ -111,10 +110,6 @@ if (isset($_SESSION['uname'])) {
    - -