Browse Source

I don't know what this is

canon
Hazel Levine 11 months ago
parent
commit
877eea1a09
7 changed files with 36 additions and 41 deletions
  1. +2
    -2
      app.js
  2. +11
    -0
      mixins/head.pug
  3. +3
    -6
      mixins/paginate.css
  4. +1
    -13
      public/index.js
  5. +3
    -4
      src/imagefile.js
  6. +6
    -12
      views/index.pug
  7. +10
    -4
      views/pages.pug

+ 2
- 2
app.js View File

@ -48,7 +48,7 @@ app.get('/random', (req, res) => {
});
});
app.get('/pages', async (req, res, next) => {
app.get('/', async (req, res, next) => {
try {
const [ results, itemCount ] = await Promise.all([
schema.find({}).limit(req.query.limit).skip(req.skip).lean().exec(),
@ -64,7 +64,7 @@ app.get('/pages', async (req, res, next) => {
data: results
});
} else { */
res.render('pages.pug', {
res.render('index.pug', {
docs: results,
pageCount,
itemCount,


+ 11
- 0
mixins/head.pug View File

@ -0,0 +1,11 @@
//- bnnydb head.pug CLIENT/git 08/01/2018 hazel <arcetera@openmailbox.org>
head
title Bunny DB
link(rel='stylesheet', href='index.css')
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(src='masonry.pkgd.min.js')
script(src='imagesloaded.pkgd.min.js')
script(src='infinite-scroll.pkgd.min.js')

+ 3
- 6
mixins/paginate.css View File

@ -3,11 +3,7 @@
.paginate-container {
width: 960px;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
bottom: 30px;
margin: 0 auto;
position: absolute;
font-size: 20px;
text-align: center;
@ -38,10 +34,11 @@
transition: color 2s;
}
/*
.paginate-container span:first-child {
margin-left: 10px;
}
.paginate-container span:last-child {
margin-left: 10px;
}
} */

+ 1
- 13
public/index.js View File

@ -5,25 +5,13 @@ window.onload = () => {
let msnry = new Masonry(elem, {
itemSelector: '.masonry-grid-item', // select none at first
gutter: 16,
fitWidth: true,
/* visibleStyle: { transform: 'translateY(0)', opacity: 1 },
hiddenStyle: { transform: 'translateY(100px)', opacity: 0 } */
fitWidth: true
});
imagesLoaded(elem).on('progress', () => {
/* elem.classList.remove('are-images-unloaded');
msnry.options.itemSelector = '.masonry-grid-item';
let items = elem.querySelectorAll('.masonry-grid-item');
msnry.appended(items); */
msnry.layout();
});
/* let infScroll = new InfiniteScroll(elem, {
append: '.masonry-grid-item',
outlayer: msnry,
status: '.page-load-status'
}); */
let fileList = [];
let fileCatcher = document.getElementById('file-catcher');
let fileInput = document.getElementById('file-input');


+ 3
- 4
src/imagefile.js View File

@ -1,7 +1,6 @@
// bunnydb imagefile.js git 07/24/2018 hazel <arcetera@openmailbox.org>
const express = require('express');
const multer = require('multer');
const express = require('express'); const multer = require('multer');
const mongoose = require('mongoose');
const uuid = require('uuid/v4');
const path = require('path');
@ -55,13 +54,13 @@ let upload = multer({
storage: storage
});
router.get('/', (req, res, next) => {
/* router.get('/', (req, res, next) => {
getAllFiles(schema, (filesOut) => {
res.render('index.pug', {
files: filesOut
});
});
});
}); */
router.post('/', upload.any(), (req, res, next) => {
res.send(req.files);


+ 6
- 12
views/index.pug View File

@ -5,16 +5,8 @@ doctype html
include ../mixins/card.pug
html
head
title Bunny DB
link(rel='stylesheet', href='index.css')
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(src='masonry.pkgd.min.js')
script(src='imagesloaded.pkgd.min.js')
script(src='infinite-scroll.pkgd.min.js')
script(src='index.js')
include ../mixins/head.pug
script(src='index.js')
.mdl-layout.mdl-js-layout.mdl-layout--fixed-header.mdl-layout--fixed-tabs
header.mdl-layout__header
.mdl-layout__header-row
@ -26,8 +18,8 @@ html
main.mdl-layout__content
section#fixed-tab-1.mdl-layout__tab-panel.is-active
.page-content
.masonry-grid
each bun in files
.masonry-grid.are-images-unloaded
each bun in docs
+card(bun.path.replace('public/', ''))
section#fixed-tab-2.mdl-layout__tab-panel
.page-content
@ -37,3 +29,5 @@ html
| Submit
section#fixed-tab-3.mdl-layout__tab-panel
.page-content
include ../mixins/paginate.pug

+ 10
- 4
views/pages.pug View File

@ -1,9 +1,15 @@
//- bunnydb pages.pug CLIENT/git 07/31/2018 hazel <arcetera@openmailbox.org>
h1 Test
doctype html
ul
each bun in docs
li= bun.path
include ../mixins/card.pug
html
include ../mixins/head.pug
.mdl-layout.mdl-js-layout
.page-content
.masonry-grid
each bun in docs
+card(bun.path.replace('public/', ''))
include ../mixins/paginate.pug

Loading…
Cancel
Save