From f08476e7eca6436bbd86c93a449a8e5c46f61404 Mon Sep 17 00:00:00 2001 From: Timothy Farrell Date: Thu, 19 Jul 2018 07:48:57 -0500 Subject: [PATCH] Apply standard/enforced code format with prettier. This commit marks applying prettier to the whole of git history up to this point and prettier is used to enforce format via pre-commit hook. The command used was: `git filter-branch -f --tree-filter 'prettier --no-config --single-quote --tab-width=1 --print-width=100 --use-tabs --trailing-comma=none --prose-wrap=always --write "{.,{packages,bin}/**}/*.{js,json,md}" || echo "Error formatting, possibly invalid JS"' -- --all` --- packages/gallery/README.md | 28 +++++++++---------- packages/gallery/package.json | 4 ++- packages/gallery/src/interface/focus.js | 4 +-- packages/gallery/src/interface/sectionView.js | 4 +-- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/packages/gallery/README.md b/packages/gallery/README.md index 0ab623b..d6ba38b 100644 --- a/packages/gallery/README.md +++ b/packages/gallery/README.md @@ -5,8 +5,8 @@ myself and to share with friends and family. Along the way it became a learning ## Features -* Upload and view images -* Save files to Backblaze B2 storage. +- Upload and view images +- Save files to Backblaze B2 storage. ## Development Philosophy @@ -19,9 +19,9 @@ photo gallery for anyone who wishes to escape the social media silos. However, i This would not be possible without the giants who have laid the foundation: -* [Webpack](http://webpack.js.org/) -* [DOMVM](http://leeoniya.github.io/domvm/) -* [PouchDB](https://pouchdb.com/) +- [Webpack](http://webpack.js.org/) +- [DOMVM](http://leeoniya.github.io/domvm/) +- [PouchDB](https://pouchdb.com/) There are many more dependencies. You can find them in the [package.json](./package.json) file. @@ -36,12 +36,12 @@ localhost certificate exception in order to operate properly. In the future, I plan to add: -* sharable links -* local file storage -* CSRF for interacting with server component -* albums -* client-side encryption -* video support -* Sandstorm support -* CORS-based storage: - s3 - remotestorage - Google Cloud? - Dropbox? -* tags +- sharable links +- local file storage +- CSRF for interacting with server component +- albums +- client-side encryption +- video support +- Sandstorm support +- CORS-based storage: - s3 - remotestorage - Google Cloud? - Dropbox? +- tags diff --git a/packages/gallery/package.json b/packages/gallery/package.json index 2e9b628..84ee163 100644 --- a/packages/gallery/package.json +++ b/packages/gallery/package.json @@ -2,7 +2,9 @@ "name": "Gallery", "version": "0.0.1", "description": "Personal photo gallery", - "keywords": ["javascript"], + "keywords": [ + "javascript" + ], "author": "Timothy Farrell (https://github.com/explorigin)", "license": "Apache-2.0", "scripts": { diff --git a/packages/gallery/src/interface/focus.js b/packages/gallery/src/interface/focus.js index 4532454..de12497 100644 --- a/packages/gallery/src/interface/focus.js +++ b/packages/gallery/src/interface/focus.js @@ -50,11 +50,11 @@ export function FocusView(vm, params) { if (windowRatio > imageRatio) { return { height: vw / windowRatio, - width: vw / windowRatio * imageRatio + width: (vw / windowRatio) * imageRatio }; } return { - height: vh * windowRatio / imageRatio, + height: (vh * windowRatio) / imageRatio, width: vh * windowRatio }; }, diff --git a/packages/gallery/src/interface/sectionView.js b/packages/gallery/src/interface/sectionView.js index 91b3ff6..aa44784 100644 --- a/packages/gallery/src/interface/sectionView.js +++ b/packages/gallery/src/interface/sectionView.js @@ -32,7 +32,7 @@ export function SectionView(vm, params, key) { const availableWidth = vw - CONTENT_MARGIN_WIDTH; const aspectRatios = pArr.map(aspectRatio); const totalImageRatio = sum(aspectRatios); - const rowCount = Math.ceil(totalImageRatio * OPTIMAL_IMAGE_HEIGHT / availableWidth); + const rowCount = Math.ceil((totalImageRatio * OPTIMAL_IMAGE_HEIGHT) / availableWidth); const rowRatios = partition(aspectRatios, rowCount); let index = 0; @@ -41,7 +41,7 @@ export function SectionView(vm, params, key) { const rowTotal = sum(row); const imageRatio = row[0]; const portion = imageRatio / rowTotal; - let rowHeight = availableWidth * portion / aspectRatio(pArr[index]); + let rowHeight = (availableWidth * portion) / aspectRatio(pArr[index]); if (rowHeight > OPTIMAL_IMAGE_HEIGHT * ROW_HEIGHT_CUTOFF_MODIFIER) { rowHeight = OPTIMAL_IMAGE_HEIGHT * ROW_HEIGHT_CUTOFF_MODIFIER; }