banner



How Do You Color Code Google Calendar

Information technology's difficult to define exactly what 'artistic coding' means. In wide terms, it refers to the production of something that is expressive in nature rather than having a purely applied use. It is a take chances to acquire and explore how various different technologies can come together to create impressive works of art.

What form that takes is entirely upward to the creator. Anything from data visualisation to paradigm manipulation could be considered 'creative coding'. The web is flexible enough to open up opportunities in different areas of fine art and design.

  • 35 incredible dataviz tools (opens in new tab)

Here we look at the unlike ways you can experiment with code and create stimulating visual results. Want to requite it a endeavor? Have a wait around the all-time code editors (opens in new tab) the web has to offer and get stuck in! Want to proceed things simple? Try a website builder. Either way, you'll want to go your web hosting service right.

01. Head straight for the frameworks

If you're comfy with code and accept a good idea of what you want to create, why wait? Hither are the iv best frameworks for creative coders; take your choice!

p5.js (opens in new tab)

p5.js download screen

p5.js gives you the ability and ease of use of Processing, but on the web

Processing is the holy grail for creative coders. It provides a language and an IDE to enable designers and not-technical people to create stunning visualisations without getting buried in the technicalities.

The p5.js library takes the principles of Processing and applies them to the spider web. Information technology delivers the aforementioned kinds of abstractions, which provide simplicity to the beginners and offering powerful control to experts.

The majority of the piece of work happens within 2 functions – one controls the project setup, while the other draws to the page in a loop for the life of that projection. The library supplies plenty of global methods and variables to update the folio within these functions. For example, calling frameRate(60) lets p5.js practise the difficult work of maintaining a abiding 60fps.

sketch.js (opens in new tab)

sketch.js thumbnail screen

sketch.js is a lightweight but powerful way to get going with JavaScript

Weighing in at under 5kb, sketch.js is a tiny framework that helps developers get upwardly and running with artistic JavaScript. Information technology'southward lite plenty to embed in whatsoever website, only provides plenty of features along with it.

It'southward possible to claw into methods that react to events within the projects. While this includes the usual callbacks, such as the animation loop, sketch.js too opens upwards events such as keyboard input and window resizing.

Bear upon and mouse inputs are treated the same, which makes all projects touch-friendly by default. While it is possible to target either input blazon specifically, it takes the worry out of dealing with the small differences betwixt the two event types. It tin too calculate the deltas between these points automatically to make physics calculations easier.

D3 (opens in new tab)

D3 homepage

There's more to D3 than charts and graphs

While D3 has long been the go-to library for creating graphs and charts, that isn't all information technology's capable of. Its data-driven arroyo makes it slap-up for creating attractive visualisations – either informative or abstract. When combined with a rich information source such equally the Twitter API, it makes infographics easy to create.

Past manipulating DOM elements, such as SVG, D3 volition work with any avails already a part of an application. It provides a structure around which they can exist transformed to provide accent or to breathing onscreen.

There are plenty of ways to access D3 through other libraries and frameworks besides. Specially created components for React, directives for Angular, and plugins for most other front-end frameworks are readily available, for example.

three.js (opens in new tab)

three.js homepage

With three.js you can easily create shine 3D interactions using WebGL

Working in 3D with WebGL tin be complicated at the all-time of times. Working out how shaders and camera perspectives work in such a wide-reaching API tin can take away from the creative aspects of a project and tiresome everything downwardly.

With three.js it's possible to skim over these tricky aspects and focus on the visuals. Information technology is a 3D JavaScript library, which works with WebGL to easily create beautifully smooth interactions with minimum effort.

The library provides many built-in methods for creating objects in the scene. Everything tin exist altered just similar any other JavaScript object and volition update accordingly. Complicated techniques, such as texture mapping, are provided out of the box and are usually just a example of setting the appropriate pick on the object.

02. Become smart with data sources and APIs

At that place'due south enough of publicly-attainable data out in that location for you to play with keep your project fresh; see what you can do with these sources.

Twitter

Twitter developer homepage

Twitter's developer platform is a treasure trove for creative coders

(opens in new tab)

Twitter is a wealth of information. People are talking virtually every conceivable topic by posting pictures and video alongside their unfiltered reactions in existent time. This makes it a goldmine for a creative coding project. The official API can bring back the tweets in the format needed forth with other metadata that is open for analysis. This information tin can then be visualised in new and heady ways.

The Twitter API provides four divers 'objects' that can be retrieved – tweets, users, locations and entities. Entities include extra information linked to those objects including hashtags and media. Values on these objects are fixed and will only ever exist extended upon, which ways yous will never lose admission.

Tweets themselves tin can be searched for with a query to a single endpoint. These searches can either be for a string or can exist more descriptive, such equally for images or tweets with a positive sentiment.

Visualising Twitter information tin brand a great continued design piece. Combining multiple information points such as location and sentiment can create a project that is too informative, such as graphing alive tweets about a topic from around the world.

While there are enough of opportunities to use the output from Twitter, the API likewise allows for applications to post messages to Twitter. These can come up from any source provided that it's continued to the API.

All endpoints in the API require some kind of authentication. For most projects that is but an application key, but authenticating can be tricky when done manually. Thankfully in that location are a few packages that make working with the Twitter API a little easier.

The npm module 'twitter' is the take hold of-all client library when working through Node. It supports regular endpoints as well as streaming, which may be useful for real-time projects.

Instagram and Flickr

Laptop in a cafe displaying a map route

Social media APIs can provide a smashing source for data visualisations and mashups

Creative coding projects are oft visual, which makes image and video sharing APIs an bonny prospect for inspiration. Thankfully, sites such as Instagram and Flickr open up upwardly their data and allow developers access to that content, also as the surrounding metadata.

Instagram has become ane of the spider web's most pop paradigm-sharing platforms. As a result, information technology is a rich source of images to utilize in creative projects (got images to save? Go on them condom in cloud storage). The API is no unlike. It provides access to images, videos, comments and tags, likewise as ways of searching through this information to find what is needed for the project.

Access within the API will be initially limited to a small-scale pool of accounts and images. To remove some of these restrictions, Instagram will need to review the projection themselves, which can exist time-consuming and fruitless for creative coding projects. Depending on the projection, the initial sandbox style may suffice.

Flickr has a more readily accessible API. It is a resource of high-quality images available at multiple resolutions. Many of the photograph endpoints only require an application key to work, which makes prepare up and fetching much easier.

The 'flickr.photos.search' endpoint is the near commonly used and gives access to most of Flickr's content. It tin can exist filtered and sorted by date, location and even license as necessary. Other endpoints tin go more item on the photograph, such every bit comments or EXIF data

Getting the API to work exactly how the projection needs it to tin can exist hard, particularly if writing information back to Flickr. Luckily, plenty of packages exist to help use information technology with JavaScript, including the company'south own 'flickr-sdk' on npm.

It'southward of import to note that all images remain the property of their owners. For personal projects this will not be an issue, but if it'southward beingness shared be certain to either seek permission or credit the owner, depending on the terms prepare out by the photographer.

Camera and microphone

Portrait made out of emojis

Emoji Wall past Kitasenju Blueprint takes the image from a camera and redraws it using emoji within 3D space

(opens in new tab)

The web is ordinarily express to pointing and clicking with a mouse, merely that is not the only way of providing input. Today's browsers are equipped with new APIs to pull in data from different external sources, including cameras and microphones.

Making projects that are visually enlightened is a groovy way to get users involved. By using vision as an input over a traditional keyboard and mouse, users are able to interact in different ways, such as face up tracking or image recognition. As most devices at present come up with a photographic camera congenital in, it is no longer the barrier information technology once was and works out corking for the web.

Listening to the user is also a swell culling to manual input. Voice recognition could control navigation, or users could provide their ain audio samples to utilise within their feel. It could also serve as an culling to a push button press. By extracting pitch and book, these can then be mapped to what normally would be a push press, which could be used to command anything from colour to movement.

Access to a camera and microphone is possible through the navigator object.

          navigator.mediaDevices.getUserMedia({   audio: true,   video: { width: 640, height: 480 } }) .so(function(stream) {   // Access input }) .catch(function(error) {   // Provide fallback option });        

The code has to specify exactly what is needed from the input devices. The call to getUserMedia() volition trigger a permissions dialog that the user must accept before standing. In one case accepted, these features are bachelor as streams, making them more memory efficient.

All major browsers back up this API, including mobile. If the browser cannot meet the exact requirements, the promise will refuse and not work. It'southward important to supply an alternative feel, such every bit an epitome upload form, where admission is not possible.

03. Mobile device sensors

Streetview of Whitehall made out of LEGO bricks

Brick Street View will show what your current environment would expect like if they were fabricated from LEGO

(opens in new tab)

The world of mobile presents a completely dissimilar set of opportunities when it comes to creative coding. The wide diverseness of form factors and sensors open up for use within the browser can make for some distinctive experiences.

Mobile devices are almost exclusively touch interfaces. Browsers have the power to detect and rail multiple touches at once. This means that projects do not have to be led by a single point and tin be manipulated in a much more intuitive style.

          window.addEventListener("touchstart", e => {   eastward.preventDefault();   const touches = eastward.changedTouches; });        

All touch events apply a 'changedTouches' belongings on the outcome. This holds a reference to all the touch points that changed dependent on the type of event, rather than a separate result for each touch point. By tracking these, it's possible to map gestures or pigment with touch on.

Accelerometers and gyroscopes are mostly used for irresolute from portrait to landscape fashion, but these are also up for interpretation. Different methods of interaction can exist created past using the device itself as a control mechanism – whether that in specific co-ordinate movements or more gesture-based, such as a shake.

          window.addEventListener("deviceorientation", e => {   console.log(e.gamma); }); window.addEventListener("devicemotion", e => {   console.log(eastward.dispatch); });        

APIs provide access to this information, but the values returned volition vary past browser equally they exercise not all use the same coordinate system. Libraries such as p5.js provide special values and hooks like 'rotationX' or 'deviceShaken()' to help abstract abroad the differences.

Mobile devices also accept the power to determine their exact position using geolocation. Beingness able to get the exact location of a device can open upward new possibilities and make for a more streamlined feel.

          navigator.geolocation. getCurrentPosition(pos => { panel.log(pos.coords); });        

Access is provided through the navigator object. The value returned is the lat-long co-ordinates of the device, along with other information such equally altitude or speed if the device supports it. Browsers volition apply the fastest method of detecting location, such equally the IP address. Nevertheless, this may not always exist the most authentic.

Combining these inputs in creative means is the fundamental to making something special. For example, using the device's location and orientation to create a virtual stargazing experience.

04. Multi-screen experiences

Hand holding a phone displaying Bubbles

Bubbles – a project fabricated for Google I/O 2017 – enables users to pass bubbles betwixt one another from across the world

Desktop browsers provide reassuring familiarity when it comes to artistic projects. But by experimenting with different displays, users tin get a more than personalised feel that works for them.

The principles of responsive blueprint even so hold truthful for creative coding projects as well. Users should exist able to enjoy them regardless of device, whether that's desktop, mobile, or projected on a giant screen.

These differences can also be used to enhance the project farther. By using media queries in CSS, mobile users could get an experience tailored to the smaller, handheld form cistron. Since mobile users tend to be just one person, these visitors could be offered a more personalised view of a bigger platform, for example.

Paper Planes (opens in new tab), by company Active Theory, encouraged users to create virtual planes on their phones. These could then be 'thrown' and show up on the desktop version of the site. There, visitors could watch as planes flew around the globe and see where they had come from.

Interactions such as these can be fabricated easier with WebSockets. Communication betwixt a browser and the server is event based, avoiding the need to poll the server, which can often exist wasteful and prone to delays. Projects such as Socket.io can make setting up WebSocket protocols easier.

Directly communication betwixt devices tin can too have a powerful outcome when users are together in the aforementioned room. Seb Lee-Delisle'south PixelPhones (opens in new tab) project, for example, turned a crowd of screens into a makeshift brandish. Once all were continued, everybody became function of the experience.

WebRTC (opens in new tab) is a prepare of JavaScript APIs that makes real-fourth dimension advice between browsers easier. It needs a server to set up a connection, media is sent directly betwixt browsers, which makes interactions quick and unproblematic to create. Information technology's at present supported by all major browsers both on desktop and mobile.

05. Self-generative fine art

Computer generated city centre

Infinitown, past Piffling Workshop, generates a procedural city that is unique each time y'all visit

(opens in new tab)

Fifty-fifty the most creative of coding projects can become stale after a while. An element of randomness tin can proceed things fresh each fourth dimension a piece of code runs. While that tin can come from user input, it tin can be interesting to see what code is capable off when it's let off of the leash.

Instead of defining what the output of a block of lawmaking would be, define a set of rules for it to follow. When a random starting position is defined, the end results will vary completely.

Conway's Game of Life is a keen identify to start. In a defined grid, each square can either be 'on' or 'off' depending on the squares effectually it. By colouring the squares dependant on their state, information technology generates an image. Repeating the process multiple times shows how groups of squares mutate over time. Tweaking the rules on which they modify can dramatically alter the outcome.

Using JavaScript with a <canvas> element makes this visual process fairly simple. Past using requestAnimationFrame(), JavaScript tin re-evaluate its environment each frame. From there information technology is a case of using the output of the last frame every bit input for the next frame and let the program take care of itself.

06. WebVR and Bluetooth

A Frame screenshot

Creating VR experiences with a framework such as A-Frame is a lot less similar hard work

While browsers are getting more capable and powerful every day, there is only so much that one viewport can provide. Thankfully, browsers are also expanding out of the browser too.

Virtual Reality has the ability to immerse the viewer in ways not possible before. WebVR is an open specification that allows access to these immersive worlds to the masses through the browser. It also helps span the gap between different device types, such as Google Cardboard and the HTC Vive.

Frameworks, such as A-Frame (opens in new tab), can assistance bypass whatever complications by providing ready-to-go building blocks for VR experiences. Since these are built for functioning and reliability, they leaves the creator costless to brand a nifty user experience.

Bluetooth is another option and an opportunity to forego a screen entirely. Chips are readily available and can be combined with different output devices to emit sound and lite – all controlled by the browser through the Web Bluetooth API. The interface is promise based, which makes asynchronous advice somewhat easier.

Browser back up varies as these technologies evolve. WebVR is currently supported in diverse states past development builds of Edge, Firefox and Chrome. Web Bluetooth only has support from Chrome correct now, but others are because information technology.

This article was originally published in Web Designer, the creative web design mag. Subscribe to Web Designer here (opens in new tab) .

Related articles:

  • 12 common JavaScript questions answered (opens in new tab)
  • Absurd CSS blitheness examples to recreate (opens in new tab)
  • 20 bright JQuery plugins (opens in new tab)

Source: https://www.creativebloq.com/news/learn-to-code-with-google-go-for-dollar25

Posted by: hobbsnevered1981.blogspot.com

0 Response to "How Do You Color Code Google Calendar"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel