Create an image gallery

2

I'm starting a project and would like to create a page with a gallery like in the scheme below:

Websitethatowns Gallery

So it looks like the images are made available by lines, but I've only been able to make the images available by columns following this example , but it was not very cool.

How could I make a gallery equal to this example? Can anyone tell me a path or examples?

Note: I just want to make the images available as in the example above and I want to load the images using AngularJS.

Edited

This is my current HTML page

   /*CSS Photos*/
#photoContainer {
  width: 1200px;
  overflow: hidden;
  background: black;
  /*transparent*/
  position: absolute;
  /*top: 350px;*/
  left: 50%;
  transform: translateX(-50%);
}


/*photobanner*/

.photobanner {
  /*height: 100%;
	width: 100%;
	display: inline;*/
}

.photobanner img {
  /*max-width:350px;
    max-height:233px;
    width: auto;
    height: auto;
	margin: 20px;*/
  /*Animação zoom*/
  -webkit-transition: all 0.5s ease;
  -moz-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  -ms-transition: all 0.5s ease;
  transition: all 0.5s ease;
}

.photobanner img:hover {
  -webkit-transform: scale(1.1);
  -moz-transform: scale(1.1);
  -o-transform: scale(1.1);
  -ms-transform: scale(1.1);
  transform: scale(1.1);
  cursor: pointer;
  -webkit-box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
}

.row {
  display: flex;
  flex-wrap: wrap;
  padding: 0 4px;
}


/* Create two equal columns that sits next to each other */

.column {
  flex: 25%;
  padding: 0 4px;
}

.column img {
  margin-top: 8px;
  vertical-align: middle;
}


/* Responsive layout - makes a two column-layout instead of four columns */

@media screen and (max-width: 800px) {
  .column {
    flex: 50%;
    max-width: 50%;
  }
}


/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */

@media screen and (max-width: 600px) {
  .column {
    flex: 25%;
    max-width: 25%;
  }
}
<!DOCTYPE html>
<html ng-app="controllerPrincipal">

<head>
  <link rel="icon" href="images/favicon.png" />
  <!--Import Google Icon Font-->
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <!--Import materialize.css-->
  <!--<link type="text/css" rel="stylesheet" href="css/materialize.css"  media="screen,projection"/>-->
  <link href="css/CardStyle.css" type="text/css" rel="stylesheet" media="screen,projection" />
  <link href="css/mainstyle.css" type="text/css" rel="stylesheet" media="screen,projection" />
  <link href="css/photos.css" type="text/css" rel="stylesheet" media="screen,projection" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>

<body>
  <div class="wrapper">
    <header>
      <nav>
        <div class="menu-icon"><i class="material-icons">menu</i></div>
        <div class="logo">LOGO</div>
        <div class="menu">
          <ul>
            <li><a href="#" class="active">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Blog</a></li>
            <li><a href="#">Contact</a></li>
          </ul>
        </div>
      </nav>
    </header>
    <div class="content">
      <div class="container" ng-controller="PesquisaFotos">
        <div id="photoContainer">
          <div class="row photobanner" ng-repeat="item in dados">
            <div class="column">
              <img class="img first" src="{{ item.foto }}" alt="{{ item.descricao }}" style="width:100%" />
            </div>
            <div class="column">
              <img class="img first" src="{{ item.foto }}" alt="{{ item.descricao }}" style="width:100%" />
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="content">
      <p>
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
        survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
        publishing software like Aldus PageMaker including versions of Lorem Ipsum.
      </p>
      <p>
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
        survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
        publishing software like Aldus PageMaker including versions of Lorem Ipsum.
      </p>
    </div>
  </div>
  <!--Scripts-->
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script><scripttype="text/javascript" src="js/materialize.js"></script>
  <script type="text/javascript" src="js/angular.min.js"></script>
  <script type="text/javascript" src="js/app.js"></script>
  <script type="text/javascript" src="js/index.js"></script>
</body>

</html>

It's kind of messy as I'm testing

    
asked by anonymous 28.06.2018 / 20:56

2 answers

2

With display:flex and object-fit:cover you only get CSS with a result very close to that and still leave everything with good responsiveness even.

See in the example:

EDIT OBS1: I have commented in css how to control the maximum width of imgs, but now it will open some holes in the gallery, because the image is with a maximum width and not the total width of the screen .

OBS2: Display in " Page entire " to see the result better

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #000;
}
.grid {
    display: flex;
    flex-wrap: wrap;
}
.grid .wrapper {
    height: 100px;
    max-width: 300px; /* largura máxima dos boxes*/
    overflow: hidden;
    flex-grow: 1;
}
.grid .wrapper img {
    height: 100%;
    margin: 0.4em 0.4em;
    object-fit: cover;
    width: 100%;
}
<div class="grid">
    <div class="wrapper">
        <img src="https://unsplash.it/1000/1000"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/100/300"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/200/100"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/400/300"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/200/440"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/300/100"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/100/400"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/200/240"alt="">
    </div>
    <div class="wrapper">
        <img src="https://placecage.com/400/440"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/500/400"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/300/300"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/100/400"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/200/440"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/400/100"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/500/300"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/400/300"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/100/440"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/300/200"alt="">
    </div>
    <div class="wrapper">
        <img src="https://placecage.com/100/400"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/500/200"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/300/400"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/200/440"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/300/500"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/200/100"alt="">
    </div>
    <div class="wrapper">
        <img src="https://unsplash.it/100/300"alt="">
    </div>

</div>

Tip: You can test by taking object-fit and widhr:100% to see if you like tb, but imgs will not stick together horizontally

    
28.06.2018 / 22:25
-1

See if it gives you a light.

.portifolio {
  width: 1100px;
  overflow: hidden;
  line-height: 0;
  column-count: 2;
  column-gap: 2px;
  margin-bottom: 50px;
}

.portifolio img {
  max-width: 100%;
}
<div class="portifolio">
      <div id="img1">
        <img src="#">
      </div>
      <div id="img2">
        <img src="#">
      </div>
</div>

In css you can control the column. So you set a size, such as width, so the image resizes proportionally and that done right there that you used as an example.

    
28.06.2018 / 21:15