JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Sticky Notes— Building the Visual Structure

Emily Y Leung
JavaScript in Plain English
5 min readDec 22, 2021

--

Photo by AbsolutVision on Unsplash

In part 1, we look at setting up a sticky notes application. From mapping out the core functions to writing the files for the HTML structure and styling.

Introduction

Why are we building this project?

What are we going to learn?

We should have a basic understanding of the following:

Tools

Set up a local server

How to spin up a python local server:

python -m http.server <port>

Designing the interface

The core functions of the application

File structure

stickynotes
├── index.html
└── src
├── styles.css
└── main.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>

</body>
</html>
<head>
...
<link rel="stylesheet" type="text/css" href="src/styles.css">
<script type="text/javascript" src="src/main.js" defer></script>
...
</head>

Building the visual structure

<body> <div id="app">
<textarea class="note">Some sample text</textarea>
<button class="add-note" type="button">+</button>
</div>
</body>

Styling the application

body {
margin: 0;
background: #008578;
}

Using CSS Grid

#app {
display: grid;
grid-template-columns: repeat(auto-fill, 200px);
padding: 24px;
gap: 24px;
}
<div id="app">
<textarea class="note">Some sample text</textarea>
<textarea class="note">Some sample text</textarea>
<textarea class="note">Some sample text</textarea>
<textarea class="note">Some sample text</textarea>
<textarea class="note">Some sample text</textarea>
<textarea class="note">Some sample text</textarea>

<button class="add-note" type="button">+</button>
</div>

Styling the Sticky Notes

.note {
height: 200px;
box-sizing: border-box;
padding: 16px;
border: none;
border-radius: 10px;
box-shadow: 0 0 7px rgba(0, 0, 0, 0.15);
resize: none;
font-family: sans-serif;
font-size: 16px;
}

Styling the add button

.add-note {
height: 200px;
border: none;
outline: none;
background: rgba(0, 0, 0, 0.1);
border-radius: 10px;
font-size: 120px;
color: rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 0.2s;
}
.add-note:hover {
background: rgba(0, 0, 0, 0.2);
}

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Written by Emily Y Leung

Creative. Problem solver. Learning programming in public | emilyyleung.github.io

No responses yet