Explorar o código

feat(widget): animate Tag Cloud

George Cushen %!s(int64=6) %!d(string=hai) anos
pai
achega
a40a7ffe29
Modificáronse 3 ficheiros con 27 adicións e 1 borrados
  1. 3 0
      .gitignore
  2. 23 0
      layouts/partials/css/academic.css
  3. 1 1
      layouts/partials/widgets/tag_cloud.html

+ 3 - 0
.gitignore

@@ -2,3 +2,6 @@
 .idea/
 .vscode/
 resources/
+
+# Jupyter
+.ipynb_checkpoints/

+ 23 - 0
layouts/partials/css/academic.css

@@ -1477,6 +1477,29 @@ a.badge:hover {
   color: rgba(0,0,0,.68);
 }
 
+.tag-cloud a {
+  display: inline-block;
+  position: relative;
+  margin: 5px 10px;
+  word-wrap: break-word;
+  transition-duration: .2s;
+  transition-property: transform;
+  transition-timing-function: ease-out;
+}
+
+.tag-cloud a:active,
+.tag-cloud a:focus,
+.tag-cloud a:hover {
+  color: {{ .Get "primary_dark" }};
+  transform: scale(1.2);
+}
+
+.dark .tag-cloud a:active,
+.dark .tag-cloud a:focus,
+.dark .tag-cloud a:hover {
+  color: {{ .Get "primary_light" }};
+}
+
 /*************************************************
  *  Button size override
  *************************************************/

+ 1 - 1
layouts/partials/widgets/tag_cloud.html

@@ -19,7 +19,7 @@
       {{ $delta := sub $max $min }}
       {{ $fontStep := div $fontDelta $delta }}
 
-      <div id="tag-cloud">
+      <div class="tag-cloud">
         {{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
           {{ $tagCount := len $taxonomy.Pages }}
           {{ $weight := div (sub (math.Log $tagCount) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }}