PageSourceSearch

https://namibian.org/hubfs/hub_generated/module_assets/1/201395731…/module_Language_coursel_and_chart.min.js

js namibian.org collected 2026-09-24 21:50:58 UTC 7,846 bytes, 2 lines download raw bytes

1var module_201395731636=void $(document).ready(function(){const videos=[{id:"KKFRQUO9G5c",title:"Namlish | Episode 2",description:"Exploring the unique language of Namibia"},{id:"FYsrFyeMk3U",title:"Namibian Languages Overview",description:"A look at all languages spoken in Namibia"},{id:"3WRxi8NhHwg",title:"Cultural Significance of Language",description:"How language shapes Namibian culture and identity"}];let currentIndex=0;$(".carousel-3d-item");const totalItems=videos.length;let autoPlayInterval,isAnimating=!1;function updateCarousel(){const $items=$(".carousel-3d-item"),angleStep=360/totalItems;let radius=450;const screenWidth=$(window).width(),isMobile=screenWidth<=768;screenWidth<=480?radius=340:screenWidth<=768?radius=380:screenWidth<=992?radius=400:screenWidth<=1200&&(radius=420),$items.each(function(index){const $item=$(this),relativeIndex=(index-currentIndex+totalItems)%totalItems,angleRad=relativeIndex*angleStep*Math.PI/180,x=Math.sin(angleRad)*radius,z=Math.cos(angleRad)*radius-radius;let scale,opacity,zIndex,pointerEvents;0===relativeIndex?(scale=1,opacity=1,zIndex=100,pointerEvents="auto",$item.attr("data-position","center")):1===relativeIndex||relativeIndex===totalItems-1?(isMobile?(scale=.7,opacity=.5):(scale=.75,opacity=.6),zIndex=50,pointerEvents="auto",$item.attr("data-position",1===relativeIndex?"right":"left")):(isMobile?(scale=.5,opacity=0,pointerEvents="none"):(scale=.55,opacity=.3,pointerEvents="auto"),zIndex=10,$item.attr("data-position","back")),$item.css({transform:`translate(-50%, -50%) translate3d(${x}px, 0, ${z}px) scale(${scale})`,opacity:opacity,zIndex:zIndex,pointerEvents:pointerEvents,visibility:isMobile&&0===opacity?"hidden":"visible"})})}function nextSlide(){isAnimating||(isAnimating=!0,currentIndex=(currentIndex+1)%totalItems,updateCarousel(),updateDots(),setTimeout(()=>{isAnimating=!1},800))}function prevSlide(){isAnimating||(isAnimating=!0,currentIndex=(currentIndex-1+totalItems)%totalItems,updateCarousel(),updateDots(),setTimeout(()=>{isAnimating=!1},800))}
1function goToSlide(targetIndex){isAnimating||targetIndex===currentIndex||(isAnimating=!0,currentIndex=targetIndex,updateCarousel(),updateDots(),setTimeout(()=>{isAnimating=!1},800),resetAutoPlay())}function updateDots(){$(".carousel-dot").removeClass("active"),$(".carousel-dot").eq(currentIndex).addClass("active")}function startAutoPlay(){clearInterval(autoPlayInterval),autoPlayInterval=setInterval(nextSlide,5e3)}function stopAutoPlay(){clearInterval(autoPlayInterval)}function resetAutoPlay(){stopAutoPlay(),startAutoPlay()}$(document).on("click",".carousel-3d-item",function(e){const position=$(this).attr("data-position");if(position&&"center"!==position){e.preventDefault(),e.stopPropagation();const targetIndex=parseInt($(this).attr("data-index"));isNaN(targetIndex)||goToSlide(targetIndex)}}),$(".carousel-arrow-prev").on("click",function(e){e.preventDefault(),prevSlide(),resetAutoPlay()}),$(".carousel-arrow-next").on("click",function(e){e.preventDefault(),nextSlide(),resetAutoPlay()}),$(document).on("click",".carousel-dot",function(e){e.preventDefault(),goToSlide($(this).data("slide"))}),$(".carousel-3d-container").on("mouseenter",function(){stopAutoPlay(),console.log("Carousel paused")}),$(".carousel-3d-container").on("mouseleave",function(){startAutoPlay(),console.log("Carousel playing")});let touchStartX=0,touchEndX=0,touchStartY=0,touchEndY=0,isSwiping=!1,touchStartTime=0;$(".carousel-3d-container").on("touchstart",function(e){touchStartX=e.touches[0].clientX,touchStartY=e.touches[0].clientY,touchStartTime=Date.now(),isSwiping=!1,stopAutoPlay()}),$(".carousel-3d-container").on("touchmove",function(e){touchEndX=e.touches[0].clientX,touchEndY=e.touches[0].clientY;const diffX=Math.abs(touchStartX-touchEndX);diffX>Math.abs(touchStartY-touchEndY)&&diffX>10&&(isSwiping=!0)}),$(".carousel-3d-container").on("touchend",function(e){Date.now()-touchStartTime<200&&!isSwiping||isSwiping&&function(){const swipeThreshold=50,diff=touchStartX-touchEndX;Math.abs(diff)>swipeThreshold&&(diff>0?nextSlide():prevSlide())}(),startAutoPlay()});const languageData=[{language:"Oshiwambo",percentage:48,color:"#6a9d38"},{language:"Nama/Damara",percentage:11,color:"#192c49"},{language:"Afrikaans",percentage:10,color:"#d4a574"},{language:"Rukwangali",percentage:9,color:"#8ab852"},{language:"Otjiherero",percentage:8,color:"#c17767"},{language:"Silozi",percentage:5,color:"#4d6fa5"},{language:"English",percentage:3,color:"#e8b44e"},{language:"Others",percentage:6,color:"#95a5a6"}],ctx=document.getElementById("languagePieChart").getContext("2d");let resizeTimer;new Chart(ctx,{type:"pie",data:{labels:languageData.map(item=>item.language),datasets:[{data:languageData.map(item=>item.percentage),backgroundColor:languageData.map(item=>item.color),borderColor:"#ffffff",borderWidth:3}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(context){return context.label+": "+context.parsed+"%"}},backgroundColor:"rgba(25, 44, 73, 0.9)",titleFont:{size:14,weight:"bold"},bodyFont:{size:13},padding:12,cornerRadius:8}}}}),function(){const $track=$("#carousel3dTrack");videos.forEach((video,index)=>{const $item=$(`\n                        <div class="carousel-3d-item" data-index="${index}">\n                            <iframe \n                                src="https://www.youtube.com/embed/${video.id}?enablejsapi=1&rel=0&modestbranding=1&showinfo=0" \n                                frameborder="0" \n                                allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" \n                                referrerpolicy="strict-origin-when-cross-origin" \n                                allowfullscreen>\n                            </iframe>\n                            <div class="item-content-3d">\n                                <span class="item-category-3d">Language Video</span>\n                                <h3 class="item-title-3d">${video.title}</h3>\n                                <p class="item-description-3d">${video.description}</p>\n                            </div>\n                        </div>\n                    `);$track.append($item)})}(),function(){const $dotsWrapper=$(".carousel-dots");videos.forEach((video,index)=>{const $dot=$(`\n                        <button class="carousel-dot ${0===index?"active":""}" \n                                type="button" \n                                role="tab" \n                                aria-label="Go to video ${index+1}
1"\n                                data-slide="${index}">\n                        </button>\n                    `);$dotsWrapper.append($dot)})}(),updateCarousel(),startAutoPlay(),function(){const $legend=$("#chartLegend");languageData.forEach(item=>{const $legendItem=$(`\n                        <div class="legend-item">\n                            <div class="legend-color" style="background-color: ${item.color};"></div>\n                            <div class="legend-text">\n                                <span class="legend-language">${item.language}</span>\n                                <span class="legend-percentage">${item.percentage}%</span>\n                            </div>\n                        </div>\n                    `);$legend.append($legendItem)})}(),$(window).on("resize",function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(updateCarousel,250)}),console.log("✅ 3D Video carousel initialized with pause/play functionality"),console.log("✅ Navigation arrows and dots added"),console.log("✅ Language distribution pie chart initialized")});
2//# sourceURL=https://8820531.fs1.hubspotusercontent-na1.net/hubfs/8820531/hub_generated/module_assets/1/201395731636/1764656996141/module_Language_coursel_and_chart.js

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.