{"id":161,"date":"2024-03-14T20:26:58","date_gmt":"2024-03-14T20:26:58","guid":{"rendered":"https:\/\/pablomedrano.dev\/?p=161"},"modified":"2024-03-15T01:41:03","modified_gmt":"2024-03-15T01:41:03","slug":"css-animations","status":"publish","type":"post","link":"https:\/\/pablomedrano.dev\/?p=161","title":{"rendered":"CSS Animations"},"content":{"rendered":"\n<p>At its core, CSS animations operate by transitioning CSS properties from one state to another over a specified duration. This transition can be triggered by various events such as hover, click, or page load. CSS animations are defined using the <code>@keyframes<\/code> rule, which allows developers to specify keyframes at different points in the animation timeline.<\/p>\n\n\n\n<style>\nbody {\n    background-color: white;\n    margin: 0;\n    font-family: Verdana, Geneva, Tahoma, sans-serif;\n    padding-bottom: 150px;\n\n}\n\nsection {\n    columns: 2;\n    padding: 16px 32px;\n    column-gap: 32px;\n}\n\nsection img {\n    border-radius: 5px;\n    width: 100%;\n    height: auto;\n    margin-bottom: 32px;\n    animation: reveal linear both;\n    animation-timeline: view();\n    animation-range: entry 20% cover 50%;\n}\n\n.my-header {\n    color: black;\n    text-align: center;\n    padding: 16px;\n    margin: 0;\n    width: 100%;\n    position: sticky;\n    top: 50px;\n    left: 0;\n    z-index: 1;\n\n    animation: enhance-header linear both;\n    animation-timeline: scroll(root block);\n    animation-range: 0 200px;\n}\n\n@keyframes enhance-header {\n\n    to {\n        background: rgba(255, 255, 255, 0.4);\n        backdrop-filter: blur(5px);\n        font-size: 22px;\n        color: black;\n\n    }\n\n}\n\n@keyframes reveal {\n    from {\n        opacity: 0;\n        translate: 0 100px;\n        scale: 0.5;\n    }\n\n    to {\n        opacity: 1;\n        translate: 0 0;\n        scale: 1;\n    }\n\n}\n\n<\/style>\n\n\n<body>\n    <h2 class=\"my-header\" >CSS Animations<\/h2>\n\n    <section>\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1682905926517-6be3768e29f0?q=80&#038;w=1887&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710225342718-11c18a806f59?w=500&#038;auto=format&#038;fit=crop&#038;q=60&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwzfHx8ZW58MHx8fHx8\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710228010417-a8d07002b83c?q=80&#038;w=1887&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1683009427041-d810728a7cb6?q=80&#038;w=1886&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710381473369-7c75ff666f8d?q=80&#038;w=1887&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1709828593321-48973262f23e?q=80&#038;w=986&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710302043859-6077fea7205a?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710173126005-bc5cb5001b9e?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710286124248-0f0a49dd460e?q=80&#038;w=964&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710248213192-990ce6b17ea1?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710273887091-d2c7222a65bc?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710352492489-ba6d8cbe5bcb?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1682687220305-ce8a9ab237b1?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1710172510079-fe595c6009fd?q=80&#038;w=987&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n        <img decoding=\"async\" src=\"https:\/\/images.unsplash.com\/photo-1709936863104-b0249fe18c41?q=80&#038;w=1974&#038;auto=format&#038;fit=crop&#038;ixlib=rb-4.0.3&#038;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n            alt=\"\">\n\n\n\n    <\/section>\n\n<\/body>\n","protected":false},"excerpt":{"rendered":"<p>At its core, CSS animations operate by transitioning CSS properties from one state to another over a specified duration. This transition can be triggered by various events such as hover, click, or page load. CSS animations are defined using the @keyframes rule, which allows developers to specify keyframes at different points in the animation timeline. &#8230; <a title=\"CSS Animations\" class=\"read-more\" href=\"https:\/\/pablomedrano.dev\/?p=161\" aria-label=\"Read more about CSS Animations\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161"}],"version-history":[{"count":12,"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":175,"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions\/175"}],"wp:attachment":[{"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pablomedrano.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}