Code Monkey home page Code Monkey logo

snakeclock's Introduction

Snake Clock

Snake Clock Screenshot

This is an original and fun clock face where a snake lives its day along yours.

It’s my first ever Flutter app! I built it for the Flutter Clock challenge.

How does it work?

The snake’s head represent the current time. Each hour is a line, and minutes are the head’s horizontal position. Use the left or right indicators to know the hour and the top or bottom indicator the minutes (they are updated according to the snake’s direction, because it goes right on even hours and left on odd hours). It’s actually quite precise, with some training you can read the hour down to a minute or two (it’s not the head’s end but the head’s center that indicates the exact minute).

The tongue goes in and out each second, and the eyes blink every ten seconds.

The snake’s color changes with the current season: blue for winter, green for spring, yellow for summer and orange for fall.

The snake eats an apple at 9:30, 13:30 and 19:30, each of a different color because he doesn’t like routine.

How to run it?

  1. Clone the repo.
  2. Go into the snake_clock folder.
  3. Run flutter run.
  4. Enjoy!

What could be improved

  • Right and bottom indications could be removed so that the snake takes up more space, but it would become uncentered.
  • Maybe instead of showing all hour indicators, show the current one (still aligned with the snake).
  • Snake’s color could be a gradient showing the today’s outside temperature: it would be blue at ~0°C (or min day temp) and red at ~30°C (or max day temp) with a linear gradient inbetween. This would be painted on each segment (about 1 per minute) of the snake to get a view of the day’s temperature. In the end, the snake would start blue and go red as the sun rise then blue again when it’s night time.
  • The snake could turn around in a circular arc instead of right angles, and have a more linear travel when changing hour, though it would be more precise to read time. Otherwise, make a smooth transition from hour to hour (not sure on how to do that in a clean way using a canvas…)
  • The snake could be decorated with little teardrops when it rains, clouds when it’s cloudy, snowflakes when it snows, stripes when there are thunderstorms…
  • Maybe show an AM/PM indicator? Not sure if that’s useful, we never use 12h mode in our country (comparing the two, I don’t really see the point of 12h mode…).
  • Make tongue go up and down instead of in and out?
  • Code could probably be refactored to make it a lot cleaner, for example I don’t know where to make the snake positions calculations (which are right now duplicated in SnakePainter and IndicationsPainter, ugly…).
  • Maybe the apples could be hand drawn in Flutter instead of printing an image, it would be easier to change the color and maybe more efficient too?

snakeclock's People

Contributors

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