Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="App">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <base href="https://xieranmaya.github.io/images/cats/">
</head>
<body ng-controller="ImageLayout">
  <section>
    <div  ng-repeat="img in imgs" style="width:{{img.width*200/img.height}}">
      <img src="{{img.url}}" alt="">
    </div>
  </section>
</body>
</html>
 
section {
  display: flex;
  flex-wrap: wrap;
}
section::after {
  content: '';
  flex-grow: 999999999;
}
div {
  flex-grow: 1;
  margin: 2px;
  background-color: violet;
  height: 200px;
}
img {
  height: 200px;
  object-fit: cover;
  max-width: 100%;
  min-width: 100%;
  vertical-align: bottom;
}
 
angular.module('App', [])
.controller('ImageLayout', ImageLayout)
function ImageLayout($scope, $http){
  $http.get('https://xieranmaya.github.io/images/cats/cats.json').success(function(imgs){
    $scope.imgs = imgs
  })
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
xieranmayapro
0viewers