fix documentation scroll

This commit is contained in:
SBD
2024-07-11 15:14:51 +03:00
parent 1aeb83d571
commit aafa989501
6 changed files with 236 additions and 21 deletions

View File

@@ -1635,6 +1635,7 @@ body.n_scroll{
display: flex; display: flex;
width: 100%; width: 100%;
align-items: center; align-items: center;
flex-wrap: wrap;
} }
.breadcrumb_arrow_picture{ .breadcrumb_arrow_picture{
@@ -1919,4 +1920,56 @@ body.n_scroll{
.documentation_block{ .documentation_block{
margin-bottom: 100px; margin-bottom: 100px;
} }
.container_top_txt_curtain_documentation{
display: flex;
height: 55px;
align-items: center;
justify-content: space-between;
padding: 0 15px;
border-bottom: 1px solid #CCCED1FF;
}
.top_txt_curtain_documentation{
font-size: 16px;
font-weight: 600;
color: #7A8185FF;
}
.top_picture_curtain_documentation{
width: 24px;
height: 24px;
display: block;
}
.top_img_curtain_documentation{
width: 24px;
height: 24px;
display: block;
}
.container_open_doc_curtain{
display: flex;
align-items: center;
justify-content: right;
width: 100%;
}
.container_open_doc_curtain_txt{
font-size: 14px;
font-weight: 400;
color: #0C54A0FF;
margin-right: 4px;
border-bottom: 1px solid #0C54A0FF;
}
.container_open_doc_curtain_picture{
width: 10px;
height: 10px;
display: block;
}
.container_open_doc_curtain_img{
width: 10px;
height: 10px;
display: block;
}

View File

@@ -7,6 +7,48 @@
} }
@media (max-width: 1024px) { @media (max-width: 1024px) {
.left_curtain_documentation{
width: 320px;
}
.tree_documentation_container_first_level_txt{
margin-bottom: 0;
}
.tree_documentation_container_second_level_txt{
margin-left: 0;
}
.left_curtain_documentation{
position: fixed;
left: -320px;
/* opacity: 0; */
height: 100vh;
top: 0;
background: #fff;
z-index: 10000;
padding: 0 0 27px 0;
}
.documentation_version{
padding: 0 15px;
margin-top: 20px;
}
.block_overlay{
top: 0;
}
.flex_container_tree_and_content{
display: block;
}
.tree_documentation_container {
width: unset;
height: 100vh;
overflow-y: auto;
padding: 0 15px;
}
.content_part_tree_els{
width: 100%;
margin-left: 0;
}
.breadcrumbs_documentation_block{
margin-top: 90px;
}
.container_img_card_contacts{ .container_img_card_contacts{
height: 250px; height: 250px;
} }
@@ -297,6 +339,9 @@
} }
@media (max-width: 800px) { @media (max-width: 800px) {
.name_article_tree{
font-size: 36px;
}
.how_dev_container_widgets { .how_dev_container_widgets {
width: 100%; width: 100%;
display: flex; display: flex;
@@ -589,5 +634,11 @@
.descript_process_container{ .descript_process_container{
margin-bottom: 15px; margin-bottom: 15px;
} }
.breadcrumbs_documentation_block{
display: none;
}
.name_article_tree{
font-size: 26px;
}
} }

View File

@@ -12,7 +12,108 @@ $(document).ready(function (){
resize_iframe() resize_iframe()
} }
} }
if (getInfoAboutUser()[0] === 'laptop' || getInfoAboutUser()[0] === 'mobile'){
setInfInCurtainDocumentationMobile()
setButtonOpenMobileDocCurtain()
}
}) })
function setButtonOpenMobileDocCurtain () {
let $content = $('.content_part_tree_els')
let $cont = document.createElement("div")
let $txt = document.createElement("div")
let $picture = document.createElement("picture")
let $source = document.createElement("source")
let $img = document.createElement("img")
$cont.classList.add("container_open_doc_curtain")
$txt.innerHTML = context_txt_translated
$txt.setAttribute("onclick",'openDocCurtainMobile()')
$txt.classList.add("container_open_doc_curtain_txt")
$picture.classList.add("container_open_doc_curtain_picture")
$source.srcset = '/static/images/arrow_open_documentation_curtain.svg'
$img.classList.add("container_open_doc_curtain_img")
$img.src = '/static/images/arrow_open_documentation_curtain.svg'
$cont.appendChild($txt)
$cont.appendChild($picture)
$picture.appendChild($source)
$picture.appendChild($img)
$($cont).insertBefore($content)
}
function setInfInCurtainDocumentationMobile () {
let $doc_vers = $(".documentation_version")
let $container = document.createElement("div")
let $txt = document.createElement("div")
let $picture = document.createElement("picture")
let $source = document.createElement("source")
let $img = document.createElement("img")
$container.classList.add("container_top_txt_curtain_documentation")
$picture.classList.add("top_picture_curtain_documentation")
$txt.innerHTML = context_txt_translated
$txt.classList.add("top_txt_curtain_documentation")
$source.srcset = '/static/images/cross.svg'
$img.src = '/static/images/cross.svg'
$container.appendChild($txt)
$container.appendChild($picture)
$picture.appendChild($source)
$picture.setAttribute("onclick","closeDocCurtainMobile()")
$picture.appendChild($img)
$($container).insertBefore($doc_vers)
}
function openDocCurtainMobile () {
let $curtain = $(".left_curtain_documentation")
let $block_overlay = $(".block_overlay")
$curtain.css({left:0})
$block_overlay.removeClass("hide")
$block_overlay.addClass("show")
$block_overlay.css({zIndex:10000})
}
function closeDocCurtainMobile () {
let $curtain = $(".left_curtain_documentation")
let $block_overlay = $(".block_overlay")
$curtain.css({left:'-320px'})
$block_overlay.addClass("hide")
$block_overlay.removeClass("show")
$block_overlay.css({zIndex:101})
}
autoplayInterval = null autoplayInterval = null
function resize_iframe () { function resize_iframe () {
@@ -466,25 +567,27 @@ function showContentPartTree (el) {
} }
let waitingTop = null let waitingTop = null
$(window).scroll(function (){ $(window).scroll(function (){
if (window.location.href.includes("docs")){ if (getInfoAboutUser()[0] !== 'laptop' && getInfoAboutUser()[0] !== 'mobile'){
let $curtain = $(".left_curtain_documentation") if (window.location.href.includes("docs")){
let scroll = $(window)[0].scrollY let $curtain = $(".left_curtain_documentation")
if (scroll === 0){ let scroll = $(window)[0].scrollY
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172 if (scroll === 0){
} waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172
let $new_curtain = $($curtain[1]) }
if (!$curtain[1] && waitingTop){ let $new_curtain = $($curtain[1])
$new_curtain = $curtain.clone() if (!$curtain[1] && waitingTop){
$new_curtain.insertAfter($curtain) $new_curtain = $curtain.clone()
} $new_curtain.insertAfter($curtain)
if (scroll >= waitingTop && waitingTop){ }
$new_curtain.css({position:'fixed',top: 166}) if (scroll >= waitingTop && waitingTop){
$($curtain[0]).css({opacity:0}) $new_curtain.css({position:'fixed',top: 166})
} else if (scroll < waitingTop && waitingTop) { $($curtain[0]).css({opacity:0})
$new_curtain.remove() } else if (scroll < waitingTop && waitingTop) {
$($curtain[0]).css({opacity:1}) $new_curtain.remove()
} else if (!waitingTop){ $($curtain[0]).css({opacity:1})
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172 } else if (!waitingTop){
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172
}
} }
} }
}) })

View File

@@ -0,0 +1,3 @@
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0036 6.98053L10.0036 1C10.0036 0.447716 9.55591 0 9.00363 0H3.02253L3.02253 1.5L7.44305 1.5L0 8.94236L1.06061 10.0031L8.50363 2.56074L8.50363 6.98053H10.0036Z" fill="#0C54A0"/>
</svg>

After

Width:  |  Height:  |  Size: 333 B

4
static/images/cross.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 6L6 18" stroke="#10212B" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6 6L18 18" stroke="#10212B" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 277 B

View File

@@ -1,5 +1,5 @@
{% load static %} {% load static %}
{% load i18n %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ request.LANGUAGE_CODE }}"> <html lang="{{ request.LANGUAGE_CODE }}">
<head> <head>
@@ -12,6 +12,7 @@
<script src="{% static "jquery_v3_6_4.js" %}"></script> <script src="{% static "jquery_v3_6_4.js" %}"></script>
<script src="{% static "aerbimJS.js" %}"></script> <script src="{% static "aerbimJS.js" %}"></script>
<script> <script>
context_txt_translated = '{% trans "Содержание" %}'
lang_f_check = '' lang_f_check = ''
</script> </script>
<meta name="viewport" content="width=100%,maximum-scale=5,minimum-scale=1,initial-scale=1"> <meta name="viewport" content="width=100%,maximum-scale=5,minimum-scale=1,initial-scale=1">