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.

            
              - var values = [{"class": "life", "title": "生活雜記"},{"class": "ui", "title": "美式動態設計"},{"class": "game", "title": "永遠的小馬哥-周潤發"},{"class": "game", "title": "TRPG DnD 5e 簡記"},{"class": "life", "title": "歌單"},{"class": "ui", "title": "UI / 設計 書單"},{"class": "code", "title": "程式設計 書單"},{"class": "game", "title": "片單-電影"},{"class": "game", "title": "片單-電視劇"},{"class": "ui", "title": "九月團錄"},{"class": "code", "title": "八月團錄"}];
  
.header
  .user
  .search
    i.fas.fa-search
  .bgColor
  .selectorMode 
    i.fas.fa-star
    | 顯示星號筆記
  .listMode
    i.fas.fa-list
  .cardMode
    i.fas.fa-th-large
.warp
  ul.card
    li.addnote
      p.title 新增筆記
      span.selector
        i.fas.fa-plus
    each val, index in values
      li(class='card__' + val.class)
        p.title= val.title
        span.selector
          label(for='tog' + index)
            i.far.fa-star
          input(type='checkbox' id='tog' + index checked )
          div(class='togI' + val.class)
            i.fas.fa-star
        
.note
  h3 新增筆記
  hr
  span 筆記名稱
  input(type="text")
  p 選擇封面
  ul
    li.card__life
      input#checkPic1.checkPic(type="radio", name="bg", value="1")
      label(for="checkPic1")
    li.card__code
      input#checkPic2.checkPic(type="radio", name="bg", value="2")
      label(for="checkPic2")
    li.card__ui
      input#checkPic3.checkPic(type="radio", name="bg", value="3")
      label(for="checkPic3")
    li.card__game
      input#checkPic4.checkPic(type="radio", name="bg", value="4")
      label(for="checkPic4")
    li.card__code
      input#checkPic5.checkPic(type="radio", name="bg", value="5")
      label(for="checkPic5")

  span 或
  button.addPic 匯入圖片
  hr
  span(style="color: #f55;") 目前空間已滿,無法紀錄新筆記!
  button.getNew 確定
  
.cardNote
  button.back 返回列表
  button.save 儲存進度
  .noteErr 抱歉,目前儲存空間已滿!
  h1 永遠的小馬哥 — 周潤發
  i.far.fa-star
  hr
  p 如果您心目中的周潤發,只剩下
    span 《讓子彈飛》
    | 的黃四爺,或是和藹可親的發哥的形象,讓我來幫你回憶一下年青帥氣的周潤發。
  p 1974 年「無線電視藝員訓練班」第三期畢業的周潤發,很快就有了無線連續劇、電影的演出機會;他不但面容清秀,還有著 183 公分玉樹臨風的身材,很快就登上了男主角的位置,在 1980 年「浪奔浪流、萬里滔滔江水永不休」的《上海灘》更一舉將他推向家喻戶曉的無線當家小生地位。
  .picture
  .Attached 周潤發的一生.pdf
    .fileBox
      i.fas.fa-file-download
      i.fas.fa-trash-alt
  .shareBox
    i.far.fa-image
    i.fas.fa-file-download
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC&display=swap');
$main-width: 731px;



.header {
  width: $main-width;
  height: 107px;
  font-family: 'Noto Sans TC', sans-serif;
  margin: 23px auto 32px;
  position: relative;
  .user {
    position: absolute;
    width: 39px;
    height: 39px;
    background-image: url(https://images.unsplash.com/photo-1510771463146-e89e6e86560e?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ);
    background-size: 110%;
    background-position: 50% 50%;
    border-radius: 50%;
    top: 0px;
    left: 0;
    &::after {
      content: "Edith.hsu";
      position: absolute;
      top: 12px;
      left: 48px;
    }
  }
  .search {
    width: 223px;
    height: 19px;
    border: 1px solid #000000;
    border-radius: 24.5px;
    margin: 0 auto;
    padding: 10px;
    text-align: right;
    
  }
  .bgColor {
    position: absolute;
    width: 19px;
    height: 19px;
    background: linear-gradient(to right, white 50%, black 50%);
    border-radius: 50%;
    border: 1px solid black;
    top: 10px;
    right: 0;
  }
  .selectorMode {
    position: absolute;
    width: 128px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    font-size: 12px;
    background-color: rgba(0, 0, 0, .25);
    border-radius: 5px;
    left: 0;
    bottom: 0;
    i {
      margin-right: 6px;
    }
  }
  .listMode {
    position: absolute;
    bottom: 0;
    right: 35px;
    font-size: 20px;
    color: #bbb;
  }
  .cardMode {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 20px;
  }
}

.warp {
  width: $main-width;
  margin: 0 auto;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 900;
  li {
    display: inline-block;
    position: relative;
    vertical-align: top;
    padding: 12px 16px;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, .75);
    cursor: pointer;
    &::after {
      content: "";
      display: block;
      position: absolute;
      background: linear-gradient(180deg, #F1F0F0 0%, #F5F5F5 100%);
      width: 291px;
      height: 84px;
      bottom: -35px;
      left: -50%;
      transform: skew(-25deg, 0);
      z-index:-1;
    }
  }
}

.selector {
  position: absolute;
  bottom: 14px;
  left: 16px;
  label[for*="tog"] {
    display:block;
    position: absolute;
    bottom: 0px;
    left: 0px;
    z-index: 5;
  }
  input[id*="tog"]{
    display: none;
    &[type=checkbox]:checked + div {
      opacity:0;
    }
  }
  div[class*="togI"] {
    position: absolute;
    bottom: 0;
    left: 0px;
    opacity:1;
    transition:opacity .5s linear;
    z-index: 4;
  }
  
}

.card {
  li {
    width: 117px;
    height: 175px;
    border-radius: 9px;
    margin-bottom: 65px;
    line-height: 24px;
    background-size: cover;
    background-position: 50%;
    &:nth-child(4n+1), &:nth-child(4n+3) {
      margin-right: 37px;
    }
    &:nth-child(4n+2) {
      margin-right: 38px;
    }
    &:nth-child(1) {
      width: 115px;
      height: 174px;
      border: 1px solid black;
      background-color: rgba(255, 255, 255, .5);
      .title {
        text-align: center;
        margin-top: 100px;
      }
      .selector {
        font-size: 27px;
        left: calc(50% - 10px);
        bottom: 50%;
      }
    }
    
    &:hove {
      transform-origin:0;
      transform:scale(0.8,1.8);
    }
  }
  
  &__life {
    background-image: 
      linear-gradient(to bottom, rgba(255, 255, 255, .5), rgba(255, 255, 255, .5)),
      url(https://images.unsplash.com/photo-1527769929977-c341ee9f2033?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80);
    background-size: 100%;
    background-repeat: no-repeat;
  }
  &__code {
    background-image: 
      linear-gradient(to bottom, rgba(255, 255, 255, .75), rgba(255, 255, 255, .75)),
      url(https://images.unsplash.com/photo-1542546068979-b6affb46ea8f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80);
    background-size: 100%;
    background-repeat: no-repeat;
  }
  &__ui {
    background-image: 
      linear-gradient(to bottom, rgba(255, 255, 255, .75), rgba(255, 255, 255, .75)),
      url(https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80);
    background-size: 100%;
    background-repeat: no-repeat;
  }
  &__game {
    background-image: 
      linear-gradient(to bottom, rgba(255, 255, 255, .75), rgba(255, 255, 255, .75)),
      url(https://images.unsplash.com/photo-1493711662062-fa541adb3fc8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80);
    background-size: 100%;
    background-repeat: no-repeat;
  }
  
}

.list {
  li {
    width: 309px;
    margin-bottom: 30px;
    padding: 16px 19px;
    border-radius: 5px;
    background-image: none;
    background-color: #f4f4f4;
    &:nth-child(2n+1) {
      margin-right: 31px;
    }
    &:nth-child(2n+2) {
      margin-right: 0;
    }
    &:nth-child(1) {
      border: 1px solid black;
      box-shadow: 0 0 0 black;
      background-color: #fff;
      .selector {
        font-size: 20px;
      }
    }
    &::after {
      background: transparent;
    }
  }
  .selector {
    position: absolute;
    bottom: 14px;
    left: 310px;
  }
}

.note {
  display: none;
  width: 488px;
  height: 335px;
  background-color: #fff;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  font-family: 'Noto Sans TC', sans-serif;
  padding-top: 15px;
  margin: auto;
  border-radius: 5px;
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.50),
              0 0 0 100vw rgba(0, 0, 0, .5);
  z-index: 10;
  h3 {
    font-size: 18px;
    margin-left: 25px;
    margin-bottom: 14px;
  }
  span {
    margin: 0 18px 0 25px;
  }
  input[type="text"] {
    background: #F4F4F4;
    border: 1px solid #000000;
    border-radius: 5px;
    padding: 5px;
    margin-top: 10px;
  }
  p {
    margin-left: 25px;
    margin-top: 35px;
    margin-bottom: 14px;
  }
  ul {
    margin-left: 25px;
    margin-bottom: 17px;
  }
  li {
    width: 72px;
    height: 72px;
    display: inline-block;
    background-size: cover;
    border-radius: 5px;
    margin-right: 16px;
    position: relative;
    &:last-child {
      margin-right: 0;
    }
  }
  .checkPic {
    position: absolute;
    visibility: hidden;
    &+label {
      display: inline-block;
      width: 71px;
      height: 71px;
      border: 0px solid #333;
      border-radius:4px;
    }
    &:checked+label:after {
      content: "";
      position: absolute;
      // right: 10px;
      // bottom: 12px;
      width: 69px;
      height: 69px;
      border: 3px solid #333;
      border-radius: 8px;
      box-shadow: 0 0 5px rgba(0, 0, 0, .5);
      // width: 20px;
      // height: 20px;
      // border: 3px solid #333;
      // border-top-color: transparent;
      // border-right-color: transparent;
      // transform: rotate(-45deg);
    }
  }
  button {
    width: 90px;
    font-weight: 900;
    padding: 8px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
  }
  .addPic {
    background: #EDEDED;
  }
  .getNew {
    float: right;
    margin-right: 13px;
    background-color: #000;
    color: white;
  }
}

.cardNote {
  display: none;
  width: $main-width;
  margin: 0 auto;
  font-family: 'Noto Sans TC', sans-serif;
  background: #F8F8F8;
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16);
  border-radius: 5px 5px 0 0;
  padding-bottom: 100px;
  position: relative;
  button {
    position: absolute;
    border-radius: 5px;
    border: none;
    font-size: 12px;
    padding: 14px;
    top: -70px;
  }
  .back {
    left: 0;
    background: #EEEEEE;
  }
  .save {
    right: 0;
    color: #fff;
    background: #000000;
  }
  .noteErr {
    display: none;
    position: absolute;
    top: -60px;
    right: 80px;
    color: #f00;
  }
  h1 {
    font-size: 24px;
    padding-top: 29px;
    margin-left: 54px;
  }
  i.far.fa-star {
    position: absolute;
    top: 37px;
    right: 57px;
  }
  hr {
    margin: 30px 20px;
  }
  p {
    margin: 0 54px;
    line-height: 30px;
    span {
      color: #495BFF;
    }
  }
  .picture {
    width: 626px;
    height: 294px;
    background-image: url(https://images.unsplash.com/photo-1515634928627-2a4e0dae3ddf?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80);
    background-position: 50%;
    margin: 30px auto;
  }
  .Attached {
    width: 570px;
    margin: 0 auto;
    padding: 16px 28px;
    background: #E5E5E5;
    border-radius: 5px;
    position: relative;
    &::after {
      content: "...";
      position: absolute;
      font-weight: 900;
      letter-spacing: -10px;
      right: 25px;
    }
    .fileBox {
      display: none;
      position: absolute;
      right: 20px;
      top: -20px;
      width: 76px;
      height: 35px;
      font-size: 20px;
      color: #fff;
      background-color: #000;
      box-shadow: 0 2px 4px 0 rgba(0,0,0,0.50);
      border-radius: 5px;
      text-align: center;
      i {
        margin: 8px;
      }
    }
  }
  .shareBox {
    width: 48px;
    height: 87px;
    background-color: #000;
    color: #fff;
    font-size: 22px;
    text-align: center;
    position: absolute;
    left: -24px;
    bottom: 450px;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.50);
    border-radius: 5px;
    padding: 2px;
    i {
      margin: 10px 4px;
    }
  }
}

.dark {
  background: #222;
  .header {
    color: white;
  }
  .bgColor {
    border: 1px solid white;
    background: linear-gradient(to right, transparent 50%, white 50%);
  }
  .selectorMode {
    background-color: rgba(255, 255, 255, .15);
  }
  .card {
    li {
      &:first-child {
        background-color: rgba(0, 0, 0, .25);
        color: white
      }
      &::after {
        background: #454558;
      }
    }
  }
  .list {
    li {
      color: white;
      background-color: #454558;
      &:first-child {
        border: 1px solid #FFFFFF;
        border-radius: 5px;
        background-color: transparent;
      }
    }
  }
  .cardNote {
    background: #1A1A25;
    color: #fff
  }
  .Attached {
    background: #454558;
  }
  .back, .shareBox, .fileBox {
    background: #454558;
  }
  .save {
    background-color: #fff;
    color: #000;
  }
}

            
          
!
            
              $('.listMode').click( function() {
  $('ul.card').addClass('list').removeClass('card');
  $('.listMode').css('color', 'black');
  $('.cardMode').css('color', '#bbb');
});

$('.cardMode').click( function() {
  $('ul.list').addClass('card').removeClass('list');
  $('.cardMode').css('color', 'black');
  $('.listMode').css('color', '#bbb');
});

$('.addnote').click( function() {
  $('.note').css({display: 'block'});
})

$('.getNew').click( function() {
  $('.note').css({display: 'none'});
})

$('.bgColor').click( function() {
  $('body').toggleClass('dark')
})

$('li[class*="card__"] p.title').click( function() {
  $('body').addClass('card__game');
  $('.cardNote').css({display: 'block'});
  $('.warp').css({display: 'none'});
  $('.selectorMode').css({display: 'none'});
  $('.listMode').css({display: 'none'});
  $('.cardMode').css({display: 'none'});
})

$('button.back').click( function() {
  $('body').removeClass('card__game');
  $('.cardNote').css({display: 'none'});
  $('.warp').css({display: 'block'});
  $('.selectorMode').css({display: 'block'});
  $('.listMode').css({display: 'block'});
  $('.cardMode').css({display: 'block'});
})

$('button.save').click( function() {
  $('.noteErr').css({display: 'block'});
  setTimeout(function(){
    $('.noteErr').css({display: 'none'});
  }, 3000);
})

$('.Attached').click( function() {
  $('.fileBox').css({display: 'block'});
  setTimeout(function(){
    $('.fileBox').css({display: 'none'});
  }, 3000);
})
            
          
!
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.

Console