<!doctype html>
<meta charset="utf-8" />

<head>
    <title>About Vesktop</title>

    <link rel="stylesheet" href="./common.css" type="text/css" />

    <style>
        body {
            padding: 2em;
        }

        h1 {
            text-align: center;
        }

        ul {
            display: flex;
            flex-direction: column;
            gap: 0.5em;
        }
    </style>
</head>

<body>
    <h1 id="title">Vesktop v{{APP_VERSION}}</h1>
    <p>Vesktop is a cross platform Discord Desktop client, aiming to give you a better Discord experience</p>

    <section>
        <h2>Links</h2>
        <ul>
            <li>
                <a href="https://vesktop.dev" target="_blank">Vesktop Website</a>
            </li>
            <li>
                <a href="https://vesktop.dev/wiki" target="_blank">Vesktop Wiki</a>
            </li>
            <li>
                <a href="https://github.com/Vencord/Vesktop" target="_blank">Source Code</a>
            </li>
            <li>
                <a href="https://github.com/Vencord/Vesktop/issues" target="_blank">Report bugs / Request features</a>
            </li>
        </ul>
    </section>

    <section>
        <h2>License</h2>
        <p>
            Vesktop is licensed under the
            <a href="https://www.gnu.org/licenses/gpl-3.0.txt" target="_blank">GNU General Public License v3.0</a>.
            <br />
            This is free software, and you are welcome to redistribute it under certain conditions; see the license for
            details.
        </p>
    </section>

    <section>
        <h2>Acknowledgements</h2>
        <p>These awesome libraries empower Vesktop</p>
        <ul>
            <li>
                <a href="https://github.com/electron/electron" target="_blank">Electron</a>
                - Build cross-platform desktop apps with JavaScript, HTML, and CSS
            </li>
            <li>
                <a href="https://github.com/electron-userland/electron-builder" target="_blank">Electron Builder</a>
                - A complete solution to package and build a ready for distribution Electron app with "auto update"
                support out of the box
            </li>
            <li>
                <a href="https://github.com/OpenAsar/arrpc" target="_blank">arrpc</a>
                - An open implementation of Discord's Rich Presence server
            </li>
            <li>
                <a href="https://github.com/Soundux/rohrkabel" target="_blank">rohrkabel</a>
                - A C++ RAII Pipewire-API Wrapper
            </li>
            <li>
                And many
                <a href="https://github.com/Vencord/Vesktop/blob/main/pnpm-lock.yaml" target="_blank">more open source
                    libraries</a>
            </li>
        </ul>
    </section>
</body>

<script>
    const data = new URLSearchParams(location.search);

    // replace all {{FOO}} placeholders in the document with the values from the URL

    /** @param {Node} [node] */
    function walk(node) {
        if (node.nodeType === Node.TEXT_NODE) {
            node.textContent = node.textContent.replace(/{{(\w+)}}/g, (match, key) => data.get(key) || match);
            return;
        }

        if (node.nodeType === Node.ELEMENT_NODE && node.nodeName !== "SCRIPT") {
            for (const child of node.childNodes) {
                walk(child);
            }
        }
    }

    walk(document.body);
</script>