@@ -276,10 +276,27 @@ <h2 style="color: var(--primary); text-transform: uppercase; margin-bottom: 20px
276276 const hints = new Set ( ) ; questsDatabase . forEach ( q => { hints . add ( q . title ) ; ( q . needs || [ ] ) . forEach ( n => hints . add ( n ) ) ; } ) ;
277277 const d = document . getElementById ( 'searchHints' ) ; if ( d ) { d . innerHTML = '' ; hints . forEach ( h => { const o = document . createElement ( 'option' ) ; o . value = h ; d . appendChild ( o ) ; } ) ; }
278278 }
279-
280- function changeSlide ( d , e ) { e . stopPropagation ( ) ; if ( ! window . cS ) window . cS = 1 ; const imgs = [ "cat1.png" , "cat2.png" , "cat3.png" , "cat4.png" , "cat5.png" ] ; window . cS += d ; if ( window . cS > 5 ) window . cS = 1 ; if ( window . cS < 1 ) window . cS = 5 ; document . getElementById ( 'cat-slide' ) . src = "img/imgs[window.cS-1]; document.getElementById('slide-num').innerText=window.cS+" / 5 "; }
281- function changeQuestSlide ( d , e ) { if ( e ) e . stopPropagation ( ) ; if ( ! window . qS ) window . qS = 1 ; const imgs = [ "school-trader.png" , "gymn-cor.jpg" , "gymn.jpg" ] ; window . qS += d ; if ( window . qS > imgs . length ) window . qS = 1 ; if ( window . qS < 1 ) window . qS = imgs . length ; document . getElementById ( 'quest-slide' ) . src = "img/imgs[window.qS-1]; document.getElementById('q-slide-num').innerText=window.qS+" / "+imgs.length; }
282-
279+ function changeSlide ( d , e ) {
280+ e . stopPropagation ( ) ;
281+ if ( ! window . cS ) window . cS = 1 ;
282+ const imgs = [ "img/cat1.png" , "img/cat2.png" , "img/cat3.png" , "img/cat4.png" , "img/cat5.png" ] ;
283+ window . cS += d ;
284+ if ( window . cS > 5 ) window . cS = 1 ;
285+ if ( window . cS < 1 ) window . cS = 5 ;
286+ document . getElementById ( 'cat-slide' ) . src = imgs [ window . cS - 1 ] ;
287+ document . getElementById ( 'slide-num' ) . innerText = window . cS + " / 5" ;
288+ }
289+
290+ function changeQuestSlide ( d , e ) {
291+ if ( e ) e . stopPropagation ( ) ;
292+ if ( ! window . qS ) window . qS = 1 ;
293+ const imgs = [ "img/school-trader.png" , "img/gymn-cor.jpg" , "img/gymn.jpg" ] ;
294+ window . qS += d ;
295+ if ( window . qS > imgs . length ) window . qS = 1 ;
296+ if ( window . qS < 1 ) window . qS = imgs . length ;
297+ document . getElementById ( 'quest-slide' ) . src = imgs [ window . qS - 1 ] ;
298+ document . getElementById ( 'q-slide-num' ) . innerText = window . qS + " / " + imgs . length ;
299+ }
283300 function filterQuests ( lvl , btn ) { document . querySelectorAll ( '.filter-btn' ) . forEach ( b => b . classList . remove ( 'active' ) ) ; btn . classList . add ( 'active' ) ; document . querySelectorAll ( '.quest-card' ) . forEach ( card => { const q = questsDatabase . find ( x => x . id === card . id ) ; card . style . display = ( lvl === 'all' || q . diff === lvl ) ? 'flex' : 'none' ; } ) ; }
284301 function updateStats ( ) { const t = questsDatabase . length ; const d = document . querySelectorAll ( '.quest-card.completed' ) . length ; document . getElementById ( 'total-q' ) . innerText = t ; document . getElementById ( 'done-q' ) . innerText = d ; document . getElementById ( 'left-q' ) . innerText = t - d ; }
285302 function openTrader ( n , l , i1 , i2 , i3 ) { document . getElementById ( 'modalTraderName' ) . innerText = n ; document . getElementById ( 'modalTraderLoc' ) . innerText = l ; const imgs = [ i1 , i2 , i3 ] ; const labs = [ "ЗДАНИЕ:" , "КОРИДОР:" , "КАБИНЕТ:" ] ; imgs . forEach ( ( src , i ) => { const lbl = document . getElementById ( `label${ i + 1 } ` ) ; const cont = document . getElementById ( `imgCont${ i + 1 } ` ) ; if ( src && src !== 'null' ) { lbl . innerText = labs [ i ] ; cont . innerHTML = `<img src="img/"${ src } " style="width:100%;height:200px;object-fit:cover;margin-top:5px">` ; lbl . parentElement . style . display = 'block' ; } else lbl . parentElement . style . display = 'none' ; } ) ; document . getElementById ( 'traderModal' ) . style . display = 'block' ; }
0 commit comments