Coder Social home page Coder Social logo

tcoderwang913 / anypic Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 99.31 MB

An open source mobile and web app that lets users share photos similar to Instagram

License: Creative Commons Zero v1.0 Universal

JavaScript 13.88% Objective-C 55.84% Ruby 0.20% HTML 2.57% CSS 27.52%

anypic's Introduction

Anypic

Anypic is the easiest way to share photos with your friends. Get the app and share your fun photos with the world. Anypic is fully powered by Parse.

You can get the source code and create your own Anypic with this tutorial.

iOS Setup

Anypic requires Xcode 5 and iOS 7. The tutorial provides additional setup instructions.

Setting up your Xcode project

  1. Install all project dependencies from CocoaPods by running this script:
cd Anypic-iOS
pod install
  1. Open the Xcode workspace at Anypic-iOS/Anypic.xcworkspace.

  2. Create your Anypic App on Parse.

  3. Copy your new app's application id and client key into AppDelegate.m:

[Parse setApplicationId:@"APPLICATION_ID" clientKey:@"CLIENT_KEY];"

Finally, select the Anypic target and go to Build Phases. Under Upload Symbol Files, update line 3 to point to your Cloud Code folder, if any. If you're not using Cloud Code, feel free to remove the Upload Symbol Files section.

Configuring Anypic's Facebook integration

  1. Set up a Facebook app at http://developers.facebook.com/apps

  2. Set up a URL scheme for fbFACEBOOK_APP_ID, where FACEBOOK_APP_ID is your Facebook app's id.

  3. Add your Facebook app id to Info.plist in the FacebookAppID key.

Web Setup

The main Anypic site is at Anypic-web/index.html. The site will show the last eight photos uploaded to your Anypic app by default. You can click any of these photos to display a bigger version.

Parse JavaScript SDK

Anypic.org is built on top of the Parse JavaScript SDK. The main JavaScript file is at Anypic-web/js/anypic.js.

To get started, copy your app's id and JavaScript key into anypic.js:

Parse.initialize("APPLICATION_ID", "JAVASCRIPT_KEY");

You'll notice that there is only one index.html, however Anypic's website displays different content for the homepage and for a single photo's landing page. This is accomplished using Backbone.js's Backbone.Router. The following lines set up the two routes:

routes: {
  "pic/:object_id": "getPic",
  "*actions": "defaultRoute"
}

Whenever /#pic/<object_id> is visited, the Router will call the getPic function and pass along the object id for the photo that should be presented. The getPic function loads the photo landing page into the DOM, then obtains the photo from Parse using Parse.Query.

Any other URL will call the defaultRoute function, which should load the homepage into the DOM.

CSS

Anypic uses Sass and Compass to generate its CSS. You will find the main SCSS file at sass/screen.scss. To get started, run compass watch from the Anypic-web folder.

Any changes made to the .scss files in sass/ will be picked up by Compass and used to generate the final CSS files at stylesheets/.

Anypic uses media queries to present different layouts on iPad, iOS and various desktop resolutions. These media queries will apply different CSS properties, as defined by _320.scss, _480.scss, _768.scss, _1024.scss, and _1024.scss depending on the device's horizontal resolution. You can modify these in sass/screen.scss. The following media query applies the CSS rules laid out in _320.scss when your website is visited from an iPhone, for example:

@media only screen and (max-width : 320px) { @import "320" }

Cloud Code

Add your Parse app id and master key to Anypic-iOS/CloudCode/config/global.json, then type parse deploy from the command line at Anypic-cloud. See the Cloud Code Guide for more information about the parse CLI.

anypic's People

Contributors

gfosco avatar hramos avatar jeffreyjackson avatar nlutsenko avatar

Watchers

 avatar

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.