Browse Source

Add a GitHub star button in the footer

Gaël Métais 10 years ago
parent
commit
7779efedf1
4 changed files with 13 additions and 15 deletions
  1. 3 6
      front/src/css/main.css
  2. 5 0
      front/src/js/app.js
  3. 3 8
      front/src/less/main.less
  4. 2 1
      front/src/main.html

+ 3 - 6
front/src/css/main.css

@@ -279,12 +279,6 @@ a.linkButton {
   width: 8.25em;
   height: 11em;
 }
-.star {
-  font-weight: bold;
-}
-.star span {
-  font-size: 1.2em;
-}
 .footer {
   padding: 3em;
   color: #413;
@@ -295,6 +289,9 @@ a.linkButton {
 .footer .version {
   font-size: 0.7em;
 }
+.footer .github {
+  margin: 1em 0 0 0.5em;
+}
 [class^="icon-"]:before,
 [class*=" icon-"]:before {
   vertical-align: baseline;

+ 5 - 0
front/src/js/app.js

@@ -37,6 +37,11 @@ yltApp.run(['$rootScope', '$location', function($rootScope, $location) {
     $rootScope.$on('$routeChangeSuccess', function(){
         ga('send', 'pageview', {'page': $location.path()});
     });
+
+    // GitHub star button (asynchronously loaded iframe)
+    window.addEventListener('load', function() {
+        window.document.getElementById('ghbtn').src = 'http://ghbtns.com/github-btn.html?user=gmetais&repo=YellowLabTools&type=star&count=true&size=large';
+    });
 }]);
 
 yltApp.config(['$routeProvider', '$locationProvider',

+ 3 - 8
front/src/less/main.less

@@ -234,14 +234,6 @@ a.linkButton {
     }
 }
 
-
-.star {
-    font-weight: bold;
-    span {
-        font-size: 1.2em;
-    }
-}
-
 .footer {
     padding: 3em;
     color: #413;
@@ -251,6 +243,9 @@ a.linkButton {
     .version {
         font-size: 0.7em;
     }
+    .github {
+        margin: 1em 0 0 0.5em;
+    }
 }
 
 [class^="icon-"]:before, [class*=" icon-"]:before {

+ 2 - 1
front/src/main.html

@@ -50,8 +50,9 @@
     <div id="header"><h1>Yellow Lab <span class="icon-lab"></span> Tools</h1></div>
     <div id="body" ng-view autoscroll="true"></div>
     <div class="footer">
-        <a href="/about">Learn more</a><br>If you like <b>Yellow Lab Tools</b>, <a href="https://github.com/gmetais/YellowLabTools" target="_blank" class="star">give it a <span>&#9733;</span> on GitHub</a>!<br>
         <span class="version">@@version</span>
+        <br><a href="/about">More about Yellow Lab Tools</a><br>
+        <div class="github"><iframe id="ghbtn" frameborder="0" scrolling="0" width="145px" height="30px"></iframe></div>
     </div>
 
     <script>