Browse Source

Add icon font for buttons

Tyler Hallada 9 years ago
parent
commit
b702bec1ec
8 changed files with 2267 additions and 7 deletions
  1. 3 0
      _layouts/home.html
  2. 11 0
      css/ionicons.min.css
  3. 5 0
      css/main.css
  4. BIN
      fonts/ionicons.eot
  5. 2232 0
      fonts/ionicons.svg
  6. BIN
      fonts/ionicons.ttf
  7. BIN
      fonts/ionicons.woff
  8. 16 7
      magic/index.html

+ 3 - 0
_layouts/home.html

@@ -26,6 +26,9 @@
26 26
     <!-- Web Fonts -->
27 27
     <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italics,300,300italics,200' rel='stylesheet' type='text/css'>
28 28
 
29
+    <!-- Icon Fonts -->
30
+    <link rel="stylesheet" href="/css/ionicons.min.css">
31
+
29 32
     <!-- Favicon -->
30 33
     <link rel="shortcut icon" href="/favicon.png" />
31 34
 

File diff suppressed because it is too large
+ 11 - 0
css/ionicons.min.css


+ 5 - 0
css/main.css

@@ -439,6 +439,11 @@ a.no-decoration:hover {
439 439
 /*
440 440
 /*****************************************************************************/
441 441
 
442
+i.icon {
443
+  padding-left: 0.25rem;
444
+  padding-right: 0.25rem;
445
+}
446
+
442 447
 div.options-panel {
443 448
   position: fixed;
444 449
   bottom: 0;

BIN
fonts/ionicons.eot


File diff suppressed because it is too large
+ 2232 - 0
fonts/ionicons.svg


BIN
fonts/ionicons.ttf


BIN
fonts/ionicons.woff


+ 16 - 7
magic/index.html

@@ -16,24 +16,33 @@ title: Tyler Hallada
16 16
     magicObj[key] = value;
17 17
   }
18 18
 
19
+  function findParentWithId(el, id) {
20
+    while (el.getAttribute('id') !== id) {
21
+      el = el.parentElement;
22
+    }
23
+    return el;
24
+  }
25
+
19 26
   function togglePanel(event) {
20 27
     var options = document.getElementById("options");
28
+    var button = findParentWithId(event.target, "hide-show");
21 29
     if (options.style.display === "none") {  // hidden
22 30
       options.style.display = "block";
23
-      event.target.innerHTML = "Hide";
31
+      button.innerHTML = "<i class=\"icon ion-chevron-down\"></i>";
24 32
     } else {  // shown
25 33
       options.style.display = "none";
26
-      event.target.innerHTML = "Show";
34
+      button.innerHTML = "<i class=\"icon ion-chevron-up\"></i>";
27 35
     }
28 36
   }
29 37
 
30 38
   function togglePlay(event) {
39
+    var button = findParentWithId(event.target, "play-pause");
31 40
     if (magicObj.paused) {
32 41
       magicObj.paused = false;
33
-      event.target.innerHTML = "Pause";
42
+      button.innerHTML = "<i class=\"icon ion-pause\"></i>";
34 43
     } else {
35 44
       magicObj.paused = true;
36
-      event.target.innerHTML = "Play";
45
+      button.innerHTML = "<i class=\"icon ion-play\"></i>";
37 46
     }
38 47
   }
39 48
 
@@ -44,9 +53,9 @@ title: Tyler Hallada
44 53
 <div class="options-panel">
45 54
   <div class="controls-tab">
46 55
     <div class="controls">
47
-      <button id="play-pause">Pause</button>
48
-      <button id="clear">Clear</button>
49
-      <button id="hide-show">Hide</button>
56
+      <button id="play-pause"><i class="icon ion-pause"></i></button>
57
+      <button id="clear"><i class="icon ion-refresh"></i></button>
58
+      <button id="hide-show"><i class="icon ion-chevron-down"></i></button>
50 59
     </div>
51 60
   </div>
52 61
   <div id="options" class="container-full" style="display:block;">