DEV Community

Robson Muniz
Robson Muniz

Posted on

2 1

🎬Make a Joke Generator | HTML, CSS & javaScript🙌

Make a Make a Joke Generator | HTML, CSS & javaScript, step-by-step from SCRATCH…



Source Code:

HTML

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Joke Generator</title>
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>

<body>
  <div class="main_container">
    <h3>Try Not To Laugh Challenge</h3>
    <div class="joke" id="₢">
      Here goes the joke!
    </div>
    <button class="btn" id="₢">
      Get Another Joke
      <i class="fas fa-grin-squint-tears"></i>
    </button>
  </div>
  <script src="app.js"></script>

</body>

</html>
Enter fullscreen mode Exit fullscreen mode

CSS

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    background: url(img/bg.jpg) center center/cover no-repeat;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.main_container {
    background-color: #f6f1f4;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    padding: 50px 20px;
    max-width: 100%;
    width: 800px;
    text-align: center;
}

h3 {
    margin: 0;
    letter-spacing: 2px;
    opacity: 0.5;
}

.joke {
    font-size: 30px;
    color: #16110d;
    line-height: 40px;
    margin: 50px auto;
    max-width: 600px;
}
.btn {
    background-color: #9f68e0;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 14px 40px;
}

.btn:active {
    transform: scale(.98);
}
.fas {
    margin-left: 4px;
}
Enter fullscreen mode Exit fullscreen mode

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay