JSFiddle - React, Tailwind, and code Playground

by graphettion

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Interactive Organization Chart</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f0f0f0;
        }
        .org-chart {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 100%;
            min-height: 100vh;
            position: relative;
            transform-origin: center center;
            transition: transform 0.3s ease;
        }
        .org-level {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 20px 0;
            position: relative;
        }
        .org-node {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            margin: 0 10px;
            padding: 15px;
            width: 200px;
            text-align: center;
            position: relative;
            transition: transform 0.2s;
        }
        .org-node:hover {
            transform: scale(1.05);
        }
        .org-node-name {
            font-weight: bold;
            margin-bottom: 5px;
        }
        .org-node-title {
            color: #666;
            font-size: 0.9em;
        }
        .connector {
            position: absolute;
            border-left: 2px solid #ccc;
            border-bottom: 2px solid #ccc;
            z-index: -1;
        }
        #zoom-controls {
            position: fixed;
            top: 20px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 1000;
        }
    </style>
</head>
<body>
    <div id="zoom-controls">
        <button id="zoom-in">Zoom In (+)</button>
        <button id="zoom-out">Zoom Out (-)</button>
    </div>
    <div id="org-chart" class="org-chart"></div>

...