diff --git a/package.json b/package.json index 110af21..31d53ea 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "postcss-minify": "^1.1.0", "sync-request": "^6.1.0", "tailwindcss": "^3.0.1", + "tailwindcss-animate": "^1.0.5", "tailwindcss-cli": "^0.1.2" } } diff --git a/tailwind.config.js b/tailwind.config.js index 448d5c3..c24a3c5 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,9 @@ module.exports = { darkMode: 'class', // or 'media' or 'class' - plugins: [], + plugins: [ + // https://github.com/jamiebuilds/tailwindcss-animate + require("tailwindcss-animate"), + ], theme: { boxShadow: { /* Customized */ diff --git a/themes/coo/source/css/components/layer.css b/themes/coo/source/css/components/layer.css new file mode 100644 index 0000000..97f272b --- /dev/null +++ b/themes/coo/source/css/components/layer.css @@ -0,0 +1,34 @@ +@layer components { + .openAnimation { + animation: 200ms cubic-bezier(0, 0, 0.2, 1) 0s 1 normal both running openAnimation; + } + + .closeAnimation { + animation: 200ms cubic-bezier(0.4, 0, 1, 1) 0s 1 normal both running closeAnimation; + } +} + + +@keyframes openAnimation { + from { + transform: scale(0.8); + opacity: 0; + } + + to { + transform: scale(1); + opacity: 1; + } +} + +@keyframes closeAnimation { + from { + transform: scale(1); + opacity: 1; + } + + to { + transform: scale(0.8); + opacity: 0; + } +} diff --git a/themes/coo/source/css/components/search.css b/themes/coo/source/css/components/search.css index 582e55d..b55a678 100644 --- a/themes/coo/source/css/components/search.css +++ b/themes/coo/source/css/components/search.css @@ -1,3 +1,11 @@ +#mysearch { + @apply animate-in fade-in duration-200; +} + +#mysearch-box { + animation: 200ms cubic-bezier(0, 0, 0.2, 1) 0s 1 normal both running openAnimation; +} + #mysearch em { @apply not-italic text-emerald-500; } diff --git a/themes/coo/source/css/style.tailwindcss b/themes/coo/source/css/style.tailwindcss index 49874e0..62f9ca8 100644 --- a/themes/coo/source/css/style.tailwindcss +++ b/themes/coo/source/css/style.tailwindcss @@ -4,6 +4,7 @@ /* Custom Components */ +@import "components/layer.css"; @import "highlightjs/stackoverflow-light.min.css"; @import "components/layout_table.css"; @import "components/layout_list.css";