Skip to content

Commit

Permalink
Merge pull request #1977 from DeinFreund/ranks
Browse files Browse the repository at this point in the history
ranks prototype + weird looking user profile
  • Loading branch information
DeinFreund authored Dec 25, 2017
2 parents b877087 + 7e1e12e commit c6a3157
Show file tree
Hide file tree
Showing 39 changed files with 702 additions and 142 deletions.
20 changes: 15 additions & 5 deletions Zero-K.info/AppCode/HtmlHelperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,29 +264,39 @@ public static MvcHtmlString PrintBombers(this HtmlHelper helper, Account account
/// </summary>
/// <param name="colorize">If true, write the text in <see cref="Faction"/> color</param>
/// <returns></returns>
public static MvcHtmlString PrintClan(this HtmlHelper helper, Clan clan, bool colorize = true) {
public static MvcHtmlString PrintClan(this HtmlHelper helper, Clan clan, bool colorize = true, bool big = false) {
var url = Global.UrlHelper();
if (clan == null) return new MvcHtmlString(string.Format("<a href='{0}'>No Clan</a>", url.Action("Index", "Clans")));
{
string color = Clan.ClanColor(clan, Global.ClanID);
if (String.IsNullOrEmpty(color)) color = "#B0D0C0";
return
new MvcHtmlString(
if (big)
{
return
new MvcHtmlString(string.Format("<a href='{1}' nicetitle='$clan${2}'><img width='64' src='{0}'/></a>",
clan.GetImageUrl(),
url.Action("Detail", "Clans", new { id = clan.ClanID }),
clan.ClanID));
}
else
{
return new MvcHtmlString(
string.Format("<a href='{0}' nicetitle='$clan${4}'><img src='{1}' width='16'><span style='color:{2}'>{3}</span></a>",
url.Action("Detail", "Clans", new { id = clan.ClanID }),
clan.GetImageUrl(),
colorize ? color : "",
HttpUtility.HtmlEncode(clan.Shortcut),
clan.ClanID));
}
}
}


public static MvcHtmlString PrintBadges(this HtmlHelper helper, Account account, int? maxWidth = null)
public static MvcHtmlString PrintBadges(this HtmlHelper helper, Account account, int? maxWidth = null, bool newlines = true)
{
if (account == null) return new MvcHtmlString("");
var badges = account.GetBadges();
return new MvcHtmlString(string.Join("\n", badges.Select(x=>$"<img src='/img/badges/{x}.png' nicetitle='{x.Description()}' {(maxWidth != null ? $"style='width:{maxWidth}px;'":"")}/><br/>")));
return new MvcHtmlString(string.Join("\n", badges.Select(x=>$"<img src='/img/badges/{x}.png' nicetitle='{x.Description()}' {(maxWidth != null ? $"style='width:{maxWidth}px;'":"")}/>{(newlines ? "<br/>" : "")}")));
}

/// <summary>
Expand Down
Binary file added Zero-K.info/Styles/fonts/Xolonium-Bold.otf
Binary file not shown.
Binary file added Zero-K.info/Styles/fonts/Xolonium-Bold.ttf
Binary file not shown.
Binary file added Zero-K.info/Styles/fonts/Xolonium-Bold.woff
Binary file not shown.
Binary file added Zero-K.info/Styles/fonts/Xolonium-Regular.otf
Binary file not shown.
Binary file added Zero-K.info/Styles/fonts/Xolonium-Regular.ttf
Binary file not shown.
Binary file added Zero-K.info/Styles/fonts/Xolonium-Regular.woff
Binary file not shown.
94 changes: 94 additions & 0 deletions Zero-K.info/Styles/fonts/Xolonium_license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Copyright 2011-2016 Severin Meyer <sev.ch@web.de>,
with Reserved Font Name Xolonium.

This Font Software is licensed under the SIL Open Font License,
Version 1.1. This license is copied below, and is also available
with a FAQ at <http://scripts.sil.org/OFL>


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
3 changes: 0 additions & 3 deletions Zero-K.info/Styles/levelrank.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
background: transparent;
height: 250px;
width: 120px; /*2.5 aspect ratio*/
border: 2px solid #000;
border-radius: 6px;
box-shadow: 0px 0px 3px 3px #000;
margin: 5px;
}

Expand Down
26 changes: 24 additions & 2 deletions Zero-K.info/Styles/style.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
.js_tabs {}

@font-face {
font-family: "Xolonium";
font-weight: normal;
src: url("./fonts/Xolonium-Regular.ttf");
src:
url("./fonts/Xolonium-Regular.woff") format("woff"),
url("./fonts/Xolonium-Regular.otf") format("opentype");
}
@font-face {
font-family: "Xolonium";
font-weight: bold;
src: url("./fonts/Xolonium-Bold.ttf");
src:
url("./fonts/Xolonium-Bold.woff") format("woff"),
url("./fonts/Xolonium-Bold.otf") format("opentype");
}

html
{
/*background: #000 url("/img/bg_bluehex.gif") fixed;*/
background: #000;
color: #ede;
font-family: os, sans-serif;
font-size: 15px;
font-family: 'Xolonium', os, sans-serif;
font-size: 14.5px;
height: 100%;
width: 100%;
padding: 0;
margin: 0;
border: 0;
z-index:0;
letter-spacing: -0.2px;
text-rendering: optimizeLegibility;
-webkit-font-feature-settings: "kern";
-moz-font-feature-settings: "kern";
font-feature-settings: "kern";
}

body
Expand Down
133 changes: 133 additions & 0 deletions Zero-K.info/Styles/userpage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
.username{
text-align: center;
letter-spacing: 0.3px;
margin-left: 150px;
margin-right: 150px;
}

.progress_filler{

position:absolute;
background-image: url('/img/progressl_fill.png');
background-repeat: repeat-x;
background-size: auto 100%;
height: 32px;
display: inline-block;
left: 0px;
}


.progress_empty{
position:absolute;
background-image: url('/img/progressr_fill.png');
background-repeat: repeat-x;
background-size: auto 100%;
height: 32px;
display: inline-block;
right: 0px;
}


.progress_begin{
background-image: url('/img/progressl_base.png');
background-size: 100% 100%;
height: 32px;
width: 16px;
float:right;
}


.progress_end{
background-image: url('/img/progressr_base.png');
background-size: 100% 100%;
height: 32px;
width: 16px;
float:left;
}

.progress_text{
height: 32px;
padding: 7px;
display: inline-block;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

.progress_wrapper{
margin: 0px 150px 0px 150px ;
position:relative;
}
.progress_wrapper_left{
width: 150px;
float: left;
}
.progress_wrapper_right{
width: 150px;
float: right;
text-align: right;

}
.user_buttons{
float: right;
text-align: center;
bottom: 0px;
margin-top: 0px;
}

.user_buttons table{
}
.user_buttons tr td{
padding: 4px;
}

#avatar{
margin-left: auto;
margin-right: auto;
margin-top: 5px;
#background-image: url("/img/ranks/level-elo/velvetbacking.jpg");
background-size: 100% 100%;
width: 94px;
height: 180px;
}
.avatarbg{
background-image: url("/img/avatarbg.png");
display: inline-block;
}
#avatar table {
width: 100%;
padding-top: 10px;
}
#avatar table tr td{
text-align: center;
padding: 4px;
}
#usr_info{
padding-top: 5px;

background-image: url("/img/rankbg/infrared.png");
background-image: url("/img/rankbg/brown.png");
background-position: center;
background-size: auto 347px;
background-repeat: no-repeat;
}
#badges{
height: 26px;
width: 400px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
#levelrank{
padding-top: 0px;
margin-left: auto;
margin-right: auto;
}
.ranks{
height: 200px;
}
#badge,
#avatarwrap{
width: 49%;
display: inline-block;
}
Loading

0 comments on commit c6a3157

Please sign in to comment.