<% const startTime = DateTime.fromSeconds(match.startDateTime).toFormat("yyyy-MM-dd HH:mm:ss").slice(2); %> <% const endTime = DateTime.fromSeconds(match.endDateTime).toFormat("yyyy-MM-dd HH:mm:ss").slice(2); %> <% const gameModeStr = ($t("dota2tracker.template.lobby_types." + match.lobbyType) || match.lobbyType) + " / " + ($t("dota2tracker.template.game_modes." + match.gameMode) || match.gameMode); %> <% const regionStr = $t("dota2tracker.template.regions." + match.regionId); %> <% const bannedHeroes = (match.pickBans ?? [])
    .filter(x => !x.isPick)
    .map(hero => {
      const heroData = dotaconstants.heroes[hero.bannedHeroId];
      const matchName = /^npc_dota_hero_(?<name>.+)$/.exec(heroData.name);
      return matchName ? matchName[1] : "";
    });
%> <% const banGradientStyle = "background-image: linear-gradient(to bottom left, transparent calc(50% - 1px), red calc(50% - 1px), black calc(50% + 1px), transparent calc(50% + 1px));"; %> <div class="w-[790px] h-[100px] flex justify-between box m-[5px]"><div class="flag w-[100px] h-full flex justify-center items-end bg-cover <%= !match.didRadiantWin ? 'grayscale' : "" %>" style="background-image:url('<%= getImageUrl("flag_radiant") %>')"> <%= match.didRadiantWin ? $t("dota2tracker.template.won") : "" %> </div><div class="details grow relative flex-col flex"><p class="w-full flex justify-around"><span><%= $t("dota2tracker.template.match_id_") %><%= match.id %></span><span><%= $t("dota2tracker.template.game_mode_") %><%= gameModeStr %></span><span><%= $t("dota2tracker.template.region_") %><%= regionStr %></span></p><p class="w-full flex justify-around"><span><%= $t("dota2tracker.template.start_time_") %><%= startTime %></span><span><%= $t("dota2tracker.template.end_time_") %><%= endTime %></span></p><p class="w-full grow score flex justify-evenly items-end"><span class="score radiant text-3xl"><%= match.radiant.killsCount %></span><span class="time text-sm"><%= match.durationTime %></span><span class="score dire text-3xl"><%= match.dire.killsCount %></span></p><div class="rank absolute w-[64px] h-[64px] bottom-[10px] left-1/2 -translate-x-1/2<%- match.odParsed && match.lobbyType !== "RANKED" ? ` grayscale` : "" %>"><img class="star absolute w-full" src="<%= getImageUrl('star_' + (match.rank ? match.rank.toString().split('')[1] : '')) %>"> <img class="medal absolute w-full" src="<%= getImageUrl('medal_' + (match.rank ? match.rank.toString().split('')[0] : '')) %>"></div></div><div class="flag w-[100px] h-full flex justify-center items-end bg-cover <%= match.didRadiantWin ? 'grayscale' : "" %>" style="background-image:url('<%= getImageUrl("flag_dire") %>')"> <%= !match.didRadiantWin ? $t("dota2tracker.template.won") : "" %> </div></div><div class="w-[790px] grid grid-cols-2 gap-[5px] mx-[5px]"> <% match.players.forEach(player => { %> <%- include(`./player.ejs`, { match, player, utils: {kc, dc, laneSVG}, partyColor }) %> <% }); %> </div><div class="ban_list box m-[5px] flex flex-wrap"> <% bannedHeroes.forEach(heroName => { %> <div class="ban_hero relative w-[10%]"><i class="absolute w-full h-full z-1" <%- `style="${banGradientStyle}"` %>></i> <img class="grayscale" src="<%= getImageUrl(heroName, ImageType.Heroes) %>" alt=""/></div> <% }); %> </div>