Code Monkey home page Code Monkey logo

flickr-viewr's Introduction

Flickr Viewr

GitHub version Dependency Status Build Status Coverage Status

Flickr Viewr displays the 20 latest images on Flickr matching the tags you search for. Click a photo to view it in high resolution, and click its tags to see related photos.

Use it here: http://wsydna.github.io/flickr-viewr/

Browser support

Support has been tested for and confirmed on the following browsers:

  • Edge 12
  • IE 10+
  • Safari 8+
  • Chrome 40+
  • Firefox 35+

Development

Setup

To download the source and prepare your environment for local development, first make sure Node, Bower and the Grunt CLI are all installed:

  • Node: https://nodejs.org/
  • Bower: with Node installed, run npm install -g bower from a command line
  • Grunt CLI: with Node installed, run npm install -g grunt-cli from a command line

Then:

  1. Fork or clone this repository (https://github.com/wsydna/flickr-viewr.git)
  2. Open a command line in your local working directory, and run npm install. This will install the required node modules and bower components.

After following the steps above, you're ready to start developing. However, it's advisable to serve the source files even when developing locally, to make sure your local changes reflect behaviour in a live environment. One easy way to do this is with Live Server:

  1. If you haven't already, install Live Server globally with npm install -g live-server
  2. cd into the src directory and run live-server

Live Server will reload your files whenever a change is made, which is useful for rapid development.

Grunt tasks

The Flickr Viewr project has several Grunt tasks configured within gruntfile.js. The most useful ones to know about are:

grunt watch

You should set this task running before starting to develop locally in order to be notified of any errors in the .less and .js files.

Begins watching all .less files in the src\less directory, as well as gruntfile.js and all .js files in the src and test directories. When any of them change, JSHint will run on those files, then any Jasmine specs in the test directory will run. JSHint and Jasmine results will be output to the console each time.

grunt test

This task also runs the Coveralls task, which only succeeds when running in Travis CI (see note below).

Runs JSHint on gruntfile.js and all files in the src and test directories, then runs any Jasmine specs in the test directory and records code coverage. JSHint and Jasmine results will be output to the console each time, along with code coverage results.

grunt build

Run this task to build the production-ready app.

Runs JSHint, Jasmine and code coverage in the same way as the test task, then compiles .less files to .css and copies static files (images and favicons) into the dist directory. Built files appear in a root directory named app, except for the built index.html file which is output to the root directory.

* A note on tests, code coverage and continuous integration

The Flickr Viewr project includes a set of tests (in the test directory) written in Jasmine (http://jasmine.github.io/). These tests are run as part of the grunt build task - any failures will cause the build to fail, meaning that all tests must pass in order for any changes to be committed to the built files.

In addition, code coverage is measured by Istanbul (https://github.com/taichi/grunt-istanbul). Code coverage thresholds are set within gruntfile.js. If code coverage slips below these thresholds the build will fail.

Finally, the project is configured to run within Travis CI (https://travis-ci.org/) and for code coverage to be monitored by Coveralls (https://coveralls.io/). These services power the build and coverage badges at the top of this readme, an provide useful feedback to help fix errors and improve code coverage. Visit those sites to enable these services for your own repo. Once enabled, they'll process the code each time you push a commit to github.

flickr-viewr's People

Contributors

wsydna avatar

Watchers

James Cloos avatar  avatar

flickr-viewr's Issues

Use history.pushState() to allow native navigation

Using a browser's native back and forward controls should:

  • Navigate between searches in the main list view
  • Go back from the details view to the main list view (forward should go back to the details view)
  • Close the search bar if it is open (forward should open it again)

Currently if anyone tries these actions they will navigate back to the previous page, away from the app.

Make tags more obviously clickable

In the details view, tags can be clicked in order to carry out a new search for just that tag. It would be good if the tags each contained an icon to make their clickability more obvious - especially on touch devices where there is less chance of triggering the hover event.

Implement lazy loading of images

Perceived performance is quite poor on slow connections or low-powered devices due to the number of images being loaded. Lazy-loading should be introduced so images are only loaded if they are in the current viewport.

Placeholders/loaders should be used while images are downloading.

In the details view, the image container should have a fixed height prior to the image downloading, to avoid a flat (but still bordered) container.

Add current search display

In the main list view, it would be useful to see the tags that are currently being searched on. These could be displayed at the top of the page or perhaps fixed beneath the title bar.

Tag display could be similar to the way tags are displayed in the details view. Similarly, clicking one of them could also carry out a new search for just that tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.