Posted in css
10352
5:56 am, September 13, 2021
 

animated duck on footer

Thought this was cool.

How do i do it?

Page Source: https://www.learninpublic.org/ 

Copy this section

Lets see what is attached to it.

So i can see from the classes its a tailwind based site, which is why there are so many class names, very messy to read through. See what i can extract. 

From the limited amount of time i wish to spend on this, i only got the duck bob working but not the left and right animation. 

HTML

<div class="bg-blue-500">
  <div class="duck svelte-1xr3p2b" aria-hidden="true">
    <div class="bob svelte-1xr3p2b"><img alt="" class="w-14 h-14 z-10 svelte-1xr3p2b" src="/images/duck.svg"></div>
  </div>
  <div class="max-w-screen-xl mx-auto pb-12 px-4 overflow-hidden sm:px-6 lg:px-8 z-20">
    <nav class="-mx-5 -my-2 flex flex-wrap justify-center">
      <div class="px-5 py-2"><a href="mailto:swyx@hey.com" class="text-base leading-6 text-white font-semibold hover:text-gray-900 transition-colors">Contact</a></div>
      <div class="px-5 py-2"><a href="https://twitter.com/Coding_Career" class="text-base leading-6 text-white font-semibold hover:text-gray-900">Twitter</a></div>
      <div class="px-5 py-2"><a href="https://github.com/sw-yx/codingcareer.com" class="text-base leading-6 text-white font-semibold hover:text-gray-900">View Source</a></div>
    </nav>
    <div class="mt-8">
      <p class="text-center text-base leading-6 text-gray-900">© 2020-2021 All rights reserved</p>
    </div>
  </div>
</div>

CSS

.bg-blue-500 {
  --tw-bg-opacity: 1;
  background-color: rgba(66, 153, 225, var(--tw-bg-opacity));
}

.duck.svelte-1xr3p2b.svelte-1xr3p2b {
  display: inline-block;
  transform-origin: center;
  animation: var(15s) svelte-1xr3p2b-move linear infinite alternate;
}

.duck.svelte-1xr3p2b.svelte-1xr3p2b {
  --dur: 15s;
}

.duck.svelte-1xr3p2b .bob.svelte-1xr3p2b {
  animation: 1s svelte-1xr3p2b-bob ease-out infinite alternate;
}

.duck.svelte-1xr3p2b img.svelte-1xr3p2b {
    animation: calc(var(--dur) * 2) svelte-1xr3p2b-turn infinite reverse;
}

@keyframes svelte-1xr3p2b-bob {
  from {
    transform: translateY(-0.1rem) rotate(-2.5deg) scaleX(0.975)
  }

  10% {
    transform: translateY(-0.1rem) rotate(-2.5deg) scaleX(0.975)
  }

  to {
    transform: translateY(0.1rem) rotate(2.5deg) scaleX(1.025)
  }
}
@keyframes svelte-1xr3p2b-turn{from{transform:scaleX(-1) }50%{transform:scaleX(-1) }51%{transform:scaleX(1) }to{transform:scaleX(1) }}
.w-14 {
  width: 3.5rem;
}
.h-14 {
  height: 3.5rem;
}

© 2020-2021 All rights reserved

View Statistics
This Week
368
This Month
1360
This Year
2610

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Items in css
flex to align pagination in list format make an image or element grayscale switch on mouse over rotate an element when its hover rotate an element when its selected Left Fixed nav with right fluid content css html vertical center css cursor types testing CSS Object Fit for Image fill rather than using background image on a div flip card animation 3d front and back css html six box grid css html custom no gap four box grid css html custom Kinda Crappy 3D button code 4 box custom grid css layout stack on mobile 1024 lower use an image in your list items ol ul li css grid container with 4 auto columns select something with custom data attribute css rainbow text background clip with linear gradient content-visibility and contain-intrinsic-size for page load rendering speed increase set a css grid to auto to make it stack on mobile truncate text with line clamp allow a certain number of lines using the :user-valid CSS pseudo-class add a button to an existing link using :after css bouncing loader animation in css center a box in the middle of the screen highlight a button with an animation css add an outline to everything! hide the first h3 tag on the page with css center align vertical 2 items in a container flex simple javascript no library accordion button zoom effect with expanding background scroll left animation using css counter-increment to add numbering to elements hidden scroll anchor for custom scroll position ken burns slow image zoom using a radial gradient for background overlay change selected color on input elements css animated duck on footer using filter grayscale to make an image dark bootstrap dark mode twitter icon font awesome how to bundle css files together using windows or mac button with separated chevron vertically align text within a fixed height div using flex how to view a web page in its printer format white space break word css roboto and poppins fonts include quick code CSS Drawing - Beach Scene 404 Error Page Codepen right align something in its element hide the third row in a table with css
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
A person who never made a mistake never tried anything new.
Albert Einstein
Random CSS Property

conic-gradient()

The conic-gradient() CSS function creates an image consisting of a gradient with color transitions rotated around a center point (rather than radiating from the center). Example conic gradients include pie charts and color wheels. The result of the conic-gradient() function is an object of the <gradient> data type, which is a special kind of <image>.
conic-gradient() css reference