Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <head>
  <title>Custom List</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.0/css/framework7.material.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.0/css/framework7.material.colors.min.css">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
</head>

<body>
  <div class="shadow"></div>
  <div class="confirm ">
    <p>Restore default order?</p>
    <a href="#" class="yes buttonn close-panel" onclick="Javascript:reset()">Yes</a>
    <a href="#" class="no buttonn">No</a>
  </div>
  <div class="statusbar-overlay"></div>
  <div class="panel-overlay"></div>
  <div class="panel panel-left panel-cover">
  </div>
  <div class="panel panel-right panel-reveal">
    <p>Right panel content goes here</p>
  </div>
  <div class="views">
    <div class="view view-main">
      <div class="pages navbar-fixed">
        <div data-page="index" class="page">
          <div class="navbar">
            <div class="navbar-inner">
              <div class="center">Custom App</div>
              <div class="right"><a href="#" class="open-panel link icon-only"><i class="icon icon-bars"></i></a></div>
            </div>
          </div>
          <div class="page-content">
            <div class="settings">
              <a href="#" class="restore buttonn">Restore</a>
              <span class="toggle-text">Customize</span>
              <input type="checkbox" id="unchecked" class="cbx hidden" />
              <label for="unchecked" class="toggle-sortable lbl"></label>
            </div>
            <div class="list-block sortable">
              <ul id="linklist" class="center">
                <li data-id="1">
                  <a href="#" class="item-link item-content">
                    <i class="bus"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 1</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="2">
                  <a href="https://codepen.io/RogerHN/pen/pEwqNj.html" class="item-link item-content">
                    <i class="bus az"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 2</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="3">
                  <a href="#" class="item-link item-content">
                    <i class="bus vd"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 3</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="4">
                  <a href="#" class="item-link item-content">
                    <i class="bus am"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 4</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="5">
                  <a href="#" class="item-link item-content">
                    <i class="bus az"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 5</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="6">
                  <a href="#" class="item-link item-content">
                    <i class="bus az"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 6</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="7">
                  <a href="#" class="item-link item-content">
                    <i class="bus vd"></i>
                    <div class="item-inner">
                      <div class="item-title">Linha 7</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="8">
                  <a href="#" class="item-link item-content">
                    <i class="bus"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 8</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="9">
                  <a href="#" class="item-link item-content">
                    <i class="bus"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 9</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
                <li data-id="10">
                  <a href="#" class="item-link item-content">
                    <i class="bus am"></i>
                    <div class="item-inner">
                      <div class="item-title">Link 10</div>
                    </div>
                  </a>
                  <div class="checky mini selected fade">
                    <span class="figure"></span>
                    <span class="label">Add</span>
                    <span class="label label-selected">Remove</span>
                  </div>
                  <div class="sortable-handler"></div>
                </li>
              </ul>
            </div>
            <!--
            <div class="content-block-title">Side panels</div>
            <div class="content-block">
              <div class="row">
                <div class="col-50"><a href="#" data-panel="left" class="button open-panel">Left Panel</a></div>
                <div class="col-50"><a href="#" data-panel="right" class="button open-panel">Right Panel</a></div>
              </div>
            </div>
-->
          </div>
        </div>
      </div>
    </div>
  </div>

  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.0/js/framework7.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</body>

</html>
              
            
!

CSS

              
                .centerlist {
  text-align: center;
  display: block;
  line-height: 36px;
  vertical-align: middle;
  min-height: 36px;
  border-bottom: 1px solid #ddd;
}
.content-block-title {
  font-size: 16px;
}
.content-block.margin10 {
  margin-top: 10px;
}
.content-block-title.margin10 {
  margin: 12px 16px 16px;
  padding-top: 15px;
}
.content-block-title.center.margin10 {
  margin: 10px;
  padding: 0px;
}
.settings {
  display: block;
  margin-top: 10px;
  z-index: 1;
  text-align: right;
  width: 100%;
  line-height: 36px;
}
.custom.buttonn {
  background-color: #03a9f4;
}
.custom.buttonn {
  background-color: #03a9f4;
}
.save.buttonn {
  background-color: #00a450;
  display: none;
}
a.save.buttonn.close-sortable.show {
  display: inline-block;
}
.restore.buttonn {
  background-color: #f44336;
  display: none;
}
.show {
  display: inline-block;
}
.buttonn {
  background-color: #999;
  color: #fff;
  background-size: 22px;
  background-repeat: no-repeat;
  padding: 4px 8px 4px 8px;
  background-position: 8px center;
  border-radius: 0px;
  margin: 0 10px 0 0;
  font-size: 14px;
  display: inline-block;
}
.list-block.sortable {
  margin-top: 10px;
}
.list-block .item-title {
  font-size: 16px;
}
a.item-link.item-content {
  padding-left: 0px;
}
.list-block .item-inner {
  padding-left: 16px;
}
.center {
  text-align: center;
}
.panel-left {
  padding: 10px 16px;
}
.shadow {
  z-index: 9999;
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  display: none;
}
.confirm {
  position: absolute;
  z-index: 99999;
  top: 30%;
  max-width: 200px;
  min-width: 200px;
  background: #fff;
  text-align: center;
  box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.5);
  display: none;
  height: 100px;
  margin: 0 auto;
  left:0;
  right:0;
}
.text {
  position: absolute;
  top: 15px;
  z-index: 2;
  width:40%;
  max-width: 960px;
  min-width: 600px;
  height: 60px;
  overflow: hidden;
  background: #fff;
  margin: 0 auto;
  left:0;
  right:0;
}
.confirm p {
  margin: 15px 10px 5px;
}
.yes, .no {
  color: #fff;
  padding: 5px 10px;
  display: inline-block;
  margin: 10px;
}
.yes {
  background: #00a450;
}
.no {
  background: #f44336;
}
.modalscreen {
  display: block;
}
body {
  background: #eee;
}
.toggle-text {
  margin-right: 10px;
  color: #999;
}
.blue {
  color: #2196f3
}
.lbl {
  position: relative;
  display: inline-block;
  height: 15px;
  width: 44px;
  background: #898989;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
  vertical-align: middle;
  margin-right: 20px;
}
.lbl:after {
  position: absolute;
  left: 20px;
  top: -5px;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 100px;
  background: #e4e4e4;
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
  content: '';
  transition: all 0.3s ease;
}

.cbx:checked ~ label {
  background: #8cccff;
}
.cbx:checked ~ label:after {
  left: -3px;
  background: #2196f3;
}
.cbx:disabled ~ label {
  background: #d5d5d5;
  pointer-events: none;
}
.cbx:disabled ~ label:after {
  background: #bcbdbc;
}
.hidden {
  display: none;
}
.bus2 {
  background-image: url(http://imgh.us/1qmkw-lhviv.svg);
  width: 48px;
  height: 48px;
  background-size: 32px;
  background-repeat: no-repeat;
  background-position: center;
  margin-left: 16px;
  margin-right: -10px;
}
.bus {
  background-image: url(http://image.flaticon.com/icons/png/128/149/149345.png);
  background-color: #F57E25;
  width: 28px;
  height: 28px;
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: center;
  margin-left: 16px;
}
.am {
  background-color: #fbbc00;
}
.lj {
  background-color: #F57E25;
}
.az {
  background-color: #0B61AE;
}
.vd {
  background-color: #00A450;
}
li:nth-child(1) {
  
}
.checky {
  display: none;
  background: #79BD9A;
  border-radius: 5px;
  box-shadow: 0 2px 0 0 #4d9c74;
  padding: 10px;
  width: 120px;
  overflow: hidden;
  transition: 0.3s all ease;
  position: absolute;
  top: 8px;
  right: 50px;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
}
.checky.mini {
  padding: 5px;
  width: 110px;
}
.checky.mini .label {
    top: 5px;
    left: 8px;
    color: #fff;
}
.checky:active, .checky.blue:active, .checky.blue.selected:active, .checky.selected:active {
  box-shadow: none;
  transform: translateY(2px);
}
.checky .label {
  font-size: 0.9em;
  font-family: sans-serif;
  color: white;
  position: absolute;
  top: 12px;
  left: 17px;
  transition: 0.3s all ease;
}
.checky .figure {
  width: 4px;
  height: 20px;
  background: white;
  display: block;
  float: right;
  margin-right: 10px;
  transform: rotate(45deg);
  box-shadow: 0 0 30px #34694e;
}
.checky .figure:after {
  width: 4px;
  height: 12px;
  background: white;
  content: "";
  display: block;
  position: absolute;
  bottom: -4px;
  left: 0;
  transform: rotate(-90deg);
  margin-left: -4px;
  transition: 0.3s all ease;
}
.checky.selected {
  background: #eb4f37;
  box-shadow: 0 2px 0 0 #c22b13;
}
.checky.selected .figure:after, .checky.blue.selected .figure:after {
  height: 20px;
  margin-left: 0;
  bottom: 0;
}
.checky.fade .label-selected {
  opacity: 0;
}
.checky.fade.selected .label {
  opacity: 0;
}
.checky.fade.selected .label.label-selected {
  opacity: 1;
}
.visible {
  display: list-item;
}
.hidden a {
opacity: 0.5;
}

              
            
!

JS

              
                var myApp = new Framework7({
    swipePanel: 'left'
});

// Export selectors engine
var $$ = Dom7;

var mainView = myApp.addView('.view-main');

var list = document.getElementById('linklist');
	var items = list.children;
	var itemsArr = [];
	for (var i in items) {
	itemsArr.push(items[i]);
	}
	// localStorage
	var ls = JSON.parse(localStorage.getItem('userlist') || '[]');

	for (var j = 0; j < ls.length; j++) {
  for (i = 0; i < itemsArr.length; ++i) {
    if(itemsArr[i].dataset !== undefined){
      if (ls[j] === itemsArr[i].dataset.id) {
         list.appendChild(itemsArr[i]);
      }
    }
  }    
}

	$('.list-block.sortable').on('sort', function () {
	var newIdsOrder = [];
	$(this).find('li').each(function(){
	  newIdsOrder.push($(this).attr('data-id'));
	});

	// store in localStorage
	localStorage.setItem('userlist', JSON.stringify(newIdsOrder));
	});

$(".restore").click(function(e) {
    $(".confirm").show();
  $(".shadow").show();
});
$(".no,.shadow").click(function(e) {
    $(".confirm").hide();
  $(".shadow").hide();
});
$(".yes").click(function(e) {
    $(".confirm").hide();
});
$('.checky.selected').click(function(){
  $(this).parent().toggleClass('hidden');
  
});
$(".lbl").click(function(e) {
  $(".toggle-text").toggleClass("blue");
  $(".restore").toggle();
  $(".checky").toggle();
  $('li').toggleClass('visible');
});
$('.checky').click(function() {
  $(this).toggleClass('selected'); 
});

function reset() {
    console.log("Removing data from local storage.");
    localStorage.setItem('userlist', '["1","2","3","4","5","6","7","8","9","10"]');
	window.location.reload(true);
};

              
            
!
999px

Console