From 78cec5c94b9dfbdc3a7f9363eca53fe93b172f6b Mon Sep 17 00:00:00 2001 From: ruan Date: Tue, 13 Mar 2018 12:08:53 +0200 Subject: [PATCH] Refactor CSS --- history.php | 4 +-- inc/css/custom.css | 77 ++++++++++++++++++++++++++++++++++------------ inc/page.php | 17 +++------- index.php | 4 +-- info.php | 9 +++--- 5 files changed, 69 insertions(+), 42 deletions(-) diff --git a/history.php b/history.php index 4bf945c..bac6893 100644 --- a/history.php +++ b/history.php @@ -158,11 +158,9 @@ try { $page->set_info($page->type_info($type)); - $style = 'style="font-size: 13px;"'; - $label_type = $page->type; $label_name = Info::create($row, $page, $label_type)->name(); //ucfirst($label_type); - $label = "$label_name"; + $label = "$label_name"; $page->print_table_rows($row, array( $page->t("generic.type") => $label, diff --git a/inc/css/custom.css b/inc/css/custom.css index 9017dd6..a86bd7c 100644 --- a/inc/css/custom.css +++ b/inc/css/custom.css @@ -1,28 +1,50 @@ -.noselect { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - .avatar { margin-bottom: 5px; margin-right: 5px; border-radius: 2px; } +/* header */ + +.col-lg-12 { + text-align: center; +} + +/* tables */ + +th { + text-align: center; +} + table tr td { padding-left: 0; padding-right: 0; vertical-align: middle !important; } +/* table links */ +a, +a:hover, +a:focus { + text-decoration: none !important; +} + +tr.hover { + cursor: pointer; +} + +/* pager */ + .litebans-pager { font-size: 30px; } +.litebans-pager-number { + margin-top: 32px; + text-align: center; + font-size: 15px; +} + .litebans-pager-left { float: left; } @@ -39,29 +61,44 @@ table tr td { color: transparent; } -/* table links */ -a, -a:hover, -a:focus { - text-decoration: none !important; +/* index.php */ +.litebans-index { + text-align: center; } -tr.hover { - cursor: pointer; +/* info.php */ +.litebans-label-info { + margin-left: 13px; + font-size: 17px; } -.label-ban { +/* history.php */ +.litebans-label-history { + font-size: 13px; +} + +.litebans-label-ban { background-color: darkred; } -.label-mute { +.litebans-label-mute { background-color: dimgrey; } -.label-warn { +.litebans-label-warn { background-color: darkorange; } -.label-kick { +.litebans-label-kick { background-color: tomato; } + +/* prevent mouse selection */ +.noselect { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} diff --git a/inc/page.php b/inc/page.php index 9824b58..eee5a1f 100644 --- a/inc/page.php +++ b/inc/page.php @@ -404,20 +404,13 @@ class Page { $type = $this->type; echo ""; foreach ($array as $header => $text) { - $style = ""; - if ($header === $this->t("bans_reason") || $header === $this->t("mutes_reason") || $header === $this->t("warns_reason") || $header == $this->t("kicks_reason")) { - $style = "style=\"width: 30%;\""; - if ($text === "") { - $text = "-"; - } - } $a = "a"; if ($header === $this->t("warnings.received")) { $icon = ($text !== "0") ? "glyphicon-ok" : "glyphicon-remove"; $a .= " class=\"glyphicon $icon\" aria-hidden=true"; $text = ""; } - echo "<$a href=\"info.php?type=$type&id=$id\">$text"; + echo "<$a href=\"info.php?type=$type&id=$id\">$text"; } echo ""; } @@ -425,7 +418,7 @@ class Page { function table_print_headers($headers) { echo ""; foreach ($headers as $header) { - echo "
$header
"; + echo "$header"; } echo ""; } @@ -438,9 +431,9 @@ class Page { echo '
'; } - echo "

$title

"; + echo "

$title

"; if ($container_start) { - echo '
'; + echo '
'; } } @@ -493,7 +486,7 @@ class Page { if ($next_active) { $pager_next = "$pager_next"; } - $pager_count = '
' . $this->t("table.pager.number") . ' ' . $cur . '/' . $pages . '
'; + $pager_count = '
' . $this->t("table.pager.number") . ' ' . $cur . '/' . $pages . '
'; echo "$pager_prev $pager_next $pager_count"; } diff --git a/index.php b/index.php index b102d52..f18b52f 100644 --- a/index.php +++ b/index.php @@ -6,11 +6,11 @@ $page->print_title(); ?>
-
+

settings->name, $page->t("index.welcome.main")); ?>

-

t("index.welcome.sub"); ?>

+

t("index.welcome.sub"); ?>

print_footer(false); ?> diff --git a/info.php b/info.php index f362fcf..9b1275d 100644 --- a/info.php +++ b/info.php @@ -152,7 +152,6 @@ if ($st->execute(array($id))) { $header = $page->name; if (!($info instanceof KickInfo)) { - $style = 'style="margin-left: 13px; font-size: 16px;"'; $active = $page->active($row); $ipban = $page->active($row, 'ipban'); if ($ipban === true) { @@ -163,16 +162,16 @@ if ($st->execute(array($id))) { $idx = "generic.ipmute"; } if ($idx !== null) { - $header .= "" . $page->t($idx) . ""; + $header .= "" . $page->t($idx) . ""; } } if ($active === true) { - $header .= "" . $page->t("generic.active") . ""; + $header .= "" . $page->t("generic.active") . ""; if ($permanent) { - $header .= "" . $page->t("generic.permanent") . ""; + $header .= "" . $page->t("generic.permanent") . ""; } } else { - $header .= "" . $page->t("generic.inactive") . ""; + $header .= "" . $page->t("generic.inactive") . ""; } } $page->print_header(true, $header);