JSFiddle - React, Tailwind, and code Playground

by andypotanin

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Daily Dev Tips</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: 'Arial', sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            background-color: #1A1A1A;
            color: #FFF;
        }
        h1 {
            font-size: 3rem;
            margin-bottom: 20px;
            text-align: center;
        }
        #tips-container {
            width: 80%;
            max-width: 700px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        .tip {
            background: #292929;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
            transition: transform 0.2s ease-in-out;
        }
        .tip:hover {
            transform: scale(1.02);
        }
        .tip h2 {
            font-size: 1.5rem;
            margin-bottom: 10px;
            color: #00A8FF;
        }
        .tip p {
            font-size: 1rem;
            line-height: 1.5;
            color: #DDD;
        }
    </style>
</head>
<body>
    <h1>Daily Dev Tips</h1>
    <div id="tips-container"></div>

    <script>
        const tips =[
  {
    "Tip": "Always commit your code at the end of the day, even if it's not perfect",
    "Why": "You'll thank yourself later when you need to track down when a change was made or recover old code"
  },
  {
    "Tip": "Name your variables like you're explaining them to a friend",
    "Why": "Reading code is way easier when 'customerData' is used instead of 'cd' - your future self will appreciate it"
  },
  {
    "Tip": "Add comments to explain why, not what",
    "Why": "The code shows what it does, but the story...