Playful Feedback

Playful Feedback

Coding

Applications Used:

The Goal:

The Goal:

The Goal:

The goal of this project was to design an interactive web browser guided by the pairing of an abstract adjective with an interactive design principle.


The abstrasct adjective and interactive design principle chosen was:
Playful and Feedback.


CLICK HERE TO TRY THE WEBSITE:

Ideation Process:

Ideation Process:

Ideation Process:

For the adjective playful, I decided to make my interactive website contain circles that randomly move around the screen. In order to make it a playful aspect, I originally planned to have each circle create a different interaction which leads me to my principle: feedback.


However, after some thought I decided to change my plan in order to make the circles work together. Rather than having them each as different interactions, I decided to make them play different musical sounds instead.


By having the cirlces move randomly to different position, it makes it seem as if the users were playing a game. In order to link different sounds, users will have o keep track of which circle plays which sound when being hovered over.

Creation Process:

Creation Process:

Creation Process:

The website was created using Visual Studio Code utilising vanilla HTML, CSS and Javascript.


Royalty free music sounds were downloaded from pixabay and are as follows:

  • chime.mp3 - https://pixabay.com/sound-effects/chime-sound-7143/

  • a3.mp3 - https://pixabay.com/sound-effects/a3-101081/

  • b5.mp3 - https://pixabay.com/sound-effects/03-b5-82301/

  • clap.mp3 - https://pixabay.com/sound-effects/clap-2-95736/

  • piano-g.mp3 - https://pixabay.com/sound-effects/piano-g-6200/

  • punch.mp3 - https://pixabay.com/sound-effects/punch-boxing-02wav-14897/

  • sd.mp3 - https://pixabay.com/sound-effects/sd-10-40943/

  • snare.mp3 - https://pixabay.com/sound-effects/snare-112754/


The chosen color scheme consist of 8 different colors for the 8 different circles. I used a dark grey background for the website allowing the circles to stand out. The colors of the circle are simply different colors of the rainbow in order for each circle to contrast each other but still imply their possible functionality of working together.

HTML Code:

<!DOCTYPE html>

<html lang="en">

    <head>

        <meta charset="utf-8" name="viewport" content="width=device-width, intial-scale=1.0">

        <link rel="stylesheet" href="style.css">

        <script src="script.js" defer></script>
 
    </head>

    <body>
        <div class="musicCircles" id="circle1" data-audioid="sound1"></div>
        <audio id="sound1"><source src="sounds/chime.mp3"></audio>

        <div class="musicCircles" id="circle2" data-audioid="sound2"></div>
        <audio id="sound2"><source src="sounds/a3.mp3"></audio>

        <div class="musicCircles" id="circle3" data-audioid="sound3"></div>
        <audio id="sound3"><source src="sounds/b5.mp3"></audio>

        <div class="musicCircles" id="circle4" data-audioid="sound4"></div>
        <audio id="sound4"><source src="sounds/clap.mp3"></audio>

        <div class="musicCircles" id="circle5" data-audioid="sound5"></div>
        <audio id="sound5"><source src="sounds/piano-g.mp3"></audio>

        <div class="musicCircles" id="circle6" data-audioid="sound6"></div>
        <audio id="sound6"><source src="sounds/punch.mp3"></audio>

        <div class="musicCircles" id="circle7" data-audioid="sound7"></div>
        <audio id="sound7"><source src="sounds/sd.mp3"></audio>

        <div class="musicCircles" id="circle8" data-audioid="sound8"></div>
        <audio id="sound8"><source src="sounds/snare.mp3"></audio>
    </body>

</html>

JavaScript Code:

var circles = document.getElementsByClassName("musicCircles");

// Create the 8 different circles
for(var circle of circles) {

    // start all circles in the middle of the screen
    var circleStartPos = [`${50}%`, `${50}%`];
    circle.style.left = circleStartPos[0];
    circle.style.top = circleStartPos[1]; 

    //makes the circles move
    animateCircles(circle, circleStartPos)
}

// creates different random x and y positions
function newPosition() {
    var randomX = `${Math.random() * 100}%`;
    var randomY = `${Math.random() * 100}%`;
    return [randomX, randomY]
}

//function to animate circles
function animateCircles(elementToAnimate, endPos) {

    // random x and y coordinates are given
    var randomPos = newPosition();

    // makes the circle move from where they end
    var startPos = endPos;

    // makes circles move randomly between 2 and 4 seconds
    var randomTime = 2000 + (Math.random() * 2000)
    elementToAnimate.animate([
        { //0%
            left: startPos[0], 
            top: startPos[1]
        },
        { //100%
            left: randomPos[0], 
            top: randomPos[1]
        }
                
        // recalls animateCircles function when it is completed
        ], randomTime).onfinish = function() {
            animateCircles(elementToAnimate, randomPos);
        }

    // add event listener playSound to all circles
    let audioElementList = Array.from(document.getElementsByClassName("musicCircles"));
    for (const audioElement of audioElementList) {
        audioElement.addEventListener("mouseenter", playSound);
    }

    // plays sound when mouse enters the circle
    function playSound(e) {

        // differentiates circles with their different id's
        console.log(e.target.dataset.audioid);
        let audioElement = document.getElementById(e.target.dataset.audioid);

        // plays audio
        audioElement.play();
    }
}

CSS Code:

body {
    background-color: #1E2022;
    color: #C9D6DF;
}

.musicCircles {
    position: absolute;
    width: 10%;
    height: 15%;
    border-radius: 100%;
}

.musicCircles:hover {
    outline-style: solid;
    outline-width: 5px;
}

#circle1 {
    background-color: #cc0001;
}
#circle2 {
    background-color: #fb940b;
}
#circle3 {
    background-color: #ffff01;
}
#circle4 {
    background-color: #01cc00;
}
#circle5 {
    background-color: #03c0c6;
}
#circle6 {
    background-color: #0000fe;
}
#circle7 {
    background-color: #762ca7;
}
#circle8 {
    background-color: #fe98bf;
}

Reflection:

Reflection:

Reflection:

Admittedly the sounds chosen may not be the best sounds to create a musical melody due to the limited sounds and accessbility I had. In order to improve the website I would like to focus towards choosing better sounds of even creating my own musical sounds. However overall the sounds were not needed to demonstrate the core interaction of playful and feedback.