CCode for Artists - Miles DeCoster

Code for Artists is a sandbox of files created to try out ideas and techniques using various web-related technologies. Some were created to solve specific problems, others just explore what can be done with some bits of code. Creating problems is at least as interesting as solving them. As this is a website, most of the samples are built around HTML, CSS, JavaScript and PHP. I try to put all of the necessary code for a sample in the same document, so if you view source you will find the HTML, CSS and JavaScript, or JQuery code. That does not work so well for PHP so I generally will have some code snippets on the page or in a separate file to document the PHP code. PHP, of course, needs to be run through a server to function. Also, some examples require multiple documents due to the nature of the projects.

Be forewarned that these are not necessarily optimal solutions or routines. I am a visual artist with an interest in programming. This site is a documentation of my efforts, rather more like sketches than finished paintings.

Leave a comment or just say hello in the Howdy Book

Filter examples:

 HTML examples  
 CSS examples  
 JavaScript/jQuery examples  
 PHP examples
  
 Processing examples

  • What's new? Processing and JavaScript!

  • CSS Transitions are fast and easy.

    This is a simple CSS transition

    p.change {
    	padding:10px;
    	background:#f00;
    	display:block;
    	width:200px;
    	transition: all 2s;
    	-moz-transition: all 2s;
    	-webkit-transition: all 2s; 
    	-o-transition: all 2s; 
    }
    .change:hover {
    	background:#0f0;
    	padding:80px;
    }
    
  • Touch swipe images

    Touch and swipe images. This uses the touchswipe JavaScript plugin from Skinker Labs. This is a general purpose "touch" plugin, that lets you detect various touch interactions, motion, multi-finger ets. The sliding animation is done via CSS transforms. Webkit only, I think for the gallery example, but could be expanded to other browsers as the results of the touch interaction are not part of the plug-in.

  • Touch Swipe full screen

    Touch and swipe screen sized panels. This uses the swipe.js JavaScript plugin from Brad Birdsall. The sliding animation is done via CSS transforms. Code base includes CSS transforms for the main browsers, Safari, Firefox, Chrome, Opera, and IE. Works great on iPad and iOS in general. Thanks to Matt G and Matt H for the demo.

  • Bits and pieces (small bits of code that do specific things)

    Motion effects (page samples with various motion effects)

    • Multi-plane camera effect

      This uses background image scaling to create an effect similar to that created by multi-plane animation cameras. Scrolling up and down zooms the camera into and out of the scene. The different layers scale at different rates.

    • Multi-plane camera modified for touch interfaces

      This uses background image scaling to create an effect similar to that created by multi-plane animation cameras. Scrolling up and down zooms the camera into and out of the scene. The different layers scale at different rates. This version is modified a bit to make it work with touch interfaces as well as desktop browsers.

    • Multi-plane camera effect - variation

      This uses background image scaling to create an effect similar to that created by multi-plane animation cameras. Scrolling up and down zooms the camera into and out of the scene. This version adds a sliding panel.

    • Parallax side-scroll effect

      This uses background image positioning to create a parallax effect. Scrolling side-to-side moves the layers at different speeds.

    • Arbitrary motion vertical-scroll effect

      This uses div positioning reacting to vertical scrolling. Each div moves in a different direction/speed when you scroll.

    Image galleries (page samples with various image galleries)

    • Thumbnails and one large image version 1

      Click thumbnail images to display larger versions. A simple jQuery code using file names to change the larger picture.

    • Thumbnails and one large image version 2

      Click thumbnail images to display larger versions. A simple jQuery code that hijacks regular HTML links to change the larger image.

    • Upload an image for the page header

      Use a form to select an image (gif, jpeg or png) from your local drive and upload it to the server. The image will be resized, saved and placed in a folder. The saved file will be named "banner.jpg" and that image source is then inserted into the banner div.

    • jQuery image preloader

      Script preloads a set of images. It has three functions that can be called are called when the script loads, each image loads and all of the images are loaaed.

    • jQuery image preloader and slideshow

      Script preloads a set of images. The fist image is faded in once it is loaded. When all of the images are loaded the links for the "slideshow" appear. The slide show uses the jQuery animate function to fade out the image and fade in the chosen image. We use jQuery to hijack the links and to hide the things we want to show only when the images are loaded so the page still has basic functionality with JavaScript disabled.

    • jQuery image preloader and slideshow version 2

      Script preloads a set of images. The fist image is faded in once it is loaded. When all of the images are loaded the thumbnails appear. The slide show uses the jQuery animate function to fade out the image and fade in the chosen image. We use jQuery to hijack the links and to hide the things we want to show only when the images are loaded so the page still has basic functionality with JavaScript disabled.

    • Upload images for a "banner" slideshow.

      An image uploader that scales, crops, numbers and saves image files. Another page uses the images for a banner with a slide show of preloaded images based on the file list generated by the uploader.

    • Change an image during vertical scroll

      This sample has a fixed position image that changes the source file when scrolled. It works with touch devices (iPhone, iPad) as well as desktop browswers.

    Color (some color stuff)

    Josh Miller

    Some cool stuff coming soon.

    Temporary link to the previous version of this site.


    ©copyright 2013 Miles DeCoster