Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.8 kB
1
Indexable
Never
<!DOCTYPE html>
<html>
<head>
    <style>
        /* CSS styling for the family tree */
        .family-tree {
            display: flex;
            justify-content: center;
        }
        .person {
            text-align: center;
            margin: 10px;
            padding: 10px;
            cursor: pointer;
        }
        .person p {
            margin: 0;
            padding: 0;
        }
        .story {
            display: none;
            margin-top: 10px;
        }
        .active .story {
            display: block;
        }
    </style>
</head>
<body>
    <div class="family-tree">
        <div class="person" onclick="togglePerson(this)">
            <p>John Smith (b. 1950)</p>
            <div class="story">
                <p>John Smith was a dedicated family man who enjoyed spending time with his children and grandchildren. He had a passion for gardening and loved cultivating beautiful flowers in his backyard.</p>
            </div>
        </div>
        <div class="person" onclick="togglePerson(this)">
            <p>Mary Johnson (b. 1955)</p>
            <div class="story">
                <p>Mary Johnson was a talented musician who played the piano. She taught music to many students in her community and was known for her patience and dedication as a teacher.</p>
            </div>
        </div>
        <!-- Add more person entries with their respective stories -->
    </div>

    <script>
        function togglePerson(person) {
            person.classList.toggle('active');
            var siblings = person.parentNode.children;
            for (var i = 0; i < siblings.length; i++) {
                if (siblings[i] !== person) {
                    siblings[i].classList.remove('active');
                }
            }
        }
    </script>
</body>
</html>