cannamatch/templates/profiles.html
2025-10-22 11:51:33 +02:00

103 lines
4.6 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>cannamatch profiles</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Popup helper (same as inactive) -->
<script src="{{ url_for('static', filename='js/popup.js') }}"></script>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
</head>
<body class="profiles-page">
<div class="page-container">
<div class="logo-container">
<a href="{{ url_for('index') }}">
<img src="{{ url_for('static', filename='cm.png') }}" alt="Logo" class="logo">
</a>
</div>
<div class="button-row">
<button type="button" class="magenta-button" onclick="location.href='{{ url_for('index') }}'">About</button>
<button type="button" class="magenta-button" onclick="location.href='{{ url_for('profiles_page') }}'">All Profiles</button>
<button type="button" class="magenta-button" onclick="location.href='{{ url_for('inactive') }}'">Interactive</button>
<button type="button" class="magenta-button" onclick="location.href='{{ url_for('quiz') }}'">Quiz</button>
</div>
<div class="profile-grid">
{% for name, values in profiles.items() %}
<div class="profile-profile-card">
<div class="info-block profile-info-block">
<div class="title-with-icon">
<div class="profile-name"><h2 class="glow-info">{{ name }}</h2></div>
<span class="info-icon profile-info-icon glow-text" onclick="togglePopup(event, 'popup-{{ loop.index }}')"></span>
<p class="info-text">{{ values.info_text0 }}</p>
<p class="info-text">{{ values.info_text2 }}</p>
</div>
</div>
<canvas id="chart-{{ loop.index }}"></canvas>
<div class="popup" id="popup-{{ loop.index }}">
<div class="popup-content profile-popup-content">
<h3 class="info-text" id="popup-name-{{ loop.index }}">{{ name }}</h3>
<h4 class="info-text glow-info">THC</h4>
<p class="info-text" id="popup-info0-1">{{ values.info_text0 }}</p>
<h4 class="info-text glow-info">CBD</h4>
<p class="info-text" id="popup-info1-1">{{ values.info_text1 }}</p>
<h4 class="info-text glow-info">GENETICS</h4>
<p class="info-text" id="popup-info2-1">{{ values.info_text2 }}</p>
<h4 class="info-text glow-info">TASTE</h4>
<p class="info-text" id="popup-info3-1">{{ values.info_text3 }}</p>
<h4 class="info-text glow-info">EFFECT</h4>
<p class="info-text" id="popup-info4-1">{{ values.info_text4 }}</p>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<script>
const labels = ['Energy', 'Calm', 'Relax', 'Sleep', 'Focus', 'Inspire'];
const profiles = {{ profiles | tojson }};
Object.entries(profiles).forEach(([name, data], index) => {
const ctx = document.getElementById(`chart-${index + 1}`).getContext('2d');
new Chart(ctx, {
type: 'radar',
data: {
labels: labels,
datasets: [{
label: name,
data: data.values,
fill: true,
borderColor: 'rgba(191,181,49,1)',
pointBackgroundColor: 'rgba(0,0,0,0)',
pointBorderColor: 'rgba(191,181,49,1)',
backgroundColor: 'rgba(191,181,49,0.420)',
pointRadius: 0,
pointHoverRadius: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
r: {
min: 0,
max: 80,
ticks: { stepSize: 20, display: false },
pointLabels: { font: { size: 15, weight: 'bold' }, color: '#FFF' },
grid: { color: 'rgba(255,255,255,0.420)', circular: false },
angleLines: { color: 'rgba(255,255,255,0.69)' }
}
},
plugins: { tooltip: { enabled: false}, legend: { display: false } }
}
});
});
</script>
</body>
</html>