Code Monkey home page Code Monkey logo

cocoa-skycons's Introduction

This is a port of the animated HTML5 canvas weather icons - Skycons from forecast.io - to Objective-C/Cocoa. The goal is to work natively on both Mac and iOS exactly as the original canvas version.

This was a weekend hack just to see how easily it could be ported to another platform. Right now, it's pretty much a direct port from JavaScript, without any attempts to make it more Cocoa-like. That can be done after it's working.

Usage

Create a SKYIconView, specify the type, and use it as you would any other NSView/UIView. It will animate by default, but you can disable that with [icon pause].

SKYIconView *icon = [[SKYIconView alloc] initWithFrame:frame];
icon.type = SKYRain;
[view addSubview:icon];

I'm on the fence about whether each icon type should be a subclass, that probably makes more sense in Objective-C, but this method has the benefit of being able to easily update what the icon is if conditions change.

Status

This is in the early stages. Currently, mostly works on Mac, but is broken on iOS. Known issues:

  • Doesn't work correctly on iOS
  • The clouds should be rendered only as an outline, not filled in
  • There is a bug in the leaf animation

Screenshots

Skycons Mac

License

This is released into the public domain, same as the originals.

cocoa-skycons's People

Contributors

zachwaugh avatar

Watchers

 avatar  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.