MBTI/personalities/index.html

96 lines
3.6 KiB
HTML
Raw Normal View History

2023-12-14 14:04:28 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="A website for MBTI test">
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="MBTI, mbti">
<title>十六种人格简介|MBTI-TEST</title>
<link rel="shortcut icon" href="../static/img/favicon.ico">
<link rel="stylesheet" href="../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/css/article.css">
<link rel="stylesheet" href="../static/css/personality-index.css">
<link rel="stylesheet" href="../static/css/app.css">
<script src="../static/js/jquery-3.7.1.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/snap.svg-min.js"></script>
<script src="../static/js/classie.js"></script>
<script src="../static/js/introduce.js"></script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">首页</a>
</li>
<li>
<a href="../personalities.html">十六种人格简介</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div id="mbtidescribe">
<div class="pi">
<section id="grid" class="grid">
{% for type, desc in types_desc %}
<a href="/personalities/{{ type }}/"
data-path-hover="m 0,0 0,35.7775 c 24.580441,3.12569 55.897012,-8.199417 90,-8.199417 34.10299,0 65.41956,11.325107 90,8.199417 L 180,0 z">
<figure>
<img src="/static/img/{{ loop.index % 8 + 1 }}.png" />
<svg viewBox="0 0 180 210" preserveAspectRatio="none">
<path
d="m 0,0 0,171.14385 c 24.580441,15.47138 55.897012,24.75772 90,24.75772 34.10299,0 65.41956,-9.28634 90,-24.75772 L 180,0 0,0 z" />
</svg>
<figcaption>
<h2>{{ type }}</h2>
<p>{{ desc }}</p>
<button>点击查看详细介绍</button>
</figcaption>
</figure>
</a>
{% endfor %}
</section>
</div>
</div>
</div>
</body>
</html>
<script>
(function () {
function init() {
var speed = 330,
easing = mina.backout;
[].slice.call(document.querySelectorAll('#grid > a')).forEach(function (el) {
var s = Snap(el.querySelector('svg')), path = s.select('path'),
pathConfig = {
from: path.attr('d'),
to: el.getAttribute('data-path-hover')
};
el.addEventListener('mouseenter', function () {
path.animate({ 'path': pathConfig.to }, speed, easing);
});
el.addEventListener('mouseleave', function () {
path.animate({ 'path': pathConfig.from }, speed, easing);
});
});
}
init();
})();
$(document).ready(function () {
})
</script>