Merge remote-tracking branch 'origin/main'

This commit is contained in:
SDE
2023-11-26 16:55:27 +03:00
5 changed files with 79 additions and 17 deletions

View File

@@ -35,14 +35,18 @@ body,html{
}
.text_header{
padding-right: 90px;
}
.standart_txt{
color: #ffffff;
/*font-family: Spline Sans;*/
font-size: 16px;
font-weight: 500;
line-height: normal;
text-transform: uppercase;
padding-right: 90px;
}
.text_header.last_right{
padding-right: 0;
}

46
static/aerbimJS.js Normal file
View File

@@ -0,0 +1,46 @@
$(document).ready(function (){
renderContent()
})
function getInfoAboutUser (){
let user_type = ''
if (screen.width <= 800){
user_type = 'mobile'
} else if (screen.width > 1024) {
user_type = 'desktop'
} else if (screen.width >= 800 && screen.width <= 1024) {
user_type = 'laptop'
}
return [user_type,screen.width]
}
function sendWidthAjax () {
let width = getInfoAboutUser()[1]
let data = {
'screen_width': width
}
return data
}
function renderContent () {
let data = sendWidthAjax()
let section_button = document.querySelector(".section_button")
data['section_url'] = section_button.dataset['url']
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/get_content_for_section/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: JSON.stringify(data),
success: function(data){
document.querySelector(".content").innerHTML = data.html
},
error: function (data){
alert(data)
}
});
}

2
static/jquery_v3_6_4.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
{% load static %}
<div class="header">
<div class="cut-width">
<div class="left_part_header">
<img src="{% static "images/logo.svg" %}" class="logo_header">
</div>
<div class="right_part_header">
<span class="standart_txt text_header">Поддержка</span>
<span class="standart_txt text_header last_left">Контакты</span>
<div class="splitter_text_header"></div>
<select class="language_select">
<option>RU</option>
<option>EN</option>
</select>
<span class="standart_txt text_header last_right orange">Личный кабинет</span>
</div>
</div>
</div>

View File

@@ -1,28 +1,20 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AerBim</title>
<link rel="stylesheet" href="{% static "aerbimCSS.css" %}">
<script src="{% static "jquery_v3_6_4.js" %}"></script>
<script src="{% static "aerbimJS.js" %}"></script>
</head>
<body>
<div class="header">
<div class="cut-width">
<div class="left_part_header">
<img src="{% static "images/logo.svg" %}" class="logo_header">
</div>
<div class="right_part_header">
<span class="text_header">Поддержка</span>
<span class="text_header last_left">Контакты</span>
<div class="splitter_text_header"></div>
<select class="language_select">
<option>RU</option>
<option>EN</option>
</select>
<span class="text_header last_right orange">Личный кабинет</span>
</div>
</div>
{% include "blocks/static/header.html" %}
<div class="cut-width content">
{% block CONTENT %}
{% endblock %}
</div>
</body>
</html>