Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

a better theme support

  • Loading branch information...
commit 20ba4178c7ef430aa35bbb40e769fbcb379dc96f 1 parent 64db170
@ruanmer ruanmer authored
View
81 css/screen.css
@@ -23,6 +23,7 @@ h1, h2, h3, h4, h5, h6 { font-weight: bold; }
body {
padding: 10px;
font: 1em "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
+ color: #515047;
}
a, a:link, a:visited, a:active, .title, .category {
@@ -83,86 +84,6 @@ footer {
display: block;
}
-/* Blue theme */
-
-.blue body {
- background-color: #e5ebf2;
- color: #515047;
-}
-
-.blue h2 a {
- color: #6d7486;
-}
-
-.blue h1 {
- color: #afb6ca;
-}
-
-.blue p {
- color: #999fb2;
-}
-
-.blue a {
- color: #4183C4;
-}
-
-.blue article:hover {
- background-color: #eef3f7;
-}
-
-/* Gray theme */
-
-.gray {
- background-color: #e6e6e7;
- color: #515047;
-}
-
-.gray h2 a {
- color: #747576;
-}
-
-.gray h1 {
- color: #b3b4b6;
-}
-
-.gray p {
- color: #9e9fa3;
-}
-
-.gray a {
- color: #747576;
-}
-
-.gray article:hover {
- background-color: #f4f4f4;
-}
-
-/* Black theme */
-
-.black {
- background-color: #3d3d3d;
- color: #515047;
-}
-
-.black h2 a {
- color: #d4d2d2;
-}
-
-.black h1 {
- color: #313131;
-}
-
-.black p {
- color: #9e9fa3;
-}
-
-.black a {
- color: #d4d2d2;
-}
-
-.black article:hover {
- background-color: #444141;
-}
/* Media Queries */
View
31 css/themes/black.css
@@ -0,0 +1,31 @@
+/* Black theme */
+
+/* body */
+body {
+ background-color: #3d3d3d;
+}
+
+/* category title color */
+h1 {
+ color: #313131;
+}
+
+/* repository title color */
+h2 a {
+ color: #d4d2d2;
+}
+
+/* repository link color */
+a {
+ color: #d4d2d2;
+}
+
+/* repository text color */
+p {
+ color: #9e9fa3;
+}
+
+/* repository hover background-color */
+article:hover {
+ background-color: #444141;
+}
View
31 css/themes/blue.css
@@ -0,0 +1,31 @@
+/* Blue theme */
+
+/* body */
+body {
+ background-color: #e5ebf2;
+}
+
+/* category title color */
+h1 {
+ color: #afb6ca;
+}
+
+/* repository title color */
+h2 a {
+ color: #6d7486;
+}
+
+/* repository link color */
+a {
+ color: #4183C4;
+}
+
+/* repository text color */
+p {
+ color: #999fb2;
+}
+
+/* repository hover background-color */
+article:hover {
+ background-color: #eef3f7;
+}
View
31 css/themes/gray.css
@@ -0,0 +1,31 @@
+/* Gray theme */
+
+/* body */
+body {
+ background-color: #e6e6e7;
+}
+
+/* category title color */
+h1 {
+ color: #b3b4b6;
+}
+
+/* repository title color */
+h2 a {
+ color: #747576;
+}
+
+/* repository link color */
+a {
+ color: #747576;
+}
+
+/* repository text color */
+p {
+ color: #9e9fa3;
+}
+
+/* repository hover background-color */
+article:hover {
+ background-color: #f4f4f4;
+}
View
8 index.html
@@ -1,12 +1,13 @@
<!DOCTYPE html>
-<html class="blue">
+<html>
<head>
<meta charset="utf-8">
<meta name = "viewport" content="width=device-width, maximum-scale=1">
<title>my open source gallery</title>
- <link rel="stylesheet" href="css/screen.css">
+ <link id="default-css" rel="stylesheet" href="css/screen.css">
+ <link id="theme-css" rel="stylesheet" href="css/themes/blue.css">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@@ -25,7 +26,8 @@
<script>
// you're not Clark Kent, right?
- $('body').hubMe({'username': 'clark-kent'});
+ // available themes: blue (default), black & gray
+ $('body').hubMe({'username': 'clark-kent', 'theme': 'gray'});
</script>
</body>
View
11 scripts/hub.me.js
@@ -22,7 +22,8 @@
// Create the defaults once
var hubMe = 'hubMe',
defaults = {
- username: 'github'
+ username: 'github',
+ theme: 'blue'
};
// The actual plugin constructor
@@ -38,10 +39,16 @@
this._defaults = defaults;
this._name = hubMe;
- this.init();
+ this.init();
}
Plugin.prototype.init = function () {
+ // add theme
+ if( this.options.theme != this._defaults.theme ){
+ $('#theme-css').attr('href', 'css/themes/'+ this.options.theme +'.css');
+ }
+
+ // get repository
this.getRepos();
};
Please sign in to comment.
Something went wrong with that request. Please try again.