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 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

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

              
                <div id="container" style="height:100%;display:flex;align-items:stretch">
  <div style="width:400px;background:#ededed;position:relative" v-bind:style="{width:leftToggled?'400px': 0}">
    <a v-on:click="toggleLeft()" href="#" style="width: 20px;
    height: 40px;
    background: #ededed;
    position: absolute;
    top: 50%;
    margin-top: -10px;
    text-align:center; 
    line-height:40px;
    right: -20px;
    font-size:14px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;">
        <span v-show="!leftToggled" class="glyphicon glyphicon-chevron-right" ></span>
        <span v-show="leftToggled" class="glyphicon glyphicon-chevron-left" ></span>
  
    </a>

  </div>
  <div style="flex:1; display:flex;flex-direction:column">
    <div id="map-container" style="flex:1">

    </div>
    <div id="slider-container">
      <input type="text" id='slider-bar' style="height:20px;width:100%" data-slider-max="20" data-slider-step="1" data-slider-value="14" />
    </div>
    <div style='display:flex;background:#333;min-height:80px;justify-content:space-between;align-items:center;padding:0 12px;color:#ccc'>
      <div class='label-region'>
        0.00KM/453.2KM
      </div>
      <div class='label-region'>
        {{time}}
      </div>
      <div id='center-region' class='media-controls'>
        <a href='#' v-on:click="backPlay" class="media-control-button" v-show="!isPlaying">
          <span class=" glyphicon glyphicon-backward" aria-hidden="true"></span>
        </a>

        <a href='#' class="media-control-button primary" v-on:click="togglePlay">
          <span class="glyphicon glyphicon-play" v-show="isPlaying" aria-hidden="true"></span>
          <span class="glyphicon glyphicon-pause" v-show="!isPlaying" aria-hidden="true"></span>
        </a>

        <a href='#' class="media-control-button" v-on:click="forwardPlay" v-show="!isPlaying">
          <span class=" glyphicon glyphicon-forward" aria-hidden="true"></span>
        </a>
      </div>
      <div class='label-region'>
        0.00KM/453.2KM
      </div>
      <div class="btn-group" role="group" aria-label="...">
        <label type="button" class="btn btn-default btn-sm" v-bind:class="{active:speedLevel === 0}" v-on:click="changeSpeedLevel(0)">慢速</label>
        <label type="button" class="btn btn-default btn-sm" v-bind:class="{active:speedLevel === 1}" v-on:click="changeSpeedLevel(1)">快速</label>
        <label type="button" class="btn btn-default btn-sm" v-bind:class="{active:speedLevel === 2}" v-on:click="changeSpeedLevel(2)">正常</label>
        <label type="button" class="btn btn-default btn-sm" v-bind:class="{active:speedLevel === 3}" v-on:click="changeSpeedLevel(3)">极快</label>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                html{
  height:100%;
}

body{
  height:100%;
}

.slider-selection {
	background: #999;
}



#slider-container{
   background:#333;
}

.media-control-button .glyphicon{
  font-size:30px;
}

.media-control-button.primary > .glyphicon{
  font-size:40px;
}

.label-region{
  background:#000;
  border-radius:13px; 
  padding:3px 12px;
  height:26px;
}

.media-controls{
    display: flex;
    justify-content: space-around;
    align-items: center;
    width:140px;
}
              
            
!

JS

              
                $(function() {

  var vm = new Vue({
    el: '#container',
    data: {
      isPlaying: false,
      speedLevel: 2,
      time: 0,
      leftToggled: true
    },
    methods: {
      toggleLeft: function() {
        this.leftToggled = !this.leftToggled;
      },
      togglePlay: function() {
        this.isPlaying = !this.isPlaying;
      },
      backPlay: function() {

      },
      forwardPlay: function() {

      },
      changeSpeedLevel: function(level) {
        this.speedLevel = level;
      }
    }

  });

  var slider =
    $('#slider-bar').slider()
    .on('change', function(event) {
      //vm.$set('time',event.value.newValue);
      vm.time = event.value.newValue;

    });
});


              
            
!
999px

Console