how to make a fun box-shadow button // coding with madeleine

Coding With Madeleine

Hello! Welcome back to Coding With Madeleine! Today I am going to show you how to make a fun button with an animated shadow. This button is super easy to make and it requires only CSS and no JavaScript! The shadow of the button makes it pop out of the page and when you click on it, the shadow gets smaller, just like clicking a real button.

You can’t click on the button below. That’s just an image.

Before we get started, take a look at the button here.

the html

The HTML is pretty simple. You can use virtually any text tag (like <a>, <p>, or <h1>) but I (ironically) do not recommend using a <button>.

<a href="#">click on me</a>

(Since I have no specific link right now, I just set it to “#”.)


styling the button

Before, we add the animations, let’s just style what the button would look like normally. I reccommend following my CSS for the “Looks of the Button” part, but for the “Looks of the Text,” you can change anything there.

First, I set the font size to 70px and font to DM Sans. I had to link that font from Google Fonts, so you can change this to Arial or something like that. I also set the text-decoration to none, which removes the underline. Then, I set the color of the text to black.

a{
    /*LOOKS OF THE TEXT*/
    font-size: 70px;
    font-family: DM Sans;
    text-decoration: none;
    color: black;
    
    /*LOOKS OF THE BUTTON*/
    padding: 10px 10px;
    border-style: solid;
    border-color: black;
    box-shadow: 30px 30px 0px 0px black;
    display: inline-block;

}

For the button, I made the border solid and black. After, I added some padding so that the border wouldn’t be too close to the text. Then, I added the box shadow to 30px 30px 0px 0px black. Play around with the box shadow sizes to fit your liking. (The third number will make the box shadow blurry.)

Lastly, I set the display to inline block because it fixes some weird things that the CSS might do.


adding the animation

Now, your button probably looks pretty good, but it doesn’t yet have the piece de resistance: the animation! Surprisingly, making animations in CSS is super easy, and only requires a single line a code. (I bolded it so you can see what it is.)

a{
    /*LOOKS OF THE TEXT*/
    font-size: 70px;
    font-family: DM Sans;
    text-decoration: none;
    color: black;
    
    /*LOOKS OF THE BUTTON*/
    padding: 10px 10px;
    border-style: solid;
    border-color: black;
    box-shadow: 30px 30px 0px 0px black;
    display: inline-block;

    /*THE ANIMATION*/
    transition: box-shadow 0.1s linear;
}

Transitions are super simple: the first word is what the animation is applying to. In our case, we want the box shadow to change, so I wrote box shadow. The second part is the duration of the animation, and the third is how the animation timing function. Learn more about that here. You can also add a delay (by adding x number of seconds after the animation timing function), but I find them rather annoying.

Then, we need to add the CSS that will determine what the button should look like during the animation. I simply made the shadow just get smaller.

a:active{
	box-shadow: 10px 10px 0px 0px black;
}

Notice that instead of just “a” it says “a:active.” Active means that the box shadow will get smaller when it it clicked on. You can set “active” to “hover” if you want the box shadow to get smaller when the mouse is hovering over it.


And now you’re done! Here is all the code together:

<style>
/*A FONT; NO NEED TO CARE ABOUT THIS :)*/
@import url('https://fonts.googleapis.com/css2?family=DM+Sans&display=swap');


a{
    /*LOOKS OF THE TEXT*/
    font-size: 70px;
    font-family: DM Sans;
    text-decoration: none;
    color: black;
    
    /*LOOKS OF THE BUTTON*/
    padding: 10px 10px;
    border-style: solid;
    border-color: black;
    box-shadow: 30px 30px 0px 0px black;
    display: inline-block;
    
    /*THE ANIMATION*/
    transition: box-shadow 0.1s linear;
}

a:active{
	box-shadow: 10px 10px 0px 0px black;
}
</style>

<a href="#">click on me</a>

I hope you enjoyed this tutorial! If you have any questions let me know! Also, if you have any suggestions for future coding tutorials, leave them in the comments. I hope you have a nice rest of your day. Bye!

how to make an interactive photo gallery // coding with madeleine

Coding With Madeleine

Hello! Welcome back to my coding series, Coding With Madeleine! Today I will be showing you how to create a image gallery that has a large image and smaller images underneath it that you can click on to view them in the larger image part. (That was wordy 😆)

Again, if you don’t feel like reading it, all the code will be at the end so you can copy and paste it into your website and then customize it.

This was one of the projects I made in this page of my HTML site.

Let’s get started! First, view the image gallery here.

the html

First, let’s add the HTML that makes the images show up.

<img src="image.png" style="height: 400px;">
<br>
<img src="image.png">
<img src="image2.png">
<img src="image3.png">

I decided to add three images to my gallery, but you can add more. Make sure that you link your images properly; don’t just use ‘image.png.’ I also added a <br> between the large image and the little images so that they would show up below the large image instead of on the same line.

I also added style=”height: 400px;” to the large image, which is optional styling that you can also do in the CSS. If you are a coder already, you probably know that I didn’t add an alt text (a caption that will show up if the actual image refuses to show up), so feel free to add one. I don’t like adding alt texts *laughs evilly*


the css

Like the previous Coding With Madeleine project, the CSS is totally optional, however I think it makes it wayyyyy better. (Mostly I’m just obsessed with CSS 😉)

.imgbutton{
  height: 50px;
  width: 50px;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
}

My CSS only applies to the image buttons, as I used a style tag in the large image. You can create a CSS class for the large image as well, if you would like.

First, I made the height and width equal, so the buttons line up perfectly. Then, I set the border radius to 50% so that they would be circles. Border or no border radius is completely up to you, personally I think both look good. You can also do something in the middle, like setting the border radius to 20%.

The most important thing to add is object-fit: cover. This crops the image to fit the dimensions that I gave it instead of squishing and stretching the image to fit the dimensions. Lastly, I changed the cursor to pointer, which gives the user the incentive to click on the image.

Your CSS won’t work without linking the classes back to the items, so here is the new HTML. I bolded all the new parts that I added.

<img src="image.png" style="height: 400px;">
<br>
<img src="image.png" class="imgbutton">
<img src="image2.png" class="imgbutton">
<img src="image3.png" class="imgbutton">

the js

Now, we need to write the JavaScript that will make the large image change when you click on the small images. Make sure to change the source (src) of the image to an actual image!

function soup(){
    document.getElementById('bigimg').src="image.png";
  }
  function secondsoup(){
    document.getElementById('bigimg').src="image2.png";
  }
  function thirdsoup(){
    document.getElementById('bigimg').src="image3.png";
  }

Now, let’s connect the functions to each of the little images. Add an “onclick” to each of the images with the matching function. Make sure that the source of the image is the same in the button and function you match it with. Then, give an ID to the large image.

<img src="image.png" style="height: 400px;" id="bigimg">
<br>
<img src="image.png" class="imgbutton" onclick="soup();">
<img src="image2.png" class="imgbutton" onclick="secondsoup();">
<img src="image3.png" class="imgbutton" onclick="thirdsoup();">

And you’re done! There are so many combinations you can add with the CSS and JS: maybe add some sound when you click on the little images (I did that here)! Make sure to read through your code carefully if you notice any problems.

And now, here is all the code.

<!--The CSS-->
<style>
.imgbutton{
  height: 50px;
  width: 50px;
  border-radius: 50%;
  cursor: pointer;
}
</style>

<!--The JS-->
<script>
function soup(){
    document.getElementById('bigimg').src="image.png";
  }
  function secondsoup(){
    document.getElementById('bigimg').src="image2.png";
  }
  function thirdsoup(){
    document.getElementById('bigimg').src="image3.png";
  }
</script>

<!--The HTML-->
<img src="image.png" style="height: 400px;" id="bigimg">
<br>
<img src="image.png" class="imgbutton" onclick="soup();">
<img src="image2.png" class="imgbutton" onclick="secondsoup();">
<img src="image3.png" class="imgbutton" onclick="thirdsoup();">

I hope you enjoyed the second part of Coding With Madeleine! If you missed the first post, check it out here! If you have any questions or notice any bugs, let me know in the comments! Have a great week!

how to code a simple to-do list // coding with madeleine

Coding With Madeleine

Hello! Today I decided to start a coding series! I will be mainly working in HTML, but CSS and JavaScript will still be involved. (Most likely) all the things in this series are going to be in this page on my HTML site, so you can check that out to get a sneak peek on future tutorials!

In this series I will be sharing simple-ish things that require HTML, CSS, and JS. You’ll need a little bit of background experience in coding, but it won’t take too much. Today, I will be sharing how to create a to-do list, with changeable and checkable tasks.

If you don’t feel like reading all the instructions, you can copy and paste all the code into an HTML editor, like this one, and customize it from there. All the code, for your convenience, is at the end of the post.

Without further ado, let’s get started!

First, take a look at the to-do list, which you can view right here.

the html

First, we have to add the HTML, which makes the items show up on the page.

<p contenteditable="true"><button contenteditable="false">○</button>Your task</p>

First, add paragraph tags <p> </p> and add contenteditable=”true” to it. You can write anything you’d like between the paragraph tags. Then, add a button in the paragraph tag but before whatever you wrote in the paragraph tags. Set the button’s content editable status to false. Put a ○ between the button tags.

Add a couple of these to your page since you probably have more than one tasks to do in a day.


the css

CSS is my favorite part of coding websites. It styles everything and makes things look good.

.todo{
  	background-color: white;
  	text-decoration: none;
 	color: black;
        border: none;
        font-size: 15px;
}

That is my CSS. This part doesn’t affect anything except the looks, so you can change the CSS to anything you’d like.

Notice that I set the class name to “todo” but I didn’t attach the class to anything! So, going back to the HTML code, add the class to each paragraph. I have italicized the part I added.

<!-- New code, with the class -->
<p contenteditable="true" class="todo"><button contenteditable="false">○</button>Your task</p>

<!-- Old code, without the class -->
<p contenteditable="true"><button contenteditable="false">○</button>Your task</p>

the js

Now for the exciting part! You have a pretty nice to-do list, but you don’t know if you’ve done the task for not. So, we have to add JS that changes the ○ to a ✓ when you click on it. If you want, you can change the ○ to • instead of a ✓. Just replace the ✓ in the code below with a •.

That was kind of a confusing paragraph 😂

Make sure to add script tags around your JS!

<script>
  function todo(a){
    document.getElementById(a).innerHTML="✓";
  }
</script>

Notice that I put “a” between parentheses. Most of the time, an ID would go in the second set of parentheses and the first set would be empty, but instead I have added a variable so we don’t have to create a new script for each task.

Now we have to attach the JS to the HTML. Add onclick=”todo();” to the button, and place a number in the parentheses. Then set the ID to the same number.

<!-- New code, with the JS ID and onclick -->
<p contenteditable="true" class="todo"><button contenteditable="false" onclick="todo(1);" id="1">○</button>Your task</p>

<!-- Old code, without the JS ID and onclick -->
<p contenteditable="true" class="todo"><button contenteditable="false">○</button>Your task</p>

Make sure you set a new variable number for each task! See below:

<p contenteditable="true" class="todo"><button contenteditable="false" onclick="todo(1);" id="1">○</button>Your task</p>

<p contenteditable="true" class="todo"><button contenteditable="false" onclick="todo(2);" id="2">○</button>Your task</p>

<p contenteditable="true" class="todo"><button contenteditable="false" onclick="todo(3);" id="3">○</button>Your task</p>

And now you’re done! Make sure to read through your code carefully to make sure there aren’t any bugs! One time I spent a long time trying to debug my code until I noticed that I spelled “function” as “fuction” 😂

For your convenience, here is all the code:

<!--CSS-->
<style>
	.todo{
  		background-color: white;
  		text-decoration: none;
 		color: black;
                border: none;
                font-size: 15px;
}

<!--JS-->
</style>

<script>
  function todo(a){
    document.getElementById(a).innerHTML="✓";
  }
</script>

<!--HTML-->
<p contenteditable="true"> <button class="todo" onclick="todo(1);" id="1" contenteditable="false">○</button>Your first task</p>
<p contenteditable="true"> <button class="todo" onclick="todo(2);" id="2" contenteditable="false">○</button>Your second task</p>
<p contenteditable="true"> <button class="todo" onclick="todo(3);" id="3" contenteditable="false">○</button>Your third task</p>
<p contenteditable="true"> <button class="todo" onclick="todo(4);" id="4" contenteditable="false">○</button>Your fourth task</p>
<p contenteditable="true"> <button class="todo" onclick="todo(5);" id="5" contenteditable="false">○</button>Your fifth task</p>

I hope you liked this coding tutorial! There will be more coming in this series, so look out for them! If you have any questions, or notice any bugs in my code, let me know! Do you like to code? What do you like to use for your to-do list? Bye!

how to paint a succulent + giveaway winner!

Art

Hello! Today I’m going to share with you how I draw my succulents! It’s super easy and customizable. Once you get the hang of it, you can change the leaf shape color, size, and more to create a fun garden. I recommend keeping lots of succulent images on hand when you’re drawing so that you get some inspiration from what an actual succulent looks like. Plus, I will be announcing my guest post giveaway winner, so don’t forget to read to the end!

the tutorial

Step 1: Sketch out your succulent. Start with the center, drawing small petal-leaves (succulent leaves/petals aren’t quite petals or leaves, so I decided to call them petal-leaves 😂) and slowly adding bigger petal-leaves. I did a stout triangular shape, but I did longer petal-leaves in the center. Always make the little ones slightly different shape, not just smaller.

Step 2: Paint the succulent petal-leaves in individually with any color. Generally, succulents are green or blue, but feel free to change the colors up! Painting the petal-leaves in individually makes the leaves look more 3D. The color I used was a olive-y yellow-y green. You can make the baby petal-leaves in the center darker if you want, since these are usually more dense.

Step 3: Add your accent color gradient. Start by adding a little bit of color at the base of the petal-leaf, and then cleaning your brush before blending it out to the rest of the petal-leaf. I used a blue-ish purple-ish color. I think I forgot to add it to the center… oops.

Step 4 (optional): Outline your succulent in a super light gray. This gives the succulent an extra little pop. I used my Tombow Dual Brush Pen in the color N89. If you don’t have a light gray marker, then you can also use light gray watercolors, but very watery paint is sometimes a little hard to control.

And it’s done!


the guest post giveaway winner

Now, let’s announce the winner of the giveaway…

Addie! Congrats Addie! Make sure to check out her blog at shiningstar07.wordpress.com!


I hope you enjoyed this tutorial! If you have any questions, let me know! Do you like succulents? What’s your favorite kind of plant? Bye!

happy new year + 100 followers!

Lifestyle

Hello hello! I’m going back to posting on schedule, which is going to be once a week on Saturdays! There has been two exciting things that happened recently! 1) It’s New Year’s! 2021 seems like such a big number and 2) we have reached 100 followers! Thank you so much to all of you who followed along on my blog! I will share my celebration plan at the end of this post.

To celebrate the New Year, here is a tutorial for a New Year’s sign!


simple new year’s celebration sign tutorial

Step 1: Write “happy” and “year” in loose wide cursive.

Step 2: Write “NEW” in block letters. I used the line tool to make sure that my lines were crisp.

Step 3: Add a background swash with a marker and watercolor brush behind the word “NEW” and trace the other words loosely in the same brush. I used a blue color.

And you’re done!


To celebrate 100 followers, I am going to do assumptions about me, so go leave your assumptions about me in the comments! I’ll be answering them on the 9th. Also, I am going to do a guest post giveaway! We will discuss what your post is going to be about if you win, but I’ll also make it clear right now that you won’t have to post about art.

Enter below (the giveaway is closing on the 15th):

Sorry, the giveaway has been closed

Again, thanks for 100 followers! Bye and have a great New Year!

how to create an awesome sketchbook!

Other, Sewing

I finished fixing the photos. Thanks for your patience!

Hi friends! I don’t know why I keep forgetting when I’m supposed to post. But I still remembered 😁 Today I’m going to show you to make a sketchbook. I love making sketchbooks because 1) I save money 2) it’s more customizable and 3) the sketchbook lays flat.. It’s super easy, but a little bit tedious. I adapted the sewing technique from Layers of Learning (I made a book for Medieval History once. I don’t even know if the sewing technique is the same…).

You will need:

  • Paper (I’m using watercolor paper)
  • A pen or pencil (a light color would be ideal. I used an erasable pen.)
  • A ruler
  • A paper cutter (you can use scissors but this way more efficient.)
  • Needle and thread
  • Large needle
  • Foam sheets or thin cardboard for a cover
  • Scissors
  • Sewing machine (optional; you will still need needle and thread)

I recently bought Canson watercolor paper! Check out my review post here!

Start by drawing lines on your paper where you want cuts/folds. I like small sketchbooks, so I split my 9 by 12 paper into fourths.

Then, cut your paper. If you only want to get two pages from your piece of paper, then DO NOT CUT your paper. Note: for the sewing to work, you need to have two pages on each piece of paper. Make sure you cut on the same edge for each piece of paper.

Here are my pages. I wanted to have a wide sketchbook, so I cut the paper along the long edge.

Next, fold each piece of paper in half. Make sure to line up edges; it’s fine if you don’t fold right on your drawn line.

Then, sew along the fold/line. I used a machine since it’s quicker (I am borrowing my grandmothers), but you can sew it by hand. I sewed each piece of paper separately, but if you are using drawing paper or printer paper then you can sew up to four sheets together.

Then sew back and forth, by hand, through all the stitches together to connect the papers together.

I wrapped a cloth around the end of the paper and fixed it with a large binder clip.

Next, cut a piece of cardboard or foam out as a cover. Make sure to take into account how thick the spine is.

We’re almost done! Draw dots on the spine where you want the stitches to be.

Then poke all the dots you drew earlier with a large needle.

Finally, thread a large needle with thick thread or quadrupled thread. Sew together the loops on the spine to the cover through the holes. I made X’s on the top and bottom because I put two too many rows of holes, but I didn’t want them to be empty.

Aaaaand you’re done! Here is my sketchbook. I’m planning to buy some stickers from my shop and Sunshine Stickers to decorate my sketchbook. You can also paint/draw on the cover with non-water soluble paint/pens/markers.

I hope you enjoyed this tutorial! If you have any questions on the instructions, leave them in the comments. I’d love to know how your sketchbook turned out if you made one. Also, I recently updated the stickers on my shop, so they are all kiss cut now instead of a square. Plus, I added a new gallery collection of some succulents that I drew with watercolor pencils. Have a great day!

how to draw a bouquet in a vase

Art

Hello! Today I am going to show you my process of drawing flowers in a vase without a reference photo. If you have read my Limited Color Palette posts, then you know that I made most of them flowers in vases, which is why I like them so much now. Instead of watercolor, I am going to use brush pens to color it in. This post I actually wrote a month ago, but I’ve been quite busy (mostly with going to the beach😂), so I just decided to post this. (I have quite a lot of backup posts😂.) Well, this intro is getting long. Let’s jump right in!

Start by drawing a simple vase. I usually don’t ever make my vases elaborate (which is something that actually sounds really fun now that I write it), but if you want to, save the details for later.

Then add one to three “spotlight” flowers to the vase. I did these round flowers with a large center. Most of the time my flowers are pretty stout, but feel free to make yours as tall as you like.

Now it’s time to add details! You can add small flowers, ferns, branches and leaves, as well as designs and details to the vase.

Then refine the sketch by erasing unwanted pencil marks, etc. (I actually made the vase shorter at this step.)

Now onto coloring! If you don’t want to color your sketch, you can leave it like so. Start by coloring in the vase and the large flowers.

Then add details to the vase and large flowers, and then color in the rest of the greenery.

And then you’re done! These pieces usually only take about fifteen minutes, so it’s a great little piece to draw if you are low on time. However, you can also make the bouquet much larger, and spend a lot of time on the details.

I hope you found this tutorial fun! If you have any ideas for tutorials in the future, please leave a comment. I’d love to do them! I won’t be doing as many posts for the next two weeks maybe… I don’t know. Bye!

more watercolor sunsets

Art

Hello! Today I am going to be painting some sunset photos that were on my friend Kayla’s blog Journals of Joy (her blog is private). She shared many great sunset photos, and out of those I chose these two.

I love these two photos because the colors are drastically different from each other and there are very little clouds, which makes the colors very pure (and clouds are really hard to paint in my opinion).

0 | Start by taping the edges of your paper down. I split my paper in half, but if you want your paintings bigger, use two sheets of paper.

(From left to right)

1 | Start by wetting the paper lightly. Then add some mid-toned blue in small triangular shapes on the side, near the top, but leaving an inch or so to the top. Leave everything loose.

2 | Add some blue-gray between the two triangles and blend things together a little bit.

3 | Add some periwinkle/violet in the slit that you left at the top. If you want to make your purple slit bigger, just lift some of the blue paint off.

4 | Add some scarlet-ish paint in a small rectangle shape right below the blue/gray/violet blob.

5 | Add some brown red to the side of the scarlet paint and some lemon yellow below.

6 | Blend everything together with minimal strokes.

7 | Add more paint on top for more vibrancy. Let dry. In the meantime, let’s start the next sunset.

8 | Coat the next piece of paper with water. Then add blue paint from the top blended down, and then a bit of cool red/pink.

9 | Add some texture with the red.

10 | Blend out the texture, creating a lavender color. Blend the red downward too.

11 | Add a setting yellow sun. Make sure it isn’t too low, we still have some trees to paint over it.

12 | Add some blue texture to the red block.

13 | Add more pigment onto the painting to brighten the sunset. You can blend it out more, but I decided to leave it very patchy. (Now that I think about it, I don’t understand why I did that.)

14 | Using black paint (I used gouache) create lots of trees across.

15 | Then add a house and fill in the rest of the bottom with black.

16 | Onto the second painting. Add a power line stand (?).

17 | Add trees. I made the trees in front of the setting sun lower so you can see it.

18 | Finish filling the bottom in with black.

Here are the finished sunsets. They are quite different from the photos, but I like how bright and contrasting the colors are. I hope you enjoyed this post. What sort of tutorials would you like me to do in the future? You can leave a comment or send me message in Contact. Thanks for reading!

whimsical watercolor’s first birthday!

Art

Hello! Today is Whimsical Watercolor’s first birthday! Thank you so much for following me and my blog through a whole year. In celebration of it, I am going to share with you a revised edition of my very first post, Sunset City. (If you are wondering why this blog is quite empty, but it is one year old, I used to have a blog on Google Sites before I moved to WordPress.)

(From left to right)

1 | Tape the edges of the paper and apply a thin, glossy layer of water.

2 | Add a cool pink color to the top of the paper, brushing side to side to add a cloud-like texture.

3 | Add a yellow tone of your choice (I started with lemon yellow), and use the same brushing technique to blend the colors together.

4 | Build up the intensity of the colors and add more texture. I used a little yellow ochre at this step.

5 | Start with a very light layer of gray paint, mixing in a lot of water. I made my gray using red brown and cerulean blue. You can make the buildings taller than I did, but I wanted to be able to see the sunset.

6-10 | Continue making layers using darker and darker tones.

Sunset City

Here is the finished painting. This revised version is definitely a lot better than I first painting; I like the more transparent layers than last time. Do you like sunsets? I hope you enjoyed this post. Thanks for reading!

You can compare this painting with the original painting 😬.

simple teardrop fish

Art

Hello! If you want to paint something simple but cute, then painting teardrop fish is for you! You can also use these to make more interesting paint swatches or thumbnail sketches.

Step 1: Sketch a teardrop, eyes and a mouth.

Sketch

It’s pretty self explanatory to draw them… I like making the eyes on the side really large. You can make the mouth happy, sad, mad. You can also add lineart to it, but I didn’t.

Step 2: Paint it in + Ideas

Painting in the fish

1 | (Top) A simple ombre.

2 | (Bottom Left) I made a little galaxy inside the fish by putting down a couple of blues and purples and then some black at the edges. Then I added some white gouache for some stars and planets.

3 | (Bottom Right) I made a little lavender scene by making some grass. Then I added some lavender watercolor and gouache to make the flowers. After I added the sky, but I should of added the sky before adding the grass and flowers.

Teardrop fish

I hope you enjoyed this little tutorial on teardrop fish. If you made some, I would love to see them and put them in the gallery. Click here to fill out the gallery form. Thanks for reading!