Я новенький в Django и в Python знаю только основы. STATIC и директории подключены, работает html, css-анимации, но не js. В settings.py все пути подключены.
{% load static %}
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{% static 'main/css/main.css' %}">
<script src="{% static 'main/js/main.js' %}"></script>
<title>{% block title %}Сайт{% endblock %}</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
.write-button {
background-color: rgba(47, 47, 143, 1);
color: #fff;
border: none;
border-radius: 20px;
padding: 8px 25px;
cursor: pointer;
transition: all 0.3s ease;
}
.write-button:hover {
background-color: rgba(67, 67, 173, 1);
transform: scale(1.1);
}
const button = document.querySelector('.write-button');
button.addEventListener('mousemove', (event) => {
const rect = button.getBoundingClientRect();
const x = event.clientX - rect.left - rect.width / 2;
const y = event.clientY - rect.top - rect.height / 2;
button.style.transform = `translate(${x * 0.2}px, ${y * 0.2}px) scale(1.1)`;
});
button.addEventListener('mouseleave', () => {
button.style.transform = 'translate(0, 0)scale(1.0)';
});