From 7785c1b57e4fb0f8cfc7f22d171fde3ede3d6e08 Mon Sep 17 00:00:00 2001
From: rubenwardy
Date: Fri, 7 Nov 2014 16:33:38 +0000
Subject: [PATCH] Support for multiple themes
---
dark.css | 41 ++---------------------------------------
index.html | 28 +++++++++++++++-------------
lichess_widgets.css | 36 ++++++++++++++++++++++++++++++++++++
lichess_widgets.js | 12 ++++++------
4 files changed, 59 insertions(+), 58 deletions(-)
create mode 100644 lichess_widgets.css
diff --git a/dark.css b/dark.css
index 5a56654..bb2ecff 100644
--- a/dark.css
+++ b/dark.css
@@ -1,48 +1,11 @@
/* Dark Style */
-.lichess_widget {
- font-family: "Open Sans","Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
- display: inline-block;
- margin: 2px;
+.lichess_theme_dark.lichess_widget {
background: #333;
border: 1px solid #444;
- padding: 5px 10px 7px 10px;
color: #acacac;
border-radius: 4px;
- text-decoration: none;
}
-.lichess_widget:hover {
+.lichess_theme_dark.lichess_widget:hover {
background: #4A4A4A;
}
-
-.lichess_widget b {
- font-weight: 700;
- font-size: 100%;
-
-}
-
-.lichess_widget img {
- margin: 0 10px 0 0;
- display: inline-block;
- height: 20px;
- vertical-align: middle;
-}
-.lichess_widget span {
- display: inline-block;
- vertical-align: middle;
-}
-
-.lichess_long {
- min-width: 220px;
-}
-
-.lichess_long hr {
- margin: 6px 0 2px 0;
- background: #666;
- border: none;
- height: 1px
-}
-
-.lichess_online img {
- color: green;
-}
diff --git a/index.html b/index.html
index ba80b3c..b35637c 100644
--- a/index.html
+++ b/index.html
@@ -3,6 +3,7 @@
Lichess Widgets
+
@@ -14,7 +15,7 @@
}
body {
width: 90%;
- max-width: 900px;
+ max-width: 950px;
margin: auto;
padding: 0;
}
@@ -42,6 +43,7 @@
+ <link rel="stylesheet" href="http://rubenwardy.github.io/lichess_widgets/lichess_widgets.css" />
<link rel="stylesheet" href="http://rubenwardy.github.io/lichess_widgets/dark.css" />
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://rubenwardy.github.io/lichess_widgets/lichess_widgets.js"></script>
@@ -50,62 +52,62 @@
-
+
|
- <script>lichess.profile("rubenwardy", "Lichess");</script>
+ <script>lichess.profile("dark", "rubenwardy", "Lichess");</script>
|
-
+
|
- <script>lichess.profile("rubenwardy");</script>
+ <script>lichess.profile("dark", "rubenwardy");</script>
|
-
+
|
- <script>lichess.profile_scores("rubenwardy");</script>
+ <script>lichess.profile_scores("dark", "rubenwardy");</script>
|
-
+
|
- <script>lichess.profile_scores("rubenwardy", "");</script>
+ <script>lichess.profile_scores("dark", "rubenwardy", "");</script>
|
-
+
|
- <script>lichess.profile_big("rubenwardy");</script>
+ <script>lichess.profile_big("dark", "rubenwardy");</script>
|
-
+
|
- <script>lichess.profile_big("rubenwardy", "My Lichess");</script>
+ <script>lichess.profile_big("dark", "rubenwardy", "My Lichess");</script>
|
diff --git a/lichess_widgets.css b/lichess_widgets.css
new file mode 100644
index 0000000..1737b47
--- /dev/null
+++ b/lichess_widgets.css
@@ -0,0 +1,36 @@
+/* Dark Style */
+.lichess_widget {
+ font-family: "Open Sans","Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
+ display: inline-block;
+ margin: 2px;
+ padding: 5px 10px 7px 10px;
+ border-radius: 4px;
+ text-decoration: none;
+}
+
+.lichess_widget b {
+ font-weight: 700;
+ font-size: 100%;
+}
+
+.lichess_widget img {
+ margin: 0 10px 0 0;
+ display: inline-block;
+ height: 20px;
+ vertical-align: middle;
+}
+.lichess_widget span {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.lichess_long {
+ min-width: 220px;
+}
+
+.lichess_long hr {
+ margin: 6px 0 2px 0;
+ background: #666;
+ border: none;
+ height: 1px
+}
diff --git a/lichess_widgets.js b/lichess_widgets.js
index b7e54ea..2a3796b 100644
--- a/lichess_widgets.js
+++ b/lichess_widgets.js
@@ -10,12 +10,12 @@ lichess.__make_online = function(id) {
$(id + " > img").attr("src", "http://rubenwardy.github.io/lichess_widgets/lichess_online.png");
}
-lichess.profile = function(author, text) {
+lichess.profile = function(theme, author, text) {
serial++;
var id = serial;
if (text == null)
text = author;
- var tmp = "";
+ var tmp = "";
tmp += "
"
tmp += "" + text + "";
document.write(tmp);
@@ -29,12 +29,12 @@ lichess.profile = function(author, text) {
}
});
};
-lichess.profile_scores = function(author, text) {
+lichess.profile_scores = function(theme, author, text) {
serial++;
var id = serial;
if (text == undefined)
text = author;
- var tmp = "";
+ var tmp = "";
tmp += "
"
tmp += "Loading...";
document.write(tmp);
@@ -52,12 +52,12 @@ lichess.profile_scores = function(author, text) {
}
});
};
-lichess.profile_big = function(author, text) {
+lichess.profile_big = function(theme, author, text) {
serial++;
var id = serial;
if (text == undefined)
text = author + " on Lichess";
- var tmp = "";
+ var tmp = "";
tmp += "
" + text + "
"
tmp += "One: two
Three: four";
document.write(tmp);