documentation page

This commit is contained in:
SBD
2024-07-18 14:03:05 +03:00
parent f2c3ffe87b
commit c573d29eb1
2 changed files with 32 additions and 16 deletions

View File

@@ -1690,7 +1690,7 @@ body.n_scroll{
.documentation_version{
display: flex;
align-items: center;
margin-bottom: 40px;
margin-bottom: 30px;
}
.documentation_version_switcher{

View File

@@ -510,22 +510,28 @@ function transitToDocumentation() {
window.location.href = window.location.origin + '/' + getLang() + '/docs/3dsd/'
}
function openVersionSwitcher(el){
let $parent = el.closest(".documentation_version_switcher")
let $content_part = $parent.querySelector(".documentation_switcher_content_part")
let $arrow = $parent.querySelector(".documentation_switcher_arrow_picture")
$content_part.classList.toggle("hidden")
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === '') {
$($arrow).css({rotate: '180deg'})
let height = $content_part.offsetHeight
$content_part.style.bottom = '-' + height + "px"
$parent.style.borderBottom = '1px solid #fff'
} else {
$($arrow).css({rotate: '0deg'})
$parent.style.borderBottom = '1px solid #CCCED1FF'
}
let switcherWorking = false
$("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()')
function openVersionSwitcher(el){
if (!switcherWorking){
switcherWorking = true
let $parent = el.closest(".documentation_version_switcher")
let $content_part = $parent.querySelector(".documentation_switcher_content_part")
let $arrow = $parent.querySelector(".documentation_switcher_arrow_picture")
$content_part.classList.toggle("hidden")
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === '') {
$($arrow).css({rotate: '180deg'})
let height = $content_part.offsetHeight
$content_part.style.bottom = '-' + height + "px"
$parent.style.borderBottom = '1px solid #fff'
$("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()')
} else {
$($arrow).css({rotate: '0deg'})
$parent.style.borderBottom = '1px solid #CCCED1FF'
$("body")[0].setAttribute("onclick",'')
}
switcherWorking = false
}
}
function closeVersionSwitcherOnBody () {
@@ -536,9 +542,19 @@ function closeVersionSwitcherOnBody () {
$(".documentation_version_switcher").css({borderBottom: '1px solid #CCCED1FF'})
if ($arrow.style.rotate !== '180deg'){
$($arrow).css({rotate: '180deg'})
} else {
$($arrow).css({rotate: '0deg'})
}
if ($('.documentation_switcher_arrow_picture')[1]){
let arrow1 = $('.documentation_switcher_arrow_picture')[1]
if (arrow1.style.rotate !== '180deg'){
$(arrow1).css({rotate: '180deg'})
} else {
$(arrow1).css({rotate: '0deg'})
}
}
$("body")[0].setAttribute("onclick",'')
}
}