documentation page

This commit is contained in:
SBD
2024-07-10 18:03:18 +03:00
parent 4d78fa8e54
commit 36508a6605
7 changed files with 550 additions and 2 deletions

View File

@@ -400,4 +400,86 @@ function redirectToDownloadPlugin () {
// } else {
window.location.href = `${window.location.origin}/${lang}/section/3d-security-designer/#feedback_form`
// }
}
}
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")
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === '') {
$($arrow).animate({rotate: '180deg'},200)
} else {
$($arrow).animate({rotate: '0deg'},200)
}
$content_part.classList.toggle("hidden")
$("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()')
}
function closeVersionSwitcherOnBody () {
if (!event.srcElement.closest(".documentation_version_switcher")){
let $version_switcher_container_content = $(".documentation_switcher_content_part")
let $arrow = document.querySelector(".documentation_switcher_arrow_picture")
$version_switcher_container_content.addClass("hidden")
$($arrow).animate({rotate: '0deg'},200)
}
}
function choseItemTreeDocumentation (el){
let $tree = el.closest(".tree_documentation_container")
let $allChosingElementsTreeThirdLevel = $($tree).find(".element_third_level_content_part_tree")
let $allChosingElementsTreeSecondLevel = $($tree).find(".element_third_level_content_part_tree")
let $allChosingElementsTreeFirstLevel = $($tree).find(".element_third_level_content_part_tree")
$allChosingElementsTreeThirdLevel.each(function (){
if (el !== this){
this.classList.remove("chose")
}
})
$allChosingElementsTreeSecondLevel.each(function (){
if (el !== this){
this.classList.remove("chose")
}
})
$allChosingElementsTreeFirstLevel.each(function (){
if (el !== this){
this.classList.remove("chose")
}
})
el.classList.add("chose")
}
function showContentPartTree (el) {
let $parent = el.parentNode
let $content_part = $parent.querySelector(".content_part_tree_documentation_container")
let $arrow = $parent.querySelector(".tree_documentation_arrow_img")
$content_part.classList.toggle("hidden")
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === ''){
$($arrow).animate({rotate: '180deg'})
} else {
$($arrow).animate({rotate: '0deg'})
}
}
$(window).scroll(function (){
if (window.location.href.includes("docs")){
let $curtain = $(".left_curtain_documentation")
let scroll = $(window)[0].scrollY
let $new_curtain = $($curtain[1])
if (!$curtain[1]){
$new_curtain = $curtain.clone()
$new_curtain.insertAfter($curtain)
}
if (scroll >= 100){
$new_curtain.css({position:'fixed',top: 122})
$($curtain[0]).css({opacity:0})
} else {
$new_curtain.remove()
$($curtain[0]).css({opacity:1})
}
}
})