7 days of CSS graphics and animations
Tags: animations, css, challenge, codepen
Published: 2020-02-10 23:44:19

---
title: 7 days of CSS graphics and animations
published: true
description: 
tags: animations, css, challenge, codepen
---

<img src="https://shanakayhall.files.wordpress.com/2020/02/27d13764-399d-4e4e-a0b3-987cd1e009f3.jpg?w=1568">

<!-- wp:paragraph -->
<p>See those graphics up there? I did those! The best part is they are all made 100% of code. Yup, it's possible to create fun graphic art with just code alone. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>During the Christmas 2019 break from classes I decided to challenge myself to create one CSS graphic a day for 7 days. I did it as a way to practice my CSS positioning and animation skills and because I wanted to create some cute code art after being inspired by some really cool Pens on <a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://codepen.io/search/pens?q=css+art" target="_blank">CodePen</a>. Over the 7 days I learned a lot and had opportunities to play around with CSS using shapes to create some fun and cute graphics. Here is recap of the 7 days and what I did.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 1 - Mr Bear</strong> </p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/VwYmrWq %}

<!-- wp:paragraph -->
<p>On the first day I took some inspiration from another Pen and decided to make a bear. I used only circles by doing a border radius of 50% on all the shapes. It was fairly simple and straightforward and took me about 30 minutes to do. I used gradients for the bubble gum to make it look a bit more realistic. For my first graphic I don't think it was too bad and I did it all without having to Google anything to my surprise.  </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 2 - Bouncing Margaret</strong></p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/yLygYKg %}


<!-- wp:paragraph -->
<p>Margaret is a coworker of mine who is always interested in seeing what I'm learning and the projects I'm working on. As a small gift I decided to make her a CSS graphic and show her all the code that goes along with it. At first I was just going to use shapes to make a face but then I thought some animation would make it more interesting. I decided to add a shadow at the bottom and made her head bounce while the shadow expands to match the movement of her head. This was kind of challenging at first syncing the two different animations of the head and shadow but with some tweaking I made it work. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 3 - Eggs for Breakfast</strong></p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/gObmGqv %}

<!-- wp:paragraph -->
<p>So anyone who knows me knows that I love my eggs in the morning - especially an egg salad sandwich. I was obviously feeling hungry when I started this one and decided to create a frying pan with fried eggs moving.  For this one I played around with different border radius percentages on the frying pan handle. This took me about 45 minutes to complete and was pretty straightforward overall.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 4 - Hearts and Likes</strong></p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/WNbpWrr %}

<!-- wp:paragraph -->
<p>This is second fave - mostly because of the colour scheme. I love pink! When you hover over the heart it beats. I worked with the :before and :after pseudo class to create the heart which is something I have never worked with before. Basically using :before and :after allows you to flip the shape and gives you the two parts of the heart. This wasn't easy at first because when I added an animation to the heart it kept on rotating to the left but then I realized I could just join the scale and rotate properties together in the animation key frames to straighten it and it eventually worked. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 5 - Sunny with Clouds Weather Report</strong></p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/XWJRWpd %}

<!-- wp:paragraph -->
<p>This was probably one of the longer ones to complete and I lost track of time. I animated the clouds and sun to work in sync. The sun slowly reveals the border around it to make it look like it's pulsing and the clouds move left to right with the opacity set to 90% so it appears transparent. I took inspiration from the iPhone weather app for the colour palette. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 6 - Janky Christmas Tree</strong></p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/rNawdva %}

<!-- wp:paragraph -->
<p>Day 6 was Christmas Day and honestly doing a CSS graphic was the last thing on my mind. I decided to go ahead and make something because I had already missed a couple days and wanted to get it out the way. After my family left I got to work and decided to do what was probably the most appropriate fo the occasion - a Christmas tree. I worked with triangles for the first time to create the tree and used circles for the lights. I call it a Janky Christmas Tree because to me it feels kind of rushed and patched up  - which is true. I completed everything in about 45 minutes. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Day 7 - My Self Portrait</strong></p>
<!-- /wp:paragraph -->

{% codepen https://codepen.io/kaykaycodes/pen/bGNWpQM %}


<!-- wp:paragraph -->
<p>On the last day of the challenge I did a self portrait of myself with a blinking eyes animation and it's my favourite one (although I'm probably a little bit biased hehe). I thought finishing off the challenge with something more personal was a good idea. I used a lot of  circles to create my curly hair. To make my shoulder area appear in the yellow box and not "overflow" into the background I used overflow:hidden on it. I also did the same on the styling for my mouth so my tongue wouldn't appear outside my mouth lol. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>In Conclusion...</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This challenge was great and allowed me to really practice and brush up on my CSS skills and I’m glad I decided to do it. I still have a long way to go and so much to learn but I’m pretty happy with the fact that I stuck to it and completed the challenge - even if I missed a couple days in between. I plan to make more CSS graphics when I have some more free time from classes again over Reading Week to add to the collection. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To see the above graphics and animations and more of my work visit my <a rel="noreferrer noopener" aria-label="CopePen (opens in a new tab)" href="https://codepen.io/kaykaycodes" target="_blank">CopePen</a>.</p>
<!-- /wp:paragraph -->