Browse Source

some masonry grid stuff, license under MIT

canon
Hazel Levine 2 years ago
parent
commit
13979ab895
5 changed files with 47 additions and 21 deletions
  1. +7
    -0
      LICENSE
  2. +1
    -1
      package.json
  3. +15
    -12
      public/index.css
  4. +15
    -8
      public/index.ejs
  5. +9
    -0
      public/masonry.pkgd.min.js

+ 7
- 0
LICENSE View File

@ -0,0 +1,7 @@
Copyright 2018 Hazel Rose Levine
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 1
- 1
package.json View File

@ -18,7 +18,7 @@
"images"
],
"author": "hazel levine",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/ix/bunnydb/issues"
},


+ 15
- 12
public/index.css View File

@ -1,19 +1,22 @@
/* .bun-card-image.mdl-card {
width: 256px;
height: 256px;
.masonry-grid {
max-width: auto;
}
.bun-card-image > .mdl-card__actions {
height: 52px;
padding: 16px;
background: rgba(0, 0, 0, 0.2);
.masonry-grid:after {
content: '';
display: block;
clear: both;
}
.bun-card-image__filename {
color: #fff;
font-size: 14px;
font-weight: 500;
} */
.masonry-grid-item {
/* width: 160px;
height: 120px; */
float: left;
}
.mdl-card {
height: auto;
}
.mdl-card__media {
margin: 0;


+ 15
- 8
public/index.ejs View File

@ -5,6 +5,13 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script src="masonry.pkgd.min.js"></script>
<script>
let elem = document.querySelector('.masonry-grid');
let msnry = new Masonry(elem, {
itemSelector: '.masonry-grid-item'
});
</script>
</head>
<body>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header
@ -22,19 +29,19 @@
<main class="mdl-layout__content">
<section class="mdl-layout__tab-panel is-active" id="fixed-tab-1">
<div class="page-content">
<div class="mdl-grid">
<div class="mdl-grid masonry-grid">
<% files.forEach((bun) => { %>
<!-- <style>
.<%= stripBun(bun.path) %>-card-image.mdl-card {
background: url(<%= bun.path.replace("public/", "") %>) center / cover;
}
</style> -->
<div class="mdl-card mdl-cell mdl-shadow--2dp">
<div class="mdl-card mdl-cell mdl-cell--4-col-desktop masonry-grid-item mdl-shadow--2dp">
<figure class="mdl-card__media">
<img src=<%= bun.path.replace("public/", "") %> alt="" />
</figure>
<div class="mdl-card__title">
<h6 class="mdl-card__title"><%= bun.originalname %></h6>
<h3 class="mdl-card__title-text"><%= bun.originalname %></h3>
</div>
<div class="mdl-card__actions mdl-card--border">
<a class="mdl-button mdl-button--accent mdl-js-button-mdl-js-ripple-effect" href=<%= bun.path.replace("public/", "") %>>
View
</a>
</div>
</div>
<% }); %>


+ 9
- 0
public/masonry.pkgd.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save