<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JEdrock - уведомления</title>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="shortcut icon" href="assets/img/favicon.png" type="image/x-icon">

    <link href="https://fonts.googleapis.com/css2?family=Mulish:wght@200;300;400;500;600;700;800;900;1000&display=swap"
        rel="stylesheet">
    <link
        href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&display=swap"
        rel="stylesheet">
</head>

<body>

    <div id="preloader">
        <div class="loader"></div>
    </div>

    <script>
        window.addEventListener('load', function () {
            var preloader = document.getElementById('preloader');
            var content = document.querySelector('.content');
            preloader.style.display = 'none';
            content.style.display = 'block';
        });
    </script>

    <nav class="navbar navbar-expand-lg">
        <div class="container">
            <a class="navbar-brand" href="account.html"><img src="/assets/img/logo.png" width="80px" alt=""></a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="justify-content-center collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="justify-content-center navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" href="https://mineserv.top/jedrock?vote">Проголосовать</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#footer">Контакты</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="https://discord.gg/6GCZPVQw4C">Discord</a>
                    </li>

                    <div class="nav-menu-block">
                        <a class="a-acc" href="../account">
                            <li class="li-acc">Мой аккаунт</li>
                        </a>

                        <a class="a-acc" href="../notifications">
                            <li class="li-acc">Мои уведомления</li>
                        </a>

                        <a class="a-acc" href="../transation">
                            <li class="li-acc">Мои транкзации</li>
                        </a>
                        <a class="a-acc" href="../chat">
                            <li class="li-acc">Голосовой чат</li>
                        </a>
                    </div>

                </ul>
            </div>
        </div>
    </nav>

    <section class="main-account">
        <div class="container">
            <div class="row ll">
                <div class="col-2 col-lg-4 acc-nav-col">
                    <div class="acc-nav">
                        <ul class="ul-acc">
                            <a class="a-acc" href="../account">
                                <li class="li-acc">Мой аккаунт</li>
                            </a>
                            <a class="a-acc" href="../notifications">
                                <li class="li-acc activeLink">Мои уведомления</li>
                            </a>
                            <a class="a-acc" href="../transation">
                                <li class="li-acc">Мои транкзации</li>
                            </a>
                            <a class="a-acc" href="../chat">
                                <li class="li-acc">Голосовой чат</li>
                            </a>
                        </ul>
                    </div>
                </div>


                <div class="col-2 col-lg-4">
                    <div class="acc-acc">

                        <div class="notification-main">
                            <div class="notif-name">
                                <p class="my-notif">Мои уведомления</p>
                            </div>
                            <% for (let i=messages.length - 1; i>= 0; i--) { %>
                                <% const message=messages[i]; %>

                                    <% const formattedContent=message.content .replace(/\*(.*?)\*/g, '<b>$1</b>' )
                                        .replace(/_(.*?)_/g, '<i>$1</i>' ) .replace(/<@&(\d+)>/g, (match, roleId) => {
                                        const role = roles.find((r) => r.id === roleId);
                                        if (role) {
                                        return `<span class="role-mention">@${role.name}</span>`;
                                        } else {
                                        return match;
                                        }
                                        })
                                        .replace(/<#(\d+)>/g, (match, channelId) => {
                                            const channel = channels.find((c) => c.id === channelId);
                                            if (channel) {
                                            return `<span class="channel-mention">"#${channel.name}"</span>`;
                                            } else {
                                            return match;
                                            }
                                            })
                                            .replace(/<:(.*?):(\d+)>/g, (match, emojiName, emojiId) => {
                                                return `<img src="https://cdn.discordapp.com/emojis/${emojiId}.png"
                                                    alt="${emojiName}" class="emoji" width="20px" />`;
                                                }); %>

                                                <% const messageDate=message.createdAt.getDate(); %>
                                                    <% const messageMonth=message.createdAt.getMonth() + 1; %>
                                                        <% const
                                                            messageYear=message.createdAt.getFullYear().toString().slice(-2);
                                                            %>
                                                            <div class="notification__border">
                                                                <div class="notif-title">
                                                                    <p class="n-tit">
                                                                        <%= message.channel.name %>
                                                                    </p>
                                                                </div>
                                                                <div class="notif-text">
                                                                    <p class="n-txt">
                                                                        <%= message.author.username %>: <%-
                                                                                formattedContent %>

                                                                                <% if (message.attachments.size> 0) { %>
                                                                                    <% const
                                                                                        attachment=message.attachments.first();
                                                                                        %>
                                                                                        <% if (attachment &&
                                                                                            attachment.url) { %>
                                                                                            <img src="<%= attachment.url %>"
                                                                                                class="notif-img">
                                                                                            <% } %>
                                                                                                <% } %>
                                                                    </p>
                                                                </div>

                                                                <div class="notif-date">
                                                                    <p class="n-d">
                                                                        <%= messageDate %>.<%= messageMonth %>.<%=
                                                                                    messageYear %>
                                                                    </p>
                                                                </div>
                                                            </div>
                                                            <% } %>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
    <footer id="footer">
        <div class="container">
            <div class="row">
                <div class="col">
                    <div class="footer">
                        <ul class="footer-ul">
                            <li class="footer-li">
                                <p class="footer-name">Контакты:</p>
                            </li>
                            <li class="footer-li"><a href="alphabaqpla@outlook.com">EMail: alphabaqpla@outlook.com</a>
                            </li>
                            <li class="footer-li"><a href="">Телефон: +79520800416</a></li>
                            <li class="footer-li"><a href="">Адрес: 119021, г. Москва, Фрунзенская набережная, д. 12</a>
                            </li>
                        </ul>
                    </div>
                </div>

                <div class="col">
                    <div class="footer">
                        <ul class="footer-ul">
                            <li class="footer-li">
                                <p class="footer-name">Полезные Ссылки:</p>
                            </li>
                            <li class="footer-li"><a href="https://mineserv.top/jedrock?vote">Проголосовать</a></li>
                            <li class="footer-li"><a href="/oferta">Договор оферты</a></li>
                            <li class="footer-li"><a href="/politconf">Политика конфиденциальности</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <p class="ip">Проект JEdrock никак не относится к Mojang, AB. <br>
            ИП Карташов Тимур Михайлович
            | ИНН 024505942067
            | ОГРН 318028000117490</p>
        <p class="copy">© 2023 JEdrock.fun Все права защищены.</p>
        <div class="footer-img">
            <div class="d"><img src="/assets/img/mk.png" alt=""></div>
            <div class="d"><img src="/assets/img/visa.png" alt=""></div>
            <div class="d"><img src="/assets/img/mir.png" alt=""></div>
            <div class="d"><img src="/assets/img/sbp.png" alt=""></div>
        </div>
        <hr>
        <p class="dev text-center">Developed: <a class="gradient" href="https://t.me/dgilyazov">GilazovDEV</a>
        </p>
    </footer>

    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/script.js"></script>
</body>

</html>