Untitled
unknown
plain_text
2 years ago
1.7 kB
5
Indexable
<!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 story = person.querySelector('.story');
story.style.display = story.style.display === 'block' ? 'none' : 'block';
}
</script>
</body>
</html>
Editor is loading...