Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<label for="show">show:</label>
  <input type="number" id="show" name="show" value="100">
<label for="rate">rate:</label>
<select id="rate">
  <option value="all">all</option>
  <option value="cool">cool</option>
  <option value="warm">warm</option>
  <option value="hot">hot</option>
</select>
<label for="cost">cost:</label>
<select id="cost">
  <option value="all">all</option>
  <option value="free">free</option>
  <option value="cheap">cheap</option>
  <option value="affordable">affordable</option>
  <option value="expensive">expensive</option>
</select>
<label for="category">category:</label>
<select id="category">
  <option value="all">all</option>
  <option value="monetization">monetization</option>
</select>
<div id="referrals"></div>



<!-- The code below is for bittube airtime monetization, you may ignore, or are you interested? you can make yours here https://bittube.app/?ref?2JY4FE0CP -->
<meta name="airtime-platform-display" content="codepen.io.0fajarpurnama0">
<meta name="airtime-platform-id" content="281894da-692a-e042-81e1-964f40797172">
<script src="https://bittubeapp.com/tubepay/airtime.loader.js" data-verify="meta" data-autostart="true"></script>
<!-- bittube airtime code ends -->
              
            
!

CSS

              
                
              
            
!

JS

              
                $('#show, #rate, #cost, #category').ready(function(){
  referrals();
}).change(function(){
  referrals();
});

function referrals(){
  var print_count = 0;
  var show = $('#show').val();
  var rate = $('#rate').val();
  var cost = $('#cost').val();
  var category = $('#category').val();
  $('#referrals').html('');
  $.getJSON('https://0fajarpurnama0.github.io/assets/json/referrals.json', function(data) {
    if(rate == 'all' && cost == 'all' && category == 'all'){
      for(i = 0; i < data.referral.length; i++){
        print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
        print_count++;
        if(print_count == show){
          break;
        }
      }
    } else if(rate == 'all' && cost == 'all'){
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].category==category){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    } else if(rate == 'all' && category == 'all'){
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].cost==cost){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    } else if(cost == 'all' && category == 'all'){
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].rate==rate){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    } else if(rate == 'all'){
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].cost==cost && data.referral[i].category==category){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    } else if(cost == 'all'){
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].rate==rate && data.referral[i].category==category){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    } else if(category == 'all'){
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].rate==rate && data.referral[i].cost==cost){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    } else {
      for(i = 0; i < data.referral.length; i++){
        if(data.referral[i].rate==rate && data.referral[i].cost==cost && data.referral[i].category==category){
          print_referral(data.referral[i].name, data.referral[i].link, data.referral[i].commission, data.referral[i].requirement, data.referral[i].moreinfo);
          print_count++;
          if(print_count == show){
            break;
          }
        }
      } 
    }
  });
}

function print_referral(name, link, commission, requirement, moreinfo, show, i){
  $('#referrals').append(`
    <h3>`+name+`</h3>
		<ul>
      <li>Referral link:<a href="`+link+`">`+link+`</a></li>
      <li class="commission">Commission: `+commission+`</li>
      <li>Requirement: `+requirement+`</li>
      <li>More info: <a href="`+moreinfo+`">`+moreinfo+`</a></li>
		 </ul>   
  `);
}
              
            
!
999px

Console