1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Made medals shiny

This commit is contained in:
Krateng 2019-04-02 17:50:04 +02:00
parent 45e9586951
commit 6cc23caab0
3 changed files with 41 additions and 10 deletions

View File

@ -810,10 +810,6 @@ def build_db():
scr = a["scrobbles"] scr = a["scrobbles"]
print(MEDALS)
log("Database fully built!") log("Database fully built!")

View File

@ -19,13 +19,13 @@ def instructions(keys):
if "medals" in data and data["medals"] is not None: if "medals" in data and data["medals"] is not None:
if "gold" in data["medals"]: if "gold" in data["medals"]:
for y in data["medals"]["gold"]: for y in data["medals"]["gold"]:
html_medals += "<span title='Best Artist in " + str(y) + "' class='gold'><a href='/charts_artists?max=50&in=" + str(y) + "'>" + str(y) + "</a></span>" html_medals += "<a title='Best Artist in " + str(y) + "' class='hidelink medal gold' href='/charts_artists?max=50&in=" + str(y) + "'><span>" + str(y) + "</span></a>"
if "silver" in data["medals"]: if "silver" in data["medals"]:
for y in data["medals"]["silver"]: for y in data["medals"]["silver"]:
html_medals += "<span title='Second Best Artist in " + str(y) + "' class='silver'><a href='/charts_artists?max=50&in=" + str(y) + "'>" + str(y) + "</a></span>" html_medals += "<a title='Second Best Artist in " + str(y) + "' class='hidelink medal silver' href='/charts_artists?max=50&in=" + str(y) + "'><span>" + str(y) + "</span></a>"
if "bronze" in data["medals"]: if "bronze" in data["medals"]:
for y in data["medals"]["bronze"]: for y in data["medals"]["bronze"]:
html_medals += "<span title='Third Best Artist in " + str(y) + "' class='bronze'><a href='/charts_artists?max=50&in=" + str(y) + "'>" + str(y) + "</a></span>" html_medals += "<a title='Third Best Artist in " + str(y) + "' class='hidelink medal bronze' href='/charts_artists?max=50&in=" + str(y) + "'><span>" + str(y) + "</span></a>"
credited = data.get("replace") credited = data.get("replace")
includestr = " " includestr = " "

View File

@ -20,6 +20,9 @@ a {
a.textlink { a.textlink {
color:gold; color:gold;
} }
a.hidelink:hover {
text-decoration:none;
}
a:hover { a:hover {
text-decoration:underline; text-decoration:underline;
@ -247,17 +250,49 @@ span.stat_selector_pulse,span.stat_selector_topartists,span.stat_selector_toptra
} }
/* SHINY*/
.medal {
top:5px;
position:relative;
overflow: hidden;
display: inline-block;
.gold,.silver,.bronze {
font-size:80%; font-size:80%;
padding:3px; padding:3px;
margin:2px; margin:2px;
border-radius:2px; border-radius:2px;
} }
.gold a:hover,.silver a:hover,.bronze a:hover { .medal:after {
text-decoration:none; content: "";
position: absolute;
top: -110%;
left: -210%;
width: 200%;
height: 200%;
opacity: 0;
transform: rotate(30deg);
background: rgba(255, 255, 255, 0.13);
background: linear-gradient(
to right,
rgba(255, 255, 255, 0.13) 0%,
rgba(255, 255, 255, 0.13) 77%,
rgba(255, 255, 255, 0.5) 92%,
rgba(255, 255, 255, 0.0) 100%
);
} }
.medal:hover:after {
opacity: 1;
top: -30%;
left: -30%;
transition-property: left, top, opacity;
transition-duration: 0.7s, 0.7s, 0.15s;
transition-timing-function: ease;
}
.medal:active:after {
opacity: 0;
}
.gold { .gold {
background-color:gold; background-color:gold;