<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enneagram vs MBTI Interactive Map</title>
<style>
body {
font-family: sans-serif;
display: flex;
gap: 40px;
padding: 20px;
background: #f9f9f9;
}
.graphic-container {
width: 300px;
}
/* SVG Interactive Styles */
.interactive-shape {
fill: #ddd;
stroke: #fff;
stroke-width: 2;
cursor: pointer;
transition: fill 0.3s ease;
}
/* The lighting-up effect applied to the graphic via hover */
.interactive-shape:hover, .graphic-highlight {
fill: #3b82f6 !important;
}
.sidebar {
width: 300px;
}
/* The lighting-up effect applied to the text boxes */
.info-card {
padding: 15px;
margin-bottom: 10px;
background: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
transition: all 0.3s ease;
}
.text-highlight {
background: #eff6ff !important;
border-color: #3b82f6 !important;
box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}
</style>
</head>
<body>
<!-- 1. THE INLINE SVG GRAPHIC -->
<div class="graphic-container">
<h3>Interactive Graphic</h3>
<svg viewBox="0 0 200 200" width="100%" height="100%">
<!-- Shape representing Enneagram 5 -->
<rect id="enneagram-5" class="interactive-shape" x="20" y="20" width="160" height="70" rx="10" />
<text x="100" y="60" text-anchor="middle" fill="#333" font-size="14" pointer-events="none">Enneagram 5</text>
<!-- Shape representing MBTI NT Types -->
<rect id="mbti-nt" class="interactive-shape" x="20" y="110" width="160" height="70" rx="10" />
<text x="100" y="150" text-anchor="middle" fill="#333" font-size="14" pointer-events="none">MBTI (INTJ / INTP)</text>
</svg>
</div>
<!-- 2. THE PAGE TEXT ELEMENTS TO HIGHLIGHT -->
<div class="sidebar">
<h3>Psychological Profiles</h3>
<div id="card-e5" class="info-card">
<h4>Type 5: The Investigator</h4>
<p>Focuses on gathering knowledge, independence, and analytical depth. Fears being overwhelmed.</p>
</div>
<div id="card-nt" class="info-card">
<h4>The Rational Analysts (NT)</h4>
<p>Driven by logic, system-building, theoretical mastery, and objective competence.</p>
</div>
<div id="card-overlap" class="info-card">
<h4>Core Overlap: Objectivity</h4>
<p>Both types heavily depersonalize problems to analyze them logically from a safe distance.</p>
</div>
</div>
<!-- 3. THE JAVASCRIPT LINKING THEM TOGETHER -->
<script>
// Grab elements from the page
const svgE5 = document.getElementById('enneagram-5');
const svgNT = document.getElementById('mbti-nt');
const cardE5 = document.getElementById('card-e5');
const cardNT = document.getElementById('card-nt');
const cardOverlap = document.getElementById('card-overlap');
// HOVER SYSTEM: Enneagram 5 Shape
svgE5.addEventListener('mouseenter', () => {
cardE5.classList.add('text-highlight');
cardOverlap.classList.add('text-highlight');
});
svgE5.addEventListener('mouseleave', () => {
cardE5.classList.remove('text-highlight');
cardOverlap.classList.remove('text-highlight');
});
// HOVER SYSTEM: MBTI NT Shape
svgNT.addEventListener('mouseenter', () => {
cardNT.classList.add('text-highlight');
cardOverlap.classList.add('text-highlight');
});
svgNT.addEventListener('mouseleave', () => {
cardNT.classList.remove('text-highlight');
cardOverlap.classList.remove('text-highlight');
});
// REVERSE HOVER: Hovering text card lights up the SVG shape
cardOverlap.addEventListener('mouseenter', () => {
svgE5.classList.add('graphic-highlight');
svgNT.classList.add('graphic-highlight');
});
cardOverlap.addEventListener('mouseleave', () => {
svgE5.classList.remove('graphic-highlight');
svgNT.classList.remove('graphic-highlight');
});
</script>
</body>
</html>