3232 <div class =" -mt-12" id =" map-wrapper" >
3333 <div class =" relative" >
3434 <div id =" map" class =" w-map max-w-full relative h-max" ></div >
35- <pre class =" bg-opacity-70 bg-white coordinate-attr absolute bottom-0 left-0 cursor-pointer z-1k" @click =" copyText($event, clickedCoords)" v-if = " clickedCoords " >{{ clickedCoords }}</pre >
35+ <pre class =" bg-opacity-70 bg-white coordinate-attr absolute bottom-0 left-0 cursor-pointer z-1k" v-if = " clickedCoords " >< span @click =" copyText($event, clickedCoords)" >{{ clickedCoords }}</ span > / < span @click = " copyText($event, coordsCommand) " >{{ t('map.command') }}</ span > </pre >
3636 </div >
3737 <div v-if =" afkPeople" class =" w-map-right pt-4" >
3838 <h3 class =" mb-2" >{{ t('map.afk_title') }}</h3 >
@@ -51,6 +51,7 @@ import L from "leaflet";
5151import {GestureHandling } from " leaflet-gesture-handling" ;
5252import " leaflet-rotatedmarker" ;
5353import custom_icons from " ../../data/vehicles.json" ;
54+ const Rainbow = require (' rainbowvis.js' );
5455
5556(function (global ){
5657 let MarkerMixin = {
@@ -99,6 +100,7 @@ export default {
99100 trackedPlayer: window .location .hash .substr (1 ),
100101 firstRefresh: true ,
101102 clickedCoords: ' ' ,
103+ coordsCommand: ' ' ,
102104 afkPeople: ' ' ,
103105 openPopup: null
104106 };
@@ -194,7 +196,7 @@ export default {
194196 };
195197
196198 $ .each (custom_icons, function (type , cfg ) {
197- if (cfg .models .includes (vehicle .model )) {
199+ if (cfg .models .includes (vehicle .model + " " )) {
198200 ret .type = type;
199201 ret .size = cfg .size ;
200202 }
@@ -370,16 +372,22 @@ export default {
370372 const lastExtra = attributes .pop ();
371373 extra += ' <br><i>Is ' + (attributes .length > 0 ? attributes .join (' , ' ) + ' and ' : ' ' ) + lastExtra + ' </i>' ;
372374
373- if (player .afk > 300 ) {
375+ if (player .afk > 15 * 60 ) {
374376 extra += ' <br><i>Hasn\' t moved in ' + _this .formatSeconds (player .afk ) + ' </i>' ;
375377 }
376- if (player .afk > 15 * 60 ) {
377- const linkColor = isStaff ? ' text-green-600 dark:text-green-400' : ' text-indigo-600 dark:text-indigo-400' ;
378+ if (player .afk > 30 * 60 ) {
379+ const linkColor = isStaff ? ' rgb(16, 185, 129)' : (() => {
380+ let rainbow = new Rainbow ();
381+ rainbow .setNumberRange (30 * 60 , 3 * 60 * 60 );
382+ rainbow .setSpectrum (' #d9ff00' , ' #ffbf00' , ' #ff6600' , ' #ff0000' );
383+
384+ return ' #' + rainbow .colourAt (player .afk );
385+ })();
378386
379387 afkList .push (` <tr title="` + (isStaff ? ' Is a staff member' : ' ' ) + ` ">
380- <td class="pr-2"><a class=" ` + linkColor + ` " target="_blank" href="/players/` + player .steamIdentifier + ` ">` + player .character .fullName + ` </a></td>
388+ <td class="pr-2"><a style="color: ` + linkColor + ` " target="_blank" href="/players/` + player .steamIdentifier + ` ">` + player .character .fullName + ` </a></td>
381389 <td class="pr-2">hasn't moved in ` + _this .formatSeconds (player .afk ) + ` </td>
382- <td><a class="` + linkColor + ` track-cid " href="#" data-trackid="` + id + ` " data-popup="true">[Track]</a></td>
390+ <td><a class="track-cid" style="color: ` + linkColor + ` " href="#" data-trackid="` + id + ` " data-popup="true">[Track]</a></td>
383391</tr>` .replace (/ \r ? \n (\s {4} )? / gm , ' ' ));
384392 }
385393
@@ -507,6 +515,7 @@ export default {
507515 };
508516
509517 _this .clickedCoords = " [X=" + Math .round (game .x ) + " ,Y=" + Math .round (game .y ) + " ] / [X=" + map .x + " ,Y=" + map .y + " ]" ;
518+ _this .coordsCommand = " /tp_coords " + Math .round (game .x ) + " " + Math .round (game .y );
510519
511520 console .info (' Clicked coordinates' , map);
512521 });
0 commit comments