メインコンテンツへスキップ
見出し画像

仮想通貨エアドロップ予測 ポイントから割り当てを参考にしてみよう

    どのくらいもらえるの?と気になるエアドロ。
    AIで割り当て確認アプリを作ってみました。

    画像

    使い方:

    1. 下記のコード全体をコピーします。

    2. テキストエディタ(メモ帳、VSCodeなど)を開き、コードを貼り付けます。

    3. ファイルを .html 拡張子で保存します(例: airdrop_calculator.html)。

    4. 保存したHTMLファイルをウェブブラウザ(Chrome, Firefox, Edgeなど)で開きます。

    これで、ブラウザ上に日本語のエアドロップ予測アプリが表示され、数値を入力して「計算」ボタンを押すと、結果が表形式で表示されます。

    〇コード

    <!DOCTYPE html>
    <html lang="ja">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>仮想通貨エアドロップ予測 ポイント編</title>
        <style>
            body {
                font-family: sans-serif;
                line-height: 1.6;
                margin: 20px;
                background-color: #f4f4f4;
            }
            .container {
                max-width: 800px;
                margin: auto;
                background: #fff;
                padding: 20px;
                border-radius: 8px;
                box-shadow: 0 0 10px rgba(0,0,0,0.1);
            }
            h1 {
                text-align: center;
                color: #333;
            }
            .input-group {
                margin-bottom: 15px;
            }
            .input-group label {
                display: block;
                margin-bottom: 5px;
                color: #555;
                font-weight: bold;
            }
            .input-group input[type="text"],
            .input-group input[type="number"] {
                width: 100%; /* Use 100% with box-sizing */
                padding: 10px;
                border: 1px solid #ccc;
                border-radius: 4px;
                box-sizing: border-box; /* Add this for consistent sizing */
            }
            .input-group .description {
                font-size: 0.85em;
                color: #888;
                margin-top: 3px;
            }
            button {
                display: block;
                width: 100%;
                padding: 12px;
                background-color: #5cb85c;
                color: white;
                border: none;
                border-radius: 4px;
                font-size: 1em;
                font-weight: bold; /* ボタンテキストを太字に */
                cursor: pointer;
                transition: background-color 0.3s ease;
            }
            button:hover {
                background-color: #4cae4c;
            }
            table {
                width: 100%;
                margin-top: 20px;
                border-collapse: collapse;
            }
            th, td {
                border: 1px solid #ddd;
                padding: 10px;
                text-align: right;
            }
            th {
                background-color: #f2f2f2;
                text-align: center;
                font-weight: bold;
            }
            td:first-child, th:first-child {
                 text-align: center;
            }
            #error-message {
                color: red;
                margin-top: 10px;
                font-weight: bold;
                text-align: center;
            }
            .user-value {
                font-weight: bold;
                color: green;
            }
            .text-left { text-align: left; }
            .text-center { text-align: center; }
            input.error-border {
                 border-color: red !important;
            }
            #error-message:empty {
                display: none;
             }
        </style>
    </head>
    <body>
    
    <div class="container">
        <!-- --- ↓↓↓ HTMLの変更箇所 ↓↓↓ --- -->
        <h1>✨ 仮想通貨エアドロップ予測 ポイント編 ✨</h1> <!-- タイトルに飾りを追加 -->
        <!-- --- ↑↑↑ HTMLの変更箇所 ↑↑↑ --- -->
    
        <div class="input-group">
            <label for="fdv">予想FDV (完全希薄化後評価額) USD</label>
            <input type="number" id="fdv" value="10000000000">
            <div class="description">例: 100億USDなら 10000000000 と入力</div>
        </div>
    
        <div class="input-group">
            <label for="total-points">総ポイント数</label>
            <input type="number" id="total-points" value="1250000000000">
            <div class="description">システム全体の合計ポイント数を入力</div>
        </div>
    
        <div class="input-group">
            <label for="user-points">あなたのポイント数</label>
            <input type="number" id="user-points" value="2200000">
             <div class="description">あなたが獲得したポイント数を入力</div>
        </div>
    
        <div class="input-group">
            <label for="allocations">エアドロップ割り当て率 (%)</label>
            <input type="text" id="allocations" placeholder="例: 5,6,7,8,9,10" value="5,6,7,8,9,10,11,12,13,14,15">
            <div class="description">複数のパーセンテージをカンマ(,)区切りで入力</div>
        </div>
    
        <button id="calculateBtn">計算する</button>
    
        <div id="error-message"></div>
    
        <table id="resultTable">
            <thead>
                <tr>
                    <th>割当率 (%)</th>
                    <th>総エアドロ価値 (USD)</th>
                    <th>ポイント単価 (USD)</th>
                    <th>あなたの予想受取額 (USD)</th>
                </tr>
            </thead>
            <tbody>
                <!-- 結果はここに挿入されます -->
            </tbody>
        </table>
    </div>
    
    <script>
        function formatNumber(num, decimals = 2) {
            if (isNaN(num) || num === null) return 'N/A';
            return num.toLocaleString(undefined, {
                minimumFractionDigits: decimals,
                maximumFractionDigits: decimals
            });
        }
    
        function formatSmallNumber(num, decimals = 8) {
            if (isNaN(num) || num === null) return 'N/A';
            return num.toLocaleString(undefined, {
                minimumFractionDigits: decimals,
                maximumFractionDigits: decimals
            });
        }
    
        function setErrorState(element, isError, messageDiv, message) {
            if (isError) {
                element.classList.add('error-border');
                messageDiv.textContent += message + '\n';
            } else {
                element.classList.remove('error-border');
            }
        }
    
        document.getElementById('calculateBtn').addEventListener('click', function() {
            const fdvInput = document.getElementById('fdv');
            const totalPointsInput = document.getElementById('total-points');
            const userPointsInput = document.getElementById('user-points');
            const allocationsInput = document.getElementById('allocations');
            const resultTableBody = document.querySelector('#resultTable tbody');
            const errorMessageDiv = document.getElementById('error-message');
    
            resultTableBody.innerHTML = '';
            errorMessageDiv.textContent = '';
            fdvInput.classList.remove('error-border');
            totalPointsInput.classList.remove('error-border');
            userPointsInput.classList.remove('error-border');
            allocationsInput.classList.remove('error-border');
    
            const fdv = parseFloat(fdvInput.value);
            const totalPoints = parseFloat(totalPointsInput.value);
            const userPoints = parseFloat(userPointsInput.value);
            const allocationString = allocationsInput.value;
    
            let hasError = false;
    
            const isFdvError = isNaN(fdv) || fdv <= 0;
            setErrorState(fdvInput, isFdvError, errorMessageDiv, 'FDVは正の数値を入力してください。');
            if(isFdvError) hasError = true;
    
            const isTotalPointsError = isNaN(totalPoints) || totalPoints <= 0;
            setErrorState(totalPointsInput, isTotalPointsError, errorMessageDiv, '総ポイント数は正の数値を入力してください。');
             if(isTotalPointsError) hasError = true;
    
            const isUserPointsError = isNaN(userPoints) || userPoints < 0;
            setErrorState(userPointsInput, isUserPointsError, errorMessageDiv, 'あなたのポイント数は0以上の数値を入力してください。');
            if(isUserPointsError) hasError = true;
    
            if (!isTotalPointsError && !isUserPointsError && userPoints > totalPoints) {
                errorMessageDiv.textContent += 'あなたのポイント数が総ポイント数を超えています。\n';
                userPointsInput.classList.add('error-border');
                totalPointsInput.classList.add('error-border');
                hasError = true;
            }
    
            const allocationPercentages = allocationString.split(',')
                .map(s => s.trim())
                .filter(s => s !== '')
                .map(s => parseFloat(s));
    
            const isAllocationError = allocationPercentages.some(isNaN) || allocationPercentages.some(p => p <= 0 || p > 100) || allocationPercentages.length === 0;
            setErrorState(allocationsInput, isAllocationError, errorMessageDiv, 'エアドロップ割り当て率は、1つ以上の有効なパーセンテージ(1-100)をカンマ区切りで入力してください。');
            if(isAllocationError) hasError = true;
    
            if (hasError) {
                return;
            }
    
            allocationPercentages.forEach(percentage => {
                const allocationRate = percentage / 100;
                const totalAirdropValue = fdv * allocationRate;
                const userShare = totalPoints > 0 ? userPoints / totalPoints : 0;
                const userAirdropValue = totalAirdropValue * userShare;
                const pricePerPoint = totalPoints > 0 ? totalAirdropValue / totalPoints : 0;
    
                const row = resultTableBody.insertRow();
    
                // --- ↓↓↓ JavaScriptの変更箇所 ↓↓↓ ---
                row.innerHTML = `
                    <td class="text-center">${percentage}%</td>
                    <td>$${formatNumber(totalAirdropValue, 0)}</td>
                    <td>$${formatSmallNumber(pricePerPoint, 7)}</td>
                    <td><span class="user-value">$${formatNumber(userAirdropValue, 2)}</span></td>
                `;
                // --- ↑↑↑ JavaScriptの変更箇所 ↑↑↑ ---
            });
    
             if (resultTableBody.rows.length > 0) {
                 resultTableBody.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
             }
        });
    
    </script>
    
    </body>
    </html>

    計算ロジック:

    • 割当率 (%) / 100 で計算用のレートを求めます。

    • 総エアドロップ価値 = FDV * レート

    • ユーザーシェア = あなたのポイント数 / 総ポイント数

    • あなたの予想受取額 = 総エアドロップ価値 * ユーザーシェア

    • ポイント単価 = 総エアドロップ価値 / 総ポイント数

    〇参考

    EclipseFNDのエアドロ予測と計算アプリ

    Eclipse已快照,恭喜各位养牛人。是时候检验养牛的成果了。如果 @EclipseFND 最终按照 Grass 数量来分配空投的话。大概率是反撸的。按照当前前25万地址总计1249.6 亿草计算。… https://t.co/ivkircnr2D pic.twitter.com/HMfLEAl5T4

    — 追风Lab .eth🌿 (@ZF_lab) April 12, 2025

    〇まとめ
    サイトはゴージャスにしようと思えばできそうです。
    他のツールや地合い、考察と組み合わせる必要はありますが、
    エアドロ予想して、ちょっと楽しみに思うのは良いかもです!

     
     

    LiG★

     
     
    仮想通貨系中心に有益情報を無限に。量が多いので、検索は検索バーで「LiG★と検索したい単語」でボタンを押してください。加筆が多いため、何回も見てもらえると幸いです。 参考にさせていただいてる方々いつもありがとうございます。このアカウントはLINEグループから転生したものです。