word/memory: celebration animation on completion
[sheet.git] / word / memory.plp
index 8847713d0bfbcbb44a3388f30ca12002a317efc7..1bb8cebb3ae6211b609e4bf14fa513ef4776410a 100644 (file)
@@ -6,6 +6,10 @@ Html({
 <script src="/word/memory.js"></script>
 <style>
 /* cards */
+html {
+       overflow: hidden; /* rotation overflow on celebration */
+}
+
 figure {
        display: inline-block;
        background: #224;
@@ -42,6 +46,17 @@ figure.bad img {
 figure.good {
        opacity: .8;
 }
+
+.good figure {
+       animation: celebration 5s linear infinite;
+       background: none;
+       border: 0;
+}
+@keyframes celebration {
+       0% { filter: hue-rotate(0deg); transform: rotate(0deg) }
+       50% { filter: hue-rotate(180deg); transform: rotate(180deg) }
+       100% { filter: hue-rotate(360deg); transform: rotate(360deg) }
+}
 </style>
 EOT
 });