Type-J

Type-J๋Š” ๋ ˆ๋ฒจ์ด ์žˆ๋Š” ๋ฏธ๋‹ˆ ๊ฒŒ์ž„์—์„œ ์ž์ฃผ ์“ฐ์ด๋Š” Custom Label ์ž…๋‹ˆ๋‹ค.

๋˜ฅ ํ”ผํ•˜๊ธฐ ๊ฒŒ์ž„์—์„œ ์“ฐ์ธ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฏธ์ง€

์˜ˆ์ œ ์ฝ”๋“œ

function showLabelTypeJ(player, key, text1, text2, text3) {
    const isMobile = player.isMobile;
    const topGap = isMobile ? 10 : -2; // 60px from the top on mobile and 48px on PC.
    /**
     * size based @labelPercentWidth
     * XL: isMobile ? 90 : 50;
     * L: isMobile ? 80 : 40;
     * M: isMobile ? 70 : 28;
     * S: isMobile ? 60 : 20
     */
    const labelPercentWidth = isMobile ? 60 : 20;
    const labelDisplayTime = 300000;

    const directionColumnStyle = `
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center;`.trim();

    const rowStyle = `
    display: flex; 
    align-items: center;
    justify-content: center;
    text-align: center;
    `.trim();

    const spanStyle = `
    font-size: ${isMobile ? "14px" : "18px"};
    font-weight: 700; 
    color: white;`.trim();

    const highlightSpanStyle = `
    font-size: ${isMobile ? "14px" : "18px"};
    font-weight: 700; 
    color: #FFEB3A;`.trim(); // Show red(#FF5353) when timeout is about to expire 

    const customLabelOption = {
        key: key,
        borderRadius: '12px',
        fontOpacity: false,
        padding: '8px',
    }

    let htmlStr = `
<span style="${directionColumnStyle}">
    <span style="${spanStyle}">${text1}</span>
    <span style="${rowStyle}">
        <span style="${spanStyle}">${text2}</span>
        <span style="${highlightSpanStyle}">${text3}</span>
    </span>
</span>`;

    player.showCustomLabel(htmlStr.trim(), 0xffffff, 0x27262e, topGap, labelPercentWidth, 0.64, labelDisplayTime, customLabelOption);
}

Last updated