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

              
                <html>

<head>
  <title>angular-deckgrid example</title>
</head>

<body ng-app="photo" ng-controller="PhotoCtrl">
  <h1>「ボケて」の人気投稿</h1>
  <div deckgrid class="deckgrid" source="photos">
    <div class="a-card">
      <a ng-href="{{card.link}}" target="_blank">
        <img src="" data-ng-src="{{card.src}}">
      </a>
      <h2>{{card.title}}</h2>
    </div>
  </div>
</body>

</html>
              
            
!

CSS

              
                .a-card {
  height: auto;
  border: 3px solid black;
  margin: 5px;
}

h2 {
  margin: 0;
  padding: 10px;
}

img {
  width: 100%;
}

.deckgrid .column {
  float: left;
}

.deckgrid .column-1-1 {
  width: 100%;
}

.deckgrid .column-1-4 {
  width: 25%;
}

.deckgrid[deckgrid]::before {
  content: '1 .column.column-1-1';
  font-size: 0;
  visibility: hidden;
}

@media screen and (min-width: 600px) {
  .deckgrid[deckgrid]::before {
    content: '4 .column.column-1-4';
  }
}
              
            
!

JS

              
                angular.module('photo', ['akoenig.deckgrid']).controller('PhotoCtrl', function($scope) {
  $scope.photos = [{
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/abf9b57d34338cdd95de59fe6903e3fe_600.jpg",
    link: "http://bokete.jp/boke/39978078",
    title: "とぼけんな、給料日だろ"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/904a534a5dba72ea5eb879182441cd16_600.jpg",
    link: "http://bokete.jp/boke/39979574",
    title: "奈落より 出でよ破壊の"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/81d5a932257f2cb36dc6e56b7d1e1fa4_600.jpg",
    link: "http://bokete.jp/boke/39972987",
    title: "職質かけたら思いっきりグーパンされたので一旦部下のとこへ戻る"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/09ea4d769e819f473a2b538860a94c9e_600.jpg",
    link: "http://bokete.jp/boke/39970408",
    title: "ヘディングしてから様子がおかしい"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/ef164c0fa2b42aac8e6cb512811cbed0_600.jpg",
    link: "http://bokete.jp/boke/39964824",
    title: "けえ"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/07af9fc488bb67250a5f5dc69cea9bae_600.jpg",
    link: "http://bokete.jp/boke/39953927",
    title: "大佐が掃除機かけ始めた。"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/92a0c960ca925b7cf8fc714a16463d23_600.jpg",
    link: "http://bokete.jp/boke/39980792",
    title: "占い師に「今年2月に人生で最高についてることが起こります」って言われてたけどコレじゃないことを全力で祈る"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/4e11f7ba4767d995053442bb3a98c0ab_600.jpg",
    link: "http://bokete.jp/boke/39967369",
    title: "四年も経って"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/ea01d23c4713273be387d58d611331ac_600.jpg",
    link: "http://bokete.jp/boke/39998749",
    title: "這ってるヤツと中腰のヤツがやたら早い"
  }, {
    src: "https://d2dcan0armyq93.cloudfront.net/photo/odai/600/ac25d96925da8be29b71724ca780491c_600.jpg",
    link: "http://bokete.jp/boke/39973578",
    title: "銀のエンゼルがなかなか当たらないので直接狩りにきたら結構強かった"
  }]
});
              
            
!
999px

Console