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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

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.

HTML

            
              .container
  .topbar
    .logo
      img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:751d281a-85b1-4e62-a399-4b036b59a344&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
    .dataInfo
      .dataInfo__space
        img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:57d3b6ce-53f0-48aa-aa84-9421dac59d29&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
      .dataInfo__search
        img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:e76e53a7-1d6e-49b6-9882-5f0e7bd228ea&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
    .user
      .user__img
        img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:03b6a93f-589f-4f3b-927c-ac02cbc2daa5&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
      .user__name niuniumix
    .clearfix

  .card
    .cardLink
      ul.cardLink__pageName
        li.active
          p 我的抽屜
        li
          p 共用抽屜
        li
          p 重要抽屜
        li
          p 垃圾桶
        .cardLink__view
          img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:701db5c3-f786-4c74-8966-84ddc5d85846&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
          img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:9d96ceca-e3c5-4a66-b736-126250b37041&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
    .cardPage
      .cardPage__board
        table.cardPage__list

        .addBtn
          .addBtn__item 新增資料夾
          .addBtn__item 新增檔案
      .cardPage__fileInfo
        table
          tr
            td(colspan=2) 
              h2 HELLO
              hr
          tr
            td 修改日期
            td 2019.09.02 10:00
          tr
            td 類型
            td 資料夾
          tr
            td 擁有人
            td niuniumix
          tr
            td 大小
            td 5.8 GB
          tr
            td(colspan=2)
              hr
          tr
            td(colspan=2) 預覽內容
          tr
            td(colspan=2)
              p 
                img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:23c7274f-d6ed-4918-ba38-f5f3ebac7775&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
                | PHOTO.jpg
              p 
                img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:87be7bd0-436e-447f-9a94-eed8c7ccf09a&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
                | MOVIE.mp4
              p 
                img(src="https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:442e8a66-b891-455d-86f4-2ab8f2747da7&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1")
                | paper.doc
            
          
!

CSS

            
              $bg-color: #F5F5F5;

$cardColor-white: #fff;
$cardColor-gray: #D9D9D9;
$cardColor-black: #000;
$cardColor-blue: #556F96;
$cardColor-yellow: #FFBE45;

body {
  background-color: $bg-color;
  font-family: Microsoft JhengHei;
}
.clearfix {
  clear: both;
}
.container {
  width: 990px;
  margin: 0 auto;
}

.topbar {
  margin: 30px 64px;
  .logo, .dataInfo {
    float: left;
  }
  .dataInfo {
    margin-left: 72px;
    &__space {
      margin-bottom: 20px;
      position: relative;
      &::before, &::after {
        position: absolute;
        top: -10px;
        font-size: 10px;        
      }
      &::before {
        content: "30 GB";
        left: 0;
      }
      &::after {
        content: "100 GB";
        right: 0;
      }
    }
  }
  .user{
    float: right;
    &__img {
      width: 36px;
      margin: 0 auto;
    }
    &__name {
      font-size: 10px;
      text-align: center;
    }
  }
}

.card {
  &Link {
    &__pageName {
      li {
        display: inline-block;
        width: 160px;
        background-color: $cardColor-blue;
        border-radius: 15px 15px 0 0;
        margin-right: 10px;
        &.active {
          background-color: $cardColor-white;
          p {
            border-left: 8px solid $cardColor-blue;
          }
        }
        p {
          border-left: 8px solid transparent;
          line-height: 28px;
          text-align: center;
          margin: 17px 0;
        }
      }
    }
    &__view {
      display: inline-block;
      vertical-align: bottom;
    }
  }
  &Page {
    position: relative;
    &__board {
      display: inline-block;
      background-color: $cardColor-white;
      height: 540px;
      box-sizing: border-box;
      font-size: 10px;
      border-radius: 0 10px 10px 10px;
      padding: 32px 40px;
      vertical-align: top;
      .addBtn {
        position: absolute;
        bottom: 26px;
        &__item {
          display: inline-block;
          margin-right: 52px;
          &:before {
            content: "+";
            display: inline-block;
            width: 48px;
            height: 48px;
            font-size: 24px;
            line-height: 42px;
            text-align: center;
            border-radius: 50%;
            color: $cardColor-white;
            background-color: $cardColor-yellow;
            margin-right: 12px;
          }
        }
      }
    }
    &__list {
      &Item {
        td {
          padding: 10px 0;
        }
        .tag {
          margin-right: 16px;}
        .check {
          margin-right: 23px;}
        .fileInfo {
          width: 156px;
          margin-right: 20px;
          text-decoration: none;
          color: $cardColor-black;
          img {
            margin-right: 16px;
          }
        }
        div {
          display: inline-block;
          margin-right: 10px;
        }
        .time {
          width: 156px;
        }
        .kine {
          width: 127px;
        }
        .owner {
          width: 141px;
        }
        .fileSize {
          width: 60px;
        }
        .fileAction {
        }
      }
    }
    &__fileInfo {
      display: inline-block;
      background-color: $cardColor-white;
      height: 540px;
      box-sizing: border-box;
      padding: 24px;
      border-radius: 10px;
      table {
        tr {
          td {
            font-size: 10px;
            padding: 3px 0;
            &:nth-child(2) {
              text-align: right;
            }
          }
        }
        h2 { font-size: 16px;}
        p {
          margin: 10px 0;}
        img {
          width: 16px;
          vertical-align: middle;
          margin-right: 16px;}
      }
    }
  }
}
            
          
!

JS

            
              let fileData = [
  {'tag': false, 'select': false, 'fileName': 'Hello1', 'time': '2019/09/01 10:00', 'kind': 'folder', 'owner': 'niuniumix', 'fileSize': '5.8 GB', 'folderList': [
    {'tag': false, 'select': false, 'fileName': 'PHOTO1', 'time': '2019/09/01 10:00', 'kind': 'JPG', 'owner': 'niuniumix', 'fileSize': '1228 KB'},
    {'tag': false, 'select': false, 'fileName': 'MOVIE1', 'time': '2019/09/01 10:00', 'kind': 'MP4', 'owner': 'niuniumix', 'fileSize': '355 MB'},
    {'tag': false, 'select': false, 'fileName': 'paper1', 'time': '2019/09/01 10:00', 'kind': 'MP4', 'owner': 'niuniumix', 'fileSize': '1228 KB'}]},
  {'tag': false, 'select': false, 'fileName': 'Hello2', 'time': '2019/09/01 10:00', 'kind': 'folder', 'owner': 'niuniumix', 'fileSize': '5.8 GB', 'folderList': [
    {'tag': false, 'select': false, 'fileName': 'PHOTO2', 'time': '2019/09/01 10:00', 'kind': 'JPG', 'owner': 'niuniumix', 'fileSize': '1228 KB'},
    {'tag': false, 'select': false, 'fileName': 'MOVIE2', 'time': '2019/09/01 10:00', 'kind': 'MP4', 'owner': 'niuniumix', 'fileSize': '355 MB'},
    {'tag': false, 'select': false, 'fileName': 'paper2', 'time': '2019/09/01 10:00', 'kind': 'MP4', 'owner': 'niuniumix', 'fileSize': '1228 KB'}]},
  {'tag': false, 'select': false, 'fileName': 'Hello3', 'time': '2019/09/01 10:00', 'kind': 'folder', 'owner': 'niuniumix', 'fileSize': '5.8 GB', 'folderList': [
    {'tag': false, 'select': false, 'fileName': 'PHOTO3', 'time': '2019/09/01 10:00', 'kind': 'JPG', 'owner': 'niuniumix', 'fileSize': '1228 KB'},
    {'tag': false, 'select': false, 'fileName': 'MOVIE3', 'time': '2019/09/01 10:00', 'kind': 'MP4', 'owner': 'niuniumix', 'fileSize': '355 MB'},
    {'tag': false, 'select': false, 'fileName': 'paper3', 'time': '2019/09/01 10:00', 'kind': 'MP4', 'owner': 'niuniumix', 'fileSize': '1228 KB'}]},
  {'tag': false, 'select': false, 'fileName': 'PHOTO4', 'time': '2019/09/01 10:00', 'kind': 'JPG', 'owner': 'niuniumix', 'fileSize': '1228 KB'},
  {'tag': false, 'select': false, 'fileName': 'PHOTO5', 'time': '2019/09/01 10:00', 'kind': 'JPG', 'owner': 'niuniumix', 'fileSize': '1228 KB'},
  {'tag': false, 'select': false, 'fileName': 'PHOTO6', 'time': '2019/09/01 10:00', 'kind': 'JPG', 'owner': 'niuniumix', 'fileSize': '1228 KB'}];

let imgJPG = 'https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:e6a2324e-d9cc-42f9-8c44-7234ccdfd7f3&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1',
    imgMP4 = 'https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:87be7bd0-436e-447f-9a94-eed8c7ccf09a&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1',
    imgfolder = 'https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:b1c82a23-543f-41ca-bac7-2043de7d3048&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1',
    imgDOC = 'https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:442e8a66-b891-455d-86f4-2ab8f2747da7&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1',
    imgTag = 'https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:816bc49e-dc65-4c3f-8c9a-39af693e1260&params=version:1&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1',
    imgCheck = 'https://public-v2links.adobecc.com/0d49eee8-1e26-4171-5091-d53a621220b3/component?params=component_id:9669ba04-5c56-4625-8add-450932ba2502&params=version:0&token=1568041909_da39a3ee_622cd178f500b799ab7b1f07caa0716fa15a9d91&api_key=CometServer1';

let _str = '<tr class="cardPage__listItem"><td><a class="tag" href=""><img src="' + imgTag + '"></a></td><td><a class="check" href=""><img src="' + imgCheck + '"></a></td><td><a class="fileInfo" href="">名稱</a></td><td><div class="time">修改日期</div></td><td><div class="kine">類型</div></td><td><div class="owner">擁有人</div></td><td><div class="fileSize">大小</div></td></tr>';

for(item in fileData) {
  // console.log(fileData[item].tag)
  _str += '<tr class="cardPage__listItem"><td><a class="tag" href=""><img src="' + imgTag + '"></a></td><td><a class="check" href=""><img src="' + imgCheck + '"></a></td><td><a class="fileInfo" href="">';
  (fileData[item].kind == 'JPG')? _str += '<img src="' + imgJPG + '">': _str += '<img src="' + imgfolder + '">';
  _str += '' + fileData[item].fileName + '</a></td><td><div class="time">' + fileData[item].time + '</div></td><td><div class="kine">類型</div></td><td><div class="owner">' + fileData[item].owner + '</div></td><td><div class="fileSize">' + fileData[item].fileSize + '</div></td></tr>';
}

$('.cardPage__list').append(_str)
            
          
!
999px

Console