css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.1.1/bootstrap-social.min.css" />
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script type="text/javascript" src="https://tuemilio.com/assets/js/tuemilio-sdk.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
    <title>Tuemilio</title>
</head>
<body>

<div id="2175a92b-887d-5522-8714-2723f654617f">
    <input type="email" name="address" autocomplete="off" placeholder="name@email.com" required>
    <button type="button">Send</button>
    <div class="tu-message"></div>
    <div class="tu-share-social hidden">
            <a class="btn btn-social-icon btn-twitter text-white">
                <span class="fa fa-twitter"></span>
            </a>
            <a class="btn btn-social-icon btn-facebook text-white">
                <span class="fa fa-facebook"></span>
            </a>
            <a class="btn btn-social-icon btn-linkedin text-white">
                <span class="fa fa-linkedin"></span>
            </a>
            <a class="btn btn-social-icon btn-email text-white" style="background-color: darkred; font-size: 0.9em;">
                <span class="fa fa-envelope"></span>
            </a>
            <a class="btn btn-social-icon btn-whatsapp text-white" style="background-color: #25d366; font-size: 1em;">
                <span class="fa fa-whatsapp"></span>
            </a>
            <a class="btn btn-social-icon btn-reddit " style="color: #ff4500; background-color: white">
                <span class="fa fa-reddit"></span>
            </a>
            <a class="btn btn-social-icon btn-wechat text-white" style="background-color: #09B83E; font-size: 0.9em;">
                <span class="fa fa-weixin"></span>
            </a>
            <a class="btn btn-social-icon btn-telegram text-white" style="background-color: #0088cc; font-size: 0.9em;">
                <span class="fa fa-telegram"></span>
            </a>
        </div>

</div>

<div class="tu-dashboard hidden">
    <div class="container">
        <h1 class="my-3">Welcome <span class="text-muted" id="user"></span> to your dashboard!</h1>
        <h4 class="my-4 text-muted">You are in position <strong id="position"></strong> of <strong id="subscribers-count"></strong></h4>
        <div class="row">
            <div class="col">
                <div class="card">
                    <div class="card-body">
                        <h2 class="mb-3">Current Task</h2>
                        <p>Invite people you know personally and go up on the waiting list.</p>
                        <div class="form-row align-items-center tu-share-link">
                            <div class="col-9">
                                <input type="text" class="form-control mb-2" id="input-dashboard">
                            </div>
                            <div class="col-2">
                                <button type="submit" class="btn btn-primary mb-2" data-clipboard-target="#input-dashboard">Copy <span class="fa fa-copy ml-1"></span></button>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-3">
                                <small class="text-muted">Or share with:</small>
                            </div>
                            <div class="col-9">
                                <div class="tu-share-social hidden mt-1">
                                    <a class="btn btn-social-icon btn-twitter text-white">
                                        <span class="fa fa-twitter"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-facebook text-white">
                                        <span class="fa fa-facebook"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-linkedin text-white">
                                        <span class="fa fa-linkedin"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-email text-white" style="background-color: darkred; font-size: 0.9em;">
                                        <span class="fa fa-envelope"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-whatsapp text-white" style="background-color: #25d366; font-size: 1em;">
                                        <span class="fa fa-whatsapp"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-reddit " style="color: #ff4500; background-color: white">
                                        <span class="fa fa-reddit"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-wechat text-white" style="background-color: #09B83E; font-size: 0.9em;">
                                        <span class="fa fa-weixin"></span>
                                    </a>
                                    <a class="btn btn-social-icon btn-telegram text-white" style="background-color: #0088cc; font-size: 0.9em;">
                                        <span class="fa fa-telegram"></span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card">
                    <div class="card-body">
                        <h2 class="mb-4"><span id="referred-friends-count"></span> Referred Friends:</h2>
                        <ul class="list-group list-group-flush" id="referred-friends">
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="row my-3">
            <div class="col-6">
                <div class="card">
                    <div class="card-body">
                        <h2 class="mb-3">The waiting list</h2>
                        <p>This is your position on the list</p>
                        <ul class="list-group list-group-flush" id="waiting-list">
                            <li class="list-group-item text-center"><span class="pull-left">Position</span><span>Address</span><span class="pull-right">Points</span></li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="col-6">
                <div class="card">
                    <div class="card-body">
                        <h2 class="mb-3">Objective</h2>
                        <p>Invite 5 friends to unlock your price</p>
                        <div class="progress my-4">
                            <div id="progress-bar" class="progress-bar progress-bar-striped" role="progressbar" style="width: 10%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
            
          
!
            
              .hidden {
  display: none;
}
           
            
          
!
            
                  new ClipboardJS('.btn');

    let tuemilio = Tuemilio.new('2175a92b-887d-5522-8714-2723f654617f', {
        emptyInput: 'You forgot your email!',
        invalidEmail: 'Please enter a valid email',
        successfulSubscription: 'Thanks for subscribing!',
        error: 'There was an error with that email',
        //testMode: true
    });

    tuemilio.on('identified', (user) => {
        console.log('User is already subscribed');
    });

    tuemilio.on('subscribed', (dashboard) => {
        console.log('Successfully joined');
        tuemilio.button.classList.remove('loading');
    });

    tuemilio.on('submitted', () => {
        console.log('Email submitted');
        tuemilio.button.classList.add('loading');
    });

    tuemilio.on('dashboard', (dashboard) => {
        console.log('Dashboad available');

        tuemilio.buildShareable({
            link: dashboard.referral_link,
            facebookQuote:'I just joined this awesome waiting list! Fb',
            twitterQuote:'I just joined this awesome waiting list! Tw',
            hashTags: 'tuemilio,PH',
            whatsappQuote: 'I joined this, do it to:',
            redditQuote:'I just joined this awesome waiting list! Rd',
            telegramQuote:'I just joined this awesome waiting list! Tl',
            emailBody: 'Here is my link',
            emailSubject: 'I just joined this awesome waiting list! Email',
            linkQuote: 'Share the link below'
        });

        let ul = document.getElementById('referred-friends');

        dashboard.referreds.forEach((referred) => {
            let li = document.createElement('li');
            let badge = document.createElement('span');
            li.classList.add('list-group-item');
            badge.classList.add('badge');
            badge.classList.add('badge-primary');
            badge.classList.add('badge-pill');
            badge.classList.add('pull-right');
            li.appendChild(document.createTextNode(referred.user));
            badge.appendChild(document.createTextNode(referred.points));
            li.appendChild(badge);
            ul.appendChild(li);
        });

        let waitingList = document.getElementById('waiting-list');

        dashboard.waiters.forEach((referred) => {
            let li = document.createElement('li');
            let badge = document.createElement('span');
            let position = document.createElement('span');
            let address = document.createElement('span');

            li.classList.add('list-group-item');
            li.classList.add('text-center');
            badge.classList.add('badge');
            badge.classList.add('badge-primary');
            badge.classList.add('badge-pill');
            badge.classList.add('pull-right');
            position.classList.add('pull-left');

            position.appendChild(document.createTextNode(referred.position));
            badge.appendChild(document.createTextNode(referred.points));
            address.appendChild(document.createTextNode(referred.address));

            li.appendChild(position);
            li.appendChild(address);
            li.appendChild(badge);
            waitingList.appendChild(li);
        });


        document.getElementById('user').innerHTML = dashboard.user;
        document.getElementById('position').innerHTML = dashboard.position;
        document.getElementById('subscribers-count').innerHTML = dashboard.subscribers_count;
        document.getElementById('referred-friends-count').innerHTML = dashboard.referreds_count;

        $('#progress-bar').attr('aria-valuenow', dashboard.referreds_count*100/5).css('width', dashboard.referreds_count*100/5 + '%');

        tuemilio.form.classList.add('hidden');
        tuemilio.dashboard.classList.remove('hidden');

        //tuemilio.input.classList.add('hidden');
        //tuemilio.button.classList.add('hidden');

        //form.dashboard.innerHTML = JSON.stringify(dashboard);

    });
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console