Assigment - Animations

Here is myKitty animations.
I took a screen record, converted it to gif file size 364.54KiB and optimized to file size 263.4KiB (-27.74%).
myKittyAnimations

index.html changes added id's to the divs and added animation slider
<div id="head" class="cat__head" >
                        <div id="midDot" class="cat__head-dots">
                            <div id=" leftDot" class="cat__head-dots_first"></div>
                            <div id=" rightDot" class="cat__head-dots_second"></div>
                        </div>
                        <div id="eye" class="cat__eye">
                            <div class="left_eye">
                                <span class="pupil_left"></span>
                            </div>
                            <div class="right_eye">
                                <span class="pupil_right"></span>
                            </div>
                        </div>
                        <div id="nose" class="cat__nose"></div>
                        <div id="mouth" class="cat__mouth">
                            <div id="tongue" class="cat__tongue"></div>
                        </div>
                    </div>
                    <div id="tail" class="cat__tail">
                        <div class="tail_shaft"></div>
                    </div>
  ...
<!-- Cat Animations -->
                <div id="catAnimations">
                    <div class="form-group">
                        <label for="formControlRange">
                            <b>Animation</b>
                            <span class="badge badge-dark ml-2" id="animationName"></span>
                        </label>
                        <input type="range" min="1" max="7" class="form-control-range" id="animation">
                    </div>
                </div>
catFactory.js changes added 7 animation types with type 1 being no animation
// 7 animation types
 function animationVariation(num) {
    $('#dnaanimation').html(num);
    switch (num) {
        case 1:
            $('#animationName').html('None') //set badge to "None"
            animationType1();
            break;
        case 2:
            $('#animationName').html('Head Shake') //set badge to "Head Shake"
            animationType2();
            break;
        case 3:
            $('#animationName').html('Head Nod') //set badge to "Head Nod"
            animationType3();
            break;
        case 4:
            $('#animationName').html('Tail Shake') //set badge to "Tail Shake"
            animationType4();
            break;
        case 5:
            $('#animationName').html('Tongue Flick') //set badge to "Tongue Flick"
            animationType5();
            break;
        case 6:
            $('#animationName').html('Nose Nod') //set badge to "Nose Nod"
            animationType6();
            break;
        case 7:
            $('#animationName').html('Eyes Blink') //set badge to "Eyes Blink"
            animationType7();
            break;
        default:
            console.log("Not in range")
    }
}

async function animationType1() {
    await resetAnimation();
}
async function animationType2() {
    await resetAnimation();
    await $("#head").addClass("shakingHead");
}
async function animationType3() {
    await resetAnimation();
    await $("#head").addClass("noddingHead");
}
async function animationType4() {
    await resetAnimation();
    await $("#tail").addClass("shakingTail");
}
async function animationType5() {
    await resetAnimation();
    await $("#tongue").addClass("flickingTongue");
}
async function animationType6() {
    await resetAnimation();
    await $("#nose").addClass("noddingNose");
}
async function animationType7() {
    await resetAnimation();
    await $("#eye").find('span').addClass("blinkingEyes");
}
async function resetAnimation() {
    // add any animation class that you create
    await $("#head").removeClass("shakingHead");
    await $("#head").removeClass("noddingHead");
    await $("#tail").removeClass("shakingTail");
    await $("#tongue").removeClass("flickingTongue");
    await $("#nose").removeClass("noddingNose");
    await $("#eye").find('span').removeClass("blinkingEyes");
}
animations.css
.shakingHead {
    animation: shakeHead 5s infinite;
}
.noddingHead {
    animation: nodHead 5s infinite;
}
.shakingTail {
    animation: shakeTail 5s infinite;
}
.flickingTongue {
    animation: flickTongue 8s infinite;
}
.noddingNose {
    animation: nodNose 5s infinite;
}
.blinkingEyes {
    animation: blinkEyes 3s infinite;
}

/**
 * Animation keyframes 
 */
@keyframes shakeHead {
    0% {
        transform: rotate(0deg);
    }
    30% {
       transform: rotate(5deg); 
    }
    60% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}
@keyframes nodHead {
    0% {
        transform: translate(0px, 0px);
    }
    30% {
        transform: translate(0px, 10px); 
    }
    60% {
        transform: translate(0px, -10px);
    }
    100% {
        transform: translate(0px, 0px);
    }
}
@keyframes shakeTail {
    0% {
        transform: skew(10deg, 0deg);
    }
    30% {
        transform: skew(10deg, 15deg);
    }
    60% {
        transform: skew(10deg , -15deg);
    }
    100% {
        transform: skew(10deg, 0deg);
    }
}
@keyframes flickTongue {
    0% {
        transform: rotateX(0deg);
    }
    30% {
        transform: rotateX(90deg);
    }
    60% {
        transform: rotateX(-90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}
@keyframes nodNose {
    0% {
        transform: translateY(0px);
    }
    30% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}
@keyframes blinkEyes {
    0% {
        border-top: 0px;
    }
    30% {
        border-top: 40px solid;
    }
    60% {
        border-top: 40px solid;
    }
    100% {
        border-top: 0px;
    }
}
1 Like

My animated Ginger kitty
image

catFactory.js


//Random color
function getColor() {
    var randomColor = Math.floor(Math.random() * 16777215).toString(16);
    return randomColor
}

function genColors(){
    var colors = []
    for(var i = 10; i < 99; i ++){
      var color = getColor()
      colors[i] = color
    }
    return colors
}

//This function code needs to modified so that it works with Your cat code.
function headColor(color,code) {
    $('.head, .body').css('background', '#' + color)  //This changes the color of the cat
    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat
}
function tailColor(color,code) {
    $('.tail_end, .paw, .foot').css('background', '#' + color)  //This changes the color of the cat
    $('.tail').css('border-color', '#' + color)  //This changes the color of the cat
    $('#tailcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnatail').html(code) //This updates the body color part of the DNA that is displayed below the cat
}
function earColor(color,code) {
    $('.ear, .head_hair_left, .head_hair_right, .head_hair_middle').css('background', '#' + color)  //This changes the color of the cat
    $('#earcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaears').html(code) //This updates the body color part of the DNA that is displayed below the cat
}
function eyeColor(color,code) {
    $('.pupils').css('background', '#' + color)  //This changes the color of the cat
    $('#eyecode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function bellyColor(color,code) {
    $('.snout, .belly').css('background', '#' + color)  //This changes the color of the cat
    $('#bellycode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabelly').html(code) //This updates the body color part of the DNA that is displayed below the cat
}


//###################################################
//Functions below will be used later on in the project
//###################################################
function eyeVariation(num) {
    $('#dnaeyeshape').html(num)
    switch (num) {
        case 1:
            normalEyes()
            $('#eyename').html('Normal')
            break
        case 2:
            normalEyes()
            $('#eyename').html('Chill')
            eyesType1()
            break
        case 3:
            normalEyes()
            $('#eyename').html('Naughty')
            eyesType2()
            break
        case 4:
            normalEyes()
            $('#eyename').html('Snake Eyes')
            eyesType3()
            break
    }
}
function mouthVariation(num) {
    $('#dnamouthshape').html(num)
    switch (num) {
        case 1:
            $('#mouthname').html('Normal')
            normalmouth()
            break
        case 2:
            normalmouth()
            $('#mouthname').html('Sad')
            mouthType1()
            break
        case 3:
            normalmouth()
            $('#mouthname').html('Speechless')
            mouthType2()
            break
        case 4:
            normalmouth()
            $('#mouthname').html('Shocked')
            mouthType3()
            break
    }
}
function hairMiddleVariation(num) {
    $('#dnadhairMiddle').html(num)
    switch (num) {
        case 1:
            $('#hairmiddlename').html('Normal')
            normalhairMiddle()
            break
        case 2:
            normalhairMiddle()
            $('#hairmiddlename').html('Bald')
            hairMiddleType1()
            break
        case 3:
            normalhairMiddle()
            $('#hairmiddlename').html('Round')
            hairMiddleType2()
            break
        case 4:
            normalhairMiddle()
            $('#hairmiddlename').html('Spike')
            hairMiddleType3()
            break
    }
}
function hairSidesVariation(num) {
    $('#dnahairSides').html(num)
    switch (num) {
        case 1:
            $('#hairsidesname').html('Normal')
            normalhairSides()
            break
        case 2:
            normalhairSides()
            $('#hairsidesname').html('Bald')
            hairSidesType1()
            break
        case 3:
            normalhairSides()
            $('#hairsidesname').html('Round')
            hairSidesType2()
            break
        case 4:
            normalhairSides()
            $('#hairsidesname').html('Spike')
            hairSidesType3()
            break
    }
}
function animationVariation(num) {
    $('#dnaanimation').html(num)
    switch (num) {
        case 1:
            resetAnimation()
            $('#animationname').html('No Animation')
            break
        case 2:
            $('#animationname').html('Head Side-to-Side')
            animationType1()
            break
        case 3:
            resetAnimation()
            $('#animationname').html('Tail Wiggle')
            animationType2()
            break
        case 4:
            resetAnimation()
            $('#animationname').html('Twitch Ears')
            animationType3()
            break
        case 5:
            resetAnimation()
            $('#animationname').html('Wandering Eyes')
            animationType4()
            break
        case 6:
            resetAnimation()
            $('#animationname').html('Ear Twitch + Wandering Eyes')
            animationType5()
            break
        case 7:
        resetAnimation()
        $('#animationname').html('Head & Tail Wiggle')
        animationType6()
        break
    }
}

async function normalEyes() {
    await $('.eye').css('border-top', 'none')
    await $('.eye').css('border-bottom', 'none')
    await $('.pupils').css('top', '13px')
    await $('.pupils').css('height', '35px')
    await $('.pupils').css('width','35px')
    await $('.pupils').css('border-bottom', 'none')
    await $('.pupils').css('border-radius','50%')
    await $('.pupils').css('transform', 'none')
    await $('.reflection').css('top', '14px')
    await $('.smaller_reflection').css('top', '25px')
    await $('.reflection').css('left', '31px')
    await $('.smaller_reflection').css('left', '28px')
    await $('.eye').css('z-index', '1')
}
async function eyesType1() {
    await $('.eye').css('border-top', '16px solid #000')
    await $('.eye').css('border-bottom', 'none')
    await $('.pupils').css('top', '0px')
    await $('.pupils').css('height', '33px')
    await $('.pupils').css('width','33px')
    await $('.pupils').css('border-bottom', 'none')
    await $('.pupils').css('border-radius','50%')
    await $('.pupils').css('transform', 'none')
    await $('.reflection').css('top', '8px')
    await $('.smaller_reflection').css('top', '18px')
    await $('.reflection').css('left', '31px')
    await $('.smaller_reflection').css('left', '28px')
    await $('.eye').css('z-index', '1')
}
async function eyesType2() {
    await $('.eye').css('border-top', 'none')
    await $('.eye').css('border-bottom', '24px solid #000')
    await $('.pupils').css('top', '0px', 'width 33px', 'height', '33px')
    await $('.pupils').css('height', '33px')
    await $('.pupils').css('width','33px')
    await $('.pupils').css('border-bottom', '6px solid #000')
    await $('.pupils').css('border-radius','50%')
    await $('.pupils').css('transform', 'none')
    await $('.reflection').css('top', '3px')
    await $('.smaller_reflection').css('top', '13px')
    await $('.reflection').css('left', '31px')
    await $('.smaller_reflection').css('left', '28px')
    await $('.eye').css('z-index', '-1')
}
async function eyesType3() {
    await $('.eye').css('border-top', 'none')
    await $('.eye').css('border-bottom', 'none')
    await $('.pupils').css('top', '8px')
    await $('.pupils').css('height', '35px')
    await $('.pupils').css('width','35px')
    await $('.pupils').css('border-bottom', 'none')
    await $('.pupils').css('border-radius','90% 0')
    await $('.pupils').css('transform', 'rotate(134deg)')
    await $('.pupils').css('left', '9px')
    await $('.reflection').css('top', '14px')
    await $('.smaller_reflection').css('top', '25px')
    await $('.reflection').css('left', '27px')
    await $('.smaller_reflection').css('left', '24px')
    await $('.eye').css('z-index', '1')
}

async function normalmouth() {
    await $('.mouth_left').css('transform', 'rotate(-187deg)')
    await $('.mouth_left').css('width', '36px')
    await $('.mouth_left').css('height', '21px') 
    await $('.mouth_left').css('top', '-213px')
    await $('.mouth_left').css('left', '50px')
    await $('.mouth_left').css('border-radius', '210%/83px 64px 0 0')
    await $('.mouth_left').css('background-color', 'transparent') 
    await $('.mouth_right').css('border', 'solid 4px #000')
    await $('.mouth_right').css('border-color', '#000 transparent transparent transparent')
}
async function mouthType1() {
    await $('.mouth_left').css('transform', 'none')
    await $('.mouth_left').css('width', '44px')
    await $('.mouth_left').css('height', '20px') 
    await $('.mouth_left').css('top', '-212px')
    await $('.mouth_left').css('left', '59px')
    await $('.mouth_left').css('border-radius', '210%/83px 64px 0 0')
    await $('.mouth_left').css('background-color', 'transparent') 
    await $('.mouth_right').css('border', 'none')
    await $('.mouth_right').css('border-color', 'none')
}
async function mouthType2() {
    await $('.mouth_left').css('transform', 'none')
    await $('.mouth_left').css('width', '27px')
    await $('.mouth_left').css('height', '1px') 
    await $('.mouth_left').css('top', '-207px')
    await $('.mouth_left').css('left', '70px')
    await $('.mouth_left').css('border-radius', '210%/83px 64px 0 0')
    await $('.mouth_left').css('background-color', 'transparent') 
    await $('.mouth_right').css('border', 'none')
    await $('.mouth_right').css('border-color', 'none')
}
async function mouthType3() {
    await $('.mouth_left').css('transform', 'none')
    await $('.mouth_left').css('width', '50px')
    await $('.mouth_left').css('height', '36px') 
    await $('.mouth_left').css('top', '-214px')
    await $('.mouth_left').css('left', '57px')
    await $('.mouth_left').css('border-radius', '50% 50% 50% 50%')
    await $('.mouth_left').css('background-color', '#000') 
    await $('.mouth_right').css('border', 'none')
    await $('.mouth_right').css('border-color', 'none')
}

async function normalhairMiddle() {
    await $('.head_hair_middle').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_middle').css('border_radius', '0 0 50% 50%')
    await $('.head_hair_middle').css('width', '14px')
    await $('.head_hair_middle').css('height', '32px')
    await $('.head_hair_middle').css('top', '-119px')
    await $('.head_hair_middle').css('left', '91px')
    await $('.head_hair_middle').css('transform', 'none')  
}
async function hairMiddleType1() {
    await $('.head_hair_middle').css('background-color', 'transparent')
    await $('.head_hair_middle').css('border-radius', '0 0 50% 50%')
    await $('.head_hair_middle').css('width', '14px')
    await $('.head_hair_middle').css('height', '32px')
    await $('.head_hair_middle').css('top', '-119px')
    await $('.head_hair_middle').css('left', '91px')  
    await $('.head_hair_middle').css('transform', 'none')  
}
async function hairMiddleType2() {
    await $('.head_hair_middle').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_middle').css('border-radius', '50% 50% 50% 50%')
    await $('.head_hair_middle').css('width', '23px')
    await $('.head_hair_middle').css('height', '32px')
    await $('.head_hair_middle').css('top', '-119px')
    await $('.head_hair_middle').css('left', '87px')
    await $('.head_hair_middle').css('transform', 'none')  
}
async function hairMiddleType3() {
    await $('.head_hair_middle').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_middle').css('border_radius', '0 0 50% 50%')
    await $('.head_hair_middle').css('width', '14px')
    await $('.head_hair_middle').css('height', '32px')
    await $('.head_hair_middle').css('top', '-147px')
    await $('.head_hair_middle').css('left', '91px')
    await $('.head_hair_middle').css('transform', 'rotate(-180deg)')
}

async function normalhairSides() {
    await $('.head_hair_left').css('transform', 'rotate(20deg)')
    await $('.head_hair_right').css('transform', 'rotate(-28deg)')
    await $('.head_hair_left').css('width', '13px')
    await $('.head_hair_right').css('width', '12px')
    await $('.head_hair_left').css('height', '29px')
    await $('.head_hair_right').css('height', '29px')
    await $('.head_hair_left').css('top', '-94px')
    await $('.head_hair_right').css('top', '-156px')
    await $('.head_hair_left').css('left', '71px')
    await $('.head_hair_right').css('left', '113px')
    await $('.head_hair_left').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_right').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_left').css('border-radius', '67% 0 50% 50%')
    await $('.head_hair_right').css('border-radius', '0 67% 50% 50%')
}
async function hairSidesType1() {
    await $('.head_hair_left').css('transform', 'rotate(20deg)')
    await $('.head_hair_right').css('transform', 'rotate(-28deg)')
    await $('.head_hair_left').css('width', '13px')
    await $('.head_hair_right').css('width', '12px')
    await $('.head_hair_left').css('height', '29px')
    await $('.head_hair_right').css('height', '29px')
    await $('.head_hair_left').css('top', '-94px')
    await $('.head_hair_right').css('top', '-156px')
    await $('.head_hair_left').css('left', '71px')
    await $('.head_hair_right').css('left', '113px')
    await $('.head_hair_left').css('background-color', 'transparent')
    await $('.head_hair_right').css('background-color', 'transparent')
    await $('.head_hair_left').css('border-radius', '67% 0 50% 50%')
    await $('.head_hair_right').css('border-radius', '0 67% 50% 50%')
}
async function hairSidesType2() {
    await $('.head_hair_left').css('transform', 'rotate(45deg)')
    await $('.head_hair_right').css('transform', 'rotate(-44deg)')
    await $('.head_hair_left').css('width', '22px')
    await $('.head_hair_right').css('width', '22px')
    await $('.head_hair_left').css('height', '29px')
    await $('.head_hair_right').css('height', '29px')
    await $('.head_hair_left').css('top', '-94px')
    await $('.head_hair_right').css('top', '-156px')
    await $('.head_hair_left').css('left', '61px')
    await $('.head_hair_right').css('left', '113px')
    await $('.head_hair_left').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_right').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_left').css('border-radius', '50% 50% 50% 50%')
    await $('.head_hair_right').css('border-radius', '50% 50% 50% 50%')
}
async function hairSidesType3() {
    await $('.head_hair_left').css('transform', 'rotate(177deg)')
    await $('.head_hair_right').css('transform', 'rotate(-178deg)')
    await $('.head_hair_left').css('width', '13px')
    await $('.head_hair_right').css('width', '12px')
    await $('.head_hair_left').css('height', '29px')
    await $('.head_hair_right').css('height', '29px')
    await $('.head_hair_left').css('top', '-114px')
    await $('.head_hair_right').css('top', '-175px')
    await $('.head_hair_left').css('left', '76px')
    await $('.head_hair_right').css('left', '108px')
    await $('.head_hair_left').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_right').css('background-color', 'rgb(216, 128, 14)')
    await $('.head_hair_left').css('border-radius', '67% 0 50% 50%')
    await $('.head_hair_right').css('border-radius', '0 67% 50% 50%')
}

function animationType1() {
    resetAnimation()
    $('.head').addClass("movingHead");
    $('.ears').addClass("movingEars");
}

function resetAnimation() {
    $('.head').removeClass("movingHead");
    $('.ears').removeClass("movingEars");
    $('.tail').removeClass("movingTail");
    $('.tail_mask').removeClass("movingTailMask");
    $('.tail_end').removeClass("movingTailEnd");
    $('.ears').removeClass("twitchEars");
    $('.pupils').removeClass("movingEyes");
    $('.reflection').removeClass("movingEyeReflection1");
    $('.smaller_reflection').removeClass("movingEyeReflection2");
}

function animationType2() {
    resetAnimation()
    $('.tail').addClass("movingTail");
    $('.tail_mask').addClass("movingTailMask");
    $('.tail_end').addClass("movingTailEnd");
}

function animationType3() {
    resetAnimation()
    $('.ears').addClass("twitchEars");
}
function animationType4() {
    resetAnimation()
    $('.pupils').addClass("movingEyes");
    $('.reflection').addClass("movingEyeReflection1");
    $('.smaller_reflection').addClass("movingEyeReflection2");
}

function animationType5() {
    resetAnimation()
    $('.pupils').addClass("movingEyes");
    $('.reflection').addClass("movingEyeReflection1");
    $('.smaller_reflection').addClass("movingEyeReflection2");
    $('.ears').addClass("twitchEars");
}
function animationType6() {
    resetAnimation()
    $('.head').addClass("movingHead");
    $('.ears').addClass("movingEars");
    $('.tail').addClass("movingTail");
    $('.tail_mask').addClass("movingTailMask");
    $('.tail_end').addClass("movingTailEnd");
}

    //$('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "48px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    //$('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    //$('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })

animations.css

.movingHead{
    animation: moveHead 5s infinite;
}
.movingEars{
    animation: moveEars 5s infinite;
}

.movingTail{
    animation: moveTail 3s infinite;
}
.movingTailMask{
    animation: moveTailMask 3s infinite;
}
.movingTailEnd{
    animation: moveTailEnd 3s infinite;
}
.twitchEars{
    animation: twitchEars 0.8s infinite;
}
.movingEyes{
    animation: moveEyes 2.5s infinite;
}
.movingEyeReflection1{
    animation: moveEyeReflection1 2.5s infinite;
}
.movingEyeReflection2{
    animation: moveEyeReflection2 2.5s infinite;
}

@keyframes moveHead{
    0%{
        transform: rotate(0deg);
    }
    30%{
        transform: rotate(5deg);

    }
    60%{
        transform: rotate(-5deg);
    }
    100%{
        transform: rotate(0deg);
    }
}

@keyframes moveEars{
    0%{
        left: 0px;
        transform: rotate(0deg);
    }
    30%{
        left: 7px;
        transform: rotate(5deg);
    }
    60%{
        left: -7px;
        transform: rotate(-5deg);

    }
    100%{
        left: 0px;
        transform: rotate(0deg);

    }
}

@keyframes moveTail{
    0%{
      top: 112px
    }
    30%{
        top: 122px
    }
    60%{
        top: 102px

    }
    100%{
        top: 112px

    }
}
@keyframes moveTailMask{
    0%{
        top: 133px
      }
      30%{
          top: 142px
      }
      60%{
          top: 123px
  
      }
      100%{
          top: 133px
  
      }
}
@keyframes moveTailEnd{
    0%{
        top: 178.15px
      }
      30%{
          top: 188.15px
      }
      60%{
          top: 168.15px
  
      }
      100%{
          top: 178.15px
  
      }
}
@keyframes twitchEars{
    0%{
        top: 0px
      }
      50%{
        top: 4px
      }
      100%{
        top: 0px
      }
}
@keyframes moveEyes{
    0%{
        left: 12px
      }
      50%{
        left: 3px
      }
      100%{
        left: 12px
      }
}
@keyframes moveEyeReflection1{
    0%{
        left: 31px
      }
      50%{
        left: 8px
      }
      100%{
        left: 31px
      }
}
@keyframes moveEyeReflection2{
    0%{
        left: 28px
      }
      50%{
        left: 17px
      }
      100%{
        left: 28px
      }

catSettings.js

var colors = Object.values(allColors())

var defaultDNA = {

    "headcolor" : 10,

    "tailcolor" : 10,

    "eyecolor" : 96,

    "earcolor" : 10,

    "bellycolor" : 81,

    //Cattributes

    "eyeShape" : 1,

    "mouthShape" : 1,

    "HairMiddle" : 1,

    "HairSides" : 1,

    "Animation" : 1,

    "lastNum" :  1,

    }

// when page load

$( document ).ready(function() {

  $('#dnabody').html(defaultDNA.headcolor);

  $('#dnatail').html(defaultDNA.mouthcolor);

  $('#dnaeyes').html(defaultDNA.eyescolor);

  $('#dnaears').html(defaultDNA.earcolor);

  $('#dnabelly').html(defaultDNA.bellycolor);

  $('#dnaeyeshape').html(defaultDNA.eyeShape)

  $('#dnamouthshape').html(defaultDNA.mouthShape)

  $('#dnahairMiddle').html(defaultDNA.HairMiddle)

  $('#dnahairSides').html(defaultDNA.HairSides)

  $('#dnaanimation').html(defaultDNA.Animation)

  $('#dnaspecial').html(defaultDNA.lastNum)

  renderCat(defaultDNA)

});

function getDna(){

    var dna = ''

    dna += $('#dnabody').html()

    dna += $('#dnatail').html()

    dna += $('#dnaeyes').html()

    dna += $('#dnaears').html()

    dna += $('#dnabelly').html()

    dna += $('#dnaeyeshape').html()

    dna += $('#dnamouthshape').html()

    dna += $('#dnahairMiddle').html()

    dna += $('#dnahairSides').html()

    dna += $('#dnaanimation').html()

    dna += $('#dnaspecial').html()

    return parseInt(dna)

}

function renderCat(dna){

    headColor(colors[dna.headcolor],dna.headcolor)

    $('#bodycolor').val(dna.headcolor)

    tailColor(colors[dna.tailcolor],dna.tailcolor)

    $('#tailcolor').val(dna.tailcolor)

    earColor(colors[dna.earcolor],dna.earcolor)

    $('#earcolor').val(dna.earcolor)

    eyeColor(colors[dna.eyecolor],dna.eyecolor)

    $('#eyecolor').val(dna.eyecolor)

    bellyColor(colors[dna.bellycolor],dna.bellycolor)

    $('#bellycolor').val(dna.bellycolor)

    eyeVariation(dna.eyeShape)

    $('#eyeshape').val(dna.eyeShape)

    mouthVariation(dna.mouthShape)

    $('#mouthshape').val(dna.mouthShape)

    hairMiddleVariation(dna.HairMiddle)

    $('#hairMiddle').val(dna.HairMiddle)

    hairSidesVariation(dna.HairSides)

    $('#hairSides').val(dna.HairSides)

    animationVariation(dna.Animation)

    $('animation').val(dna.Animation)

}

// Changing cat colors

$('#bodycolor').change(()=>{

    var colorVal = $('#bodycolor').val()

    headColor(colors[colorVal],colorVal)

})

$('#tailcolor').change(()=>{

  var colorVal = $('#tailcolor').val()

  tailColor(colors[colorVal],colorVal)

})

$('#earcolor').change(()=>{

  var colorVal = $('#earcolor').val()

  earColor(colors[colorVal],colorVal)

})

$('#eyecolor').change(()=>{

  var colorVal = $('#eyecolor').val()

  eyeColor(colors[colorVal],colorVal)

})

$('#bellycolor').change(()=>{

  var colorVal = $('#bellycolor').val()

  bellyColor(colors[colorVal],colorVal)

})

$('#eyeshape').change(()=>{

  var shape = parseInt($('#eyeshape').val())

 eyeVariation(shape)

})

$('#mouthshape').change(()=>{

  var shape = parseInt($('#mouthshape').val())

 mouthVariation(shape)

})

$('#hairMiddle').change(()=>{

  var shape = parseInt($('#hairMiddle').val())

 hairMiddleVariation(shape)

})

$('#hairSides').change(()=>{

  var shape = parseInt($('#hairSides').val())

 hairSidesVariation(shape)

})

$('#animation').change(()=>{

  var animation = parseInt($('#animation').val())

 animationVariation(animation)

})
2 Likes

Dancing Cat!
toGif

animation.css

.movingHead{
animation: moveHead 2s infinite;
}

.movingTail{
    animation: moveHead 7s infinite;
}

.movingEars{
    animation: headBob 5s infinite;
}

.movingDance{
    animation: Dance 1.1s infinite;
}

.movingBob{
    animation: headBob 1.1s infinite;
}

.movingBobFlipped{
    animation: headBobFlipped 1.1s infinite;
}

@keyframes moveHead{
    0%{
        transform: rotate(0deg);
    }
    25%{
        transform: rotate(5deg);
    }
    75%{
        transform: rotate(-5deg);
    }
    100%{
        transform: rotate(0deg);
    }
}

@keyframes headBob{
    0%{
        transform: scale(1.08,1.08);
    }
    25%{
        transform: scale(1,1);
  
    }
    50%{
        transform: scale(1.08,1.08);
  
    }
    75%{
        transform: scale(1,1);
  
    }
    100%{
        transform: scale(1.08,1.08);
    }
    
}

@keyframes headBobFlipped{
    0%{
        transform: scale(-1.08,1.08);
    }
    25%{
        transform: scale(-1,1);
  
    }
    50%{
        transform: scale(-1.08,1.08);
  
    }
    75%{
        transform: scale(-1,1);
  
    }
    100%{
        transform: scale(-1.08,1.08);
    }
    
}

@keyframes Dance{
    0%{
        transform: rotate(-36deg) rotateX(0deg);
        top: 0px;
        left: -7px;
    }
    50%{
        transform: rotate(-36deg) rotateX(-180deg);
        top: -60px;
        left: -47px;
  
    }
    100%{
        transform: rotate(-36deg) rotateX(0deg);
        top: 0px;
        left: -7px;
    }
}

New functions



function animationType(num) {

    $('#dnaanimation').html(num)
    switch (num) {
        case 1:
            $('#animationcode').html('Move Head')
            animationType1()
            break

        case 2:
            $('#animationcode').html('Move Ears')
            animationType2()
            break

        case 3:
            $('#animationcode').html('Move Tail')
            animationType3()
            break
            
        case 4:
            $('#animationcode').html('Dance')
            animationType4()
            break

        default:
            $('#animationcode').html('Move Head')
            animationType1()
            break
    }
}


function animationType1(){
    resetAnimation();
    $(".cat_head").addClass("movingHead");
}
function animationType2(){
    resetAnimation();
    $(".cat_ears").addClass("movingEars");
   
}
function animationType3(){
    resetAnimation();
    $(".cat_tail").addClass("movingTail");
}
function animationType4(){
    resetAnimation();
    $("#front_right_foot").addClass("movingDance");
    $(".cat_head").addClass("movingBob");
    $(".cat_head_border").addClass("movingBob");
    $("#cat_ear_border_right").addClass("movingBobFlipped");
    $("#cat_ear_border_left").addClass("movingBob");
  
}

function resetAnimation(){
    $(".cat_head").removeClass("movingHead");
    $(".cat_ears").removeClass("movingEars");
    $(".cat_tail").removeClass("movingTail");
    $("#front_right_foot").removeClass("movingDance");
    $(".cat_head").removeClass("movingBob");
    $(".cat_head_border").removeClass("movingBob");
    $("#cat_ear_border_right").removeClass("movingBobFlipped");
    $("#cat_ear_border_left").removeClass("movingBob");
    
}
3 Likes

Heya!
Here’s my git link for the repo

animation2

3 Likes

Here’s mine!
image

index.html
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Academy kitties </title>
  <script type="text/javascript" src="assets/js/jquery-3.4.1.js"></script>
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  <script src="assets/bootstrap/js/popper.js"></script>
  <script src="assets/bootstrap/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="assets/css/mystyle.css">
  <link rel="stylesheet" href="assets/css/style.css">
  <link rel="stylesheet" href="assets/css/cats.css">
  <link rel="stylesheet" href="assets/css/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
  <link rel="stylesheet" href="assets/css/animations.css">
</head>
  <body>
    <div class="container p-5" style="margin-top: 12vh;margin-bottom: 10vh;">
        <div align="center">
        <h1 class="c-white">Kitties-Factory</h1>
        <p class="c-white">Create your custom Kitty</p>
    </div>
        <div class="row">
            <div class="col-lg-4 catBox m-2 light-b-shadow">
                <div class="cat">
                    <div class="ears">
                        <div class="ear left_ear"></div>
                        <div class="ear right_ear"></div>
                    </div>
                    <div class="inner_ears">
                        <div class="inner left_iear"></div>
                        <div class="inner right_iear"></div>
                    </div>
                    <div id="catHead">
                        <div class="eyes">
                            <div class="eye">
                                <div class="pupils"></div>
                            </div>
                            <div class="eye">
                                <div class="pupils"></div>
                            </div>
                        </div>
                        <div class="mandible"></div>
                        <div class="nose_and_mouth"></div>
                        <div class="cheeks">
                            <div class="cheek"></div>
                            <div class="cheek"></div>
                        </div>
                    </div>
                    <div class="torso"></div>
                    <div class="paws">
                        <div class="paw"></div>
                        <div class="paw"></div>
                    </div>
                    <div class="tail"></div>
                </div>
                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnamouth"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnaears"></span>
                        
                         <!-- Cattributes -->
                         <span id="dnashape"></span>
                         <span id="dnapaws"></span>
                         <span id="dnacie"></span>
                         <span id="dnamn"></span>
                         <span id="dnaanimation"></span>
                         <span id="dnaspecial"></span>
                    </b>
                </div>
            </div>
            <div class="col-lg-7 cattributes m-2 light-b-shadow">

                <!-- Cat colors -->
                <div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Color: Head and body</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bodycolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Color: Mandible, paws and tail</b><span class="badge badge-dark ml-2" id="mptcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="mptcolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Color: Eyes</b><span class="badge badge-dark ml-2" id="eyecode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="eyecolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Color: Ears</b><span class="badge badge-dark ml-2" id="earcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="earcolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Eye shape</b><span class="badge badge-dark ml-2" id="eyeName"></span></label>
                    <input type="range" min="1" max="3" class="form-control-range" id="eyeshape">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Paw height & Tail position</b><span class="badge badge-dark ml-2" id="pawname"></span></label>
                    <input type="range" min="1" max="3" class="form-control-range" id="pawheight">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Color: Cheeks and Inner Ears</b><span class="badge badge-dark ml-2" id="ciecode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="ciecolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Color: Mouth and Nose</b><span class="badge badge-dark ml-2" id="mncode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="mncolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Animation</b><span class="badge badge-dark ml-2" id="animcode"></span></label>
                    <input type="range" min="1" max="5" class="form-control-range" id="anim">
                </div>
            </div>

            </div>

            </div>
            <br>

        </div>



    </div>
    <footer align="left">
        <p>Ivan on Tech Academy Bootcamp July 2020</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>

</html>
catFactory.js
//Random color

function getColor() {

    var randomColor = Math.floor(Math.random() * 16777215).toString(16);

    return randomColor

}

function genColors(){

    var colors = []

    for(var i = 10; i < 99; i ++){

      var color = getColor()

      colors[i] = color

    }

    return colors

}

//This function code needs to modified so that it works with Your cat code.

function headColor(color,code) {

    $('#catHead, .torso').css('background', '#' + color)  //This changes the color of the cat

    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider

    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat

}

function mptColorF(color,code) {

    $('.mandible, .paw, .tail').css('background', '#' + color)

    $('#mptcode').html('code: '+code)

    $('#dnamouth').html(code)

}

function eyeColorF(color,code) {

    $('.eye').css('background', '#' + color)

    $('#eyecode').html('code: '+code)

    $('#dnaeyes').html(code)

}

function earColorF(color,code) {

    $('.ear').css('background', '#' + color)

    $('#earcode').html('code: '+code)

    $('#dnaears').html(code)

}

function cieColorF(color,code) {

    $('.cheek, .inner').css('background', '#' + color)

    $('#ciecode').html('code: '+code)

    $('#dnacie').html(code)

}

function mnColorF(color,code) {

    $('.nose_and_mouth').css('background', '#' + color)

    $('#mncode').html('code: '+code)

    $('#dnamn').html(code)

}

//###################################################

//Functions below will be used later on in the project

//###################################################

function eyeVariation(num) {

    $('#dnashape').html(num)

    switch (num) {

        case 1:

            normalEyes()

            $('#eyeName').html('Basic')

            break

        case 2:

            normalEyes()

            $('#eyeName').html('Cool')

            eyesType2()

            break

        case 3:

            normalEyes()

            $('#eyeName').html('Sweet')

            eyesType3()

            break

    }

}

function pawVariation(num) {

    $('#dnapaws').html(num)

    switch (num) {

        case 1:

            $('#pawname').html('Short')

            shortpaws()

            break

        case 2:

            $('#pawname').html('Medium')

            normalpaws()

            break

        case 3:

            $('#pawname').html('Long')

            longpaws()

            break

    }

}

async function normalEyes() {

    await $('.eye').css('height', '40px')

}

async function eyesType2() {

    await $('.eye').css('height', '35px')

}

async function eyesType3() {

    await $('.eye').css('height', '45px')

}

async function normalpaws() {

    $('.paw').css('height', '60px')

}

async function shortpaws() {

    $('.paw').css('height', '50px')

}

async function longpaws() {

    $('.paw').css('height', '70px')

}

function animationVariation(num) {

    $('#dnaanimation').html(num)

    resetAnimation();

    switch (num) {

        case 1:

            $('#animcode').html('None')

            break

        case 2:

            $('#animcode').html('Move Face')

            animationType1()

            break

        case 3:

            $('#animcode').html('Lift Paws')

            animationType2()

            break

        case 4:

            $('#animcode').html('Look down')

            animationType3()

            break

        case 5:

            $('#animcode').html('Stick out tonge')

            animationType4()

            break

    }

}

function animationType1(){

    $("#catHead").addClass("movingHead");

}

function animationType2(){

    $(".paws").addClass("movingPaws")

}

function animationType3(){

    $(".pupils").addClass("movingPupils")

}

function animationType4(){

    $(".nose_and_mouth").addClass("stickingOutTonge")

}

function resetAnimation(){

    $("#catHead").removeClass("movingHead");

    $(".paws").removeClass("movingPaws");

    $(".pupils").removeClass("movingPupils");

    $(".nose_and_mouth").removeClass("stickingOutTonge");

}
catSettings.js
var colors = Object.values(allColors())

var defaultDNA = {

    "headcolor" : 10,

    "mptcolor" : 36,

    "eyecolor" : 68,

    "earcolor" : 10,

    //Cattributes

    "eyesShape" : 1,

    "pawHeight" : 2,

    "ciecolor" : 13,

    "mncolor" : 75,

    "animation" : 1,

    "lastNum" :  1

    }

// when page load

$( document ).ready(function() {

  $('#dnabody').html(defaultDNA.headcolor);

  $('#dnamouth').html(defaultDNA.mptcolor);

  $('#dnaeyes').html(defaultDNA.eyecolor);

  $('#dnaears').html(defaultDNA.earcolor); 

    

   $('#dnashape').html(defaultDNA.eyesShape)

   $('#dnapaws').html(defaultDNA.pawHeight)

   $('#dnacie').html(defaultDNA.decorationMidcolor)

   $('#dnamn').html(defaultDNA.decorationSidescolor)

   $('#dnaanimation').html(defaultDNA.animation)

   $('#dnaspecial').html(defaultDNA.lastNum)

  renderCat(defaultDNA)

});

function getDna(){

    var dna = ''

    dna += $('#dnabody').html()

    dna += $('#dnamouth').html()

    dna += $('#dnaeyes').html()

    dna += $('#dnaears').html()

    dna += $('#dnashape').html()

    dna += $('#dnapaws').html()

    dna += $('#dnacie').html()

    dna += $('#dnamn').html()

    dna += $('#dnaanimation').html()

    dna += $('#dnaspecial').html()

    return parseInt(dna)

}

function renderCat(dna){

    headColor(colors[dna.headcolor],dna.headcolor)

    $('#bodycolor').val(dna.headcolor)

    mptColorF(colors[dna.mptcolor],dna.mptcolor)

    $('#mptcolor').val(dna.mptcolor)

    eyeColorF(colors[dna.eyecolor],dna.eyecolor)

    $('#eyecolor').val(dna.eyecolor)

    earColorF(colors[dna.earcolor],dna.earcolor)

    $('#earcolor').val(dna.earcolor)

    eyeVariation(dna.eyesShape)

    $('#eyesShape').val(dna.eyesShape)

    pawVariation(dna.pawHeight)

    $('#pawHeight').val(dna.pawHeight)

    cieColorF(colors[dna.ciecolor],dna.ciecolor)

    $('#ciecolor').val(dna.ciecolor)

    mnColorF(colors[dna.mncolor],dna.mncolor)

    $('#mncolor').val(dna.mncolor)

    animationVariation(dna.animation)

    $('#anim').val(dna.animation)

}

// Changing cat colors

$('#bodycolor').change(()=>{

    var colorVal = $('#bodycolor').val()

    headColor(colors[colorVal],colorVal)

})

$('#mptcolor').change(()=>{

  var colorVal = $('#mptcolor').val()

  mptColorF(colors[colorVal],colorVal)

})

$('#eyecolor').change(()=>{

  var colorVal = $('#eyecolor').val()

  eyeColorF(colors[colorVal],colorVal)

})

$('#earcolor').change(()=>{

  var colorVal = $('#earcolor').val()

  earColorF(colors[colorVal],colorVal)

})

$('#eyeshape').change(()=>{

  var shape = parseInt($('#eyeshape').val())

  eyeVariation(shape)

})

$('#pawheight').change(()=>{

  var height = parseInt($('#pawheight').val())

  pawVariation(height)

})

$('#ciecolor').change(()=>{

  var colorVal = $('#ciecolor').val()

  cieColorF(colors[colorVal],colorVal)

})

$('#mncolor').change(()=>{

  var colorVal = $('#mncolor').val()

  mnColorF(colors[colorVal],colorVal)

})

$('#anim').change(()=>{

  var animationVal = parseInt($('#anim').val())

  animationVariation(animationVal)

})
animations.css
.movingHead{

    animation: moveHead 2s infinite;

}

@keyframes moveHead{

    0% {

        transform: rotate(0deg);

    }

    30% {

        transform: rotate(5deg);

    }

    60% {

        transform: rotate(-5deg);

    }

    100% {

        transform: rotate(0deg);

    }

}

.movingPaws{

    animation: movePaws 2s infinite;

}

@keyframes movePaws{

    0% {

        top: -150px;

    }

    50% {

        top: -180px;

    }

    100% {

        top: -150px;

    }

}

.movingPupils{

    animation: movePupils 2s infinite;

}

@keyframes movePupils{

    0% {

        top: 10px;

    }

    50% {

        top: 13px;

    }

    100% {

        top: 10px;

    }

}

.stickingOutTonge{

    animation: stickOutTonge 2s infinite;

}

@keyframes stickOutTonge{

    0% {

        top: -185px;

    }

    50% {

        top: -180px;

    }

    100% {

        top: -185px;

    }

}
1 Like

For some reason could not get the head animation.

html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Academy kitties </title>
  <script type="text/javascript" src="assets/js/jquery-3.4.1.js"></script>
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  <script src="assets/bootstrap/js/popper.js"></script>
  <script src="assets/bootstrap/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="assets/css/animations.css">
  <link rel="stylesheet" href="assets/css/mystyle.css">
  <link rel="stylesheet" href="assets/css/cats.css">
  <link rel="stylesheet" href="assets/css/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
</head>
  <body>
    <div class="container p-5" style="margin-top: 12vh;margin-bottom: 10vh;">
        <div align="center">
        <h1 class="c-white">Kitties-Factory</h1>
        <p class="c-white">Create your custom Kitty</p>
    </div>
        <div class="row">
            <div class="col-lg-4 catBox m-2 light-b-shadow">
                <div class="cat">
                    <div class="cat__ear">
                        <div id="leftEar" class="cat__ear--left">
                            <div class="cat__ear--left-inside"></div>
                        </div>
                        <div id="rightEar" class="cat__ear--right">
                            <div class="cat__ear--right-inside"></div>
                        </div>
                    </div>

                    <div id="head" class="cat__head">
                        <div id="midDotColor1" class="cat__head-dots">
                            <div id="leftDot" class="cat__head-dots_first"></div>
                            <div id="rightDot" class="cat__head-dots_second"></div>
                        </div>
                        <div class="cat__eye">
                            <div class="cat__eye--left">
                                <span class="pupil-left"></span>
                            </div>
                            <div class="cat__eye--right">
                                <span class="pupil-right"></span>
                            </div>
                        </div>
                        <div class="cat__nose"></div>

                        <div class="cat__mouth-contour"></div>
                        <div class="cat__mouth-left"></div>
                        <div class="cat__mouth-right"></div>

                        <div class="cat__whiskers-left"></div>
                        <div class="cat__whiskers-right"></div>
                    </div>

                    <div class="cat__body">

                        <div class="cat__chest"></div>

                        <div class="cat__chest_inner"></div>


                        <div class="cat__paw-left"></div>
                        <div class="cat__paw-left_inner"></div>


                        <div class="cat__paw-right"></div>
                        <div class="cat__paw-right_inner"></div>


                        <div id="tail" class="cat__tail"></div>
                    </div>
                </div>
                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnamouth"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnaears"></span>
                         <span id="dnamidDot"></span>
                        
                         <!-- Cattributes -->
                         <span id="dnashape"></span>
                         <span id="dnadecoration"></span>
                         <span id="dnadecorationMid"></span>
                         <span id="dnadecorationSides"></span>
                         <span id="dnadanimation"></span>
                         <span id="dnaspecial"></span>
                    </b>
                </div>
            </div>
            <div class="col-lg-7 cattributes m-2 light-b-shadow">

<!-- Cat colors -->
<div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Head and body</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bodycolor">
                    </div>
                    <div class="form-group">
                        <label for="formControlRange"><b>Eyes</b><span class="badge badge-dark ml-2" id="eyescode"></span></label>
                        <input type="range" min="10" max="98" class="form-control-range" id="eyescolor">
                    </div>
                    <div class="form-group">
                        <label for="formControlRange"><b>Ears</b><span class="badge badge-dark ml-2" id="earscode"></span></label>
                        <input type="range" min="10" max="98" class="form-control-range" id="earscolor">
                    </div>
                    <div class="form-group">
                        <label for="formControlRange"><b>Mouth</b><span class="badge badge-dark ml-2" id="mouthcode"></span></label>
                        <input type="range" min="10" max="98" class="form-control-range" id="mouthcolor">
                    </div>
                    <div class="form-group">
                        <label for="formControlRange"><b>Eyeshape</b><span class="badge badge-dark ml-2" id="eyeshapecode"></span></label>
                        <input type="range" min="1" max="7" class="form-control-range" id="eyeshape">
                    </div>
                    <div class="form-group">
                        <label for="formControlRange"><b>decoration Style</b><span class="badge badge-dark ml-2" id="midDot"></span></label>
                        <input type="range" min="1" max="7" class="form-control-range" id="midDotstyle">
            </div>
                    <div class="form-group">
                <label for="formControlRange"><b>decorationMid Color - middle</b><span class="badge badge-dark ml-2" id="middleDot"></span></label>
                <input type="range" min="10" max="98" class="form-control-range" id="midDotColor1">
            </div>

            <div class="form-group">
                <label for="formControlRange"><b> Color - sides</b><span class="badge badge-dark ml-2" id="sidesmidDot"></span></label>
                <input type="range" min="10" max="98" class="form-control-range" id="midDotColor2">
            </div>

            <div class="form-group">
                <label for="formControlRange"><b>Animation</b><span class="badge badge-dark ml-2" id="animationt"></span></label>
                <input type="range" min="1" max="7" class="form-control-range" id="animation">
            </div>

            </div>
            <br>

        </div>



    </div>
    <footer align="left">
        <p>Ivan on Tech Academy Bootcamp July 2020</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>

</html>

Animations.css

.movingHead{
    animation: moveHead 5s infinite;
}

@keyframes moveHead{
    0% {
         transform: rotate(0deg);
     }
     30% {
         transform: rotate(5deg);
     }
     60% {
         transform: rotate(-5deg);
     }
     100% {
         transform: rotate(0);
     }
}

catSettings


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 96,
    "earsColor" : 10,
    "eyesShape" : 1,
    "decorationPattern" : 1,
    "decorationMidcolor" : 13,
    "decorationSidescolor" : 13,
    "animation" :  1,
    "lastNum" :  1
    }

// when page load
$( document ).ready(function() {
  $('#dnabody').html(defaultDNA.headColor);
  $('#dnamouth').html(defaultDNA.mouthColor);
  $('#dnaeyes').html(defaultDNA.eyesColor);
  $('#dnaears').html(defaultDNA.earsColor);
    
  $('#dnashape').html(defaultDNA.eyesShape)
  $('#dnadecoration').html(defaultDNA.decorationPattern)
  $('#dnadecorationMid').html(defaultDNA.decorationMidcolor)
  $('#dnadecorationSides').html(defaultDNA.decorationSidescolor)
  $('#dnaanimation').html(defaultDNA.animation)
  $('#dnaspecial').html(defaultDNA.lastNum)

  renderCat(defaultDNA)
});

function getDna(){
    var dna = ''
    dna += $('#dnabody').html()
    dna += $('#dnamouth').html()
    dna += $('#dnaeyes').html()
    dna += $('#dnaears').html()
    dna += $('#dnashape').html()
    dna += $('#dnadecoration').html()
    dna += $('#dnadecorationMid').html()
    dna += $('#dnadecorationSides').html()
    dna += $('#dnaanimation').html()
    dna += $('#dnaspecial').html()

    return parseInt(dna)
}

function renderCat(dna){
    headColor(colors[dna.headColor],dna.headColor)
    $('#headcolor').val(dna.headColor)
    mouthAndBelly(colors[dna.mouthColor],dna.mouthColor)
    $('#mouthcolor').val(dna.mouthColor)
    eyeColor(colors[dna.eyesColor],dna.eyesColor)
    $('#eyecolor').val(dna.eyesColor)
    earsAndPaw(colors[dna.earsColor],dna.earsColor)
    $('#earcolor').val(dna.earsColor)
    eyeVariation(dna.eyesShape)
    $('#eyeshape').val(dna.eyesShape)
    decorationVariation(dna.decorationPattern)
    $('#decoration').val(dna.decorationPattern)
    midColor(colors[dna.decorationMidcolor], dna.decorationMidcolor)
    $('#decorationmiddle').val(dna.decorationMidcolor)
    sidesColor(colors[dna.decorationSidescolor], dna.decorationSidescolor)
    $('#decorationsides').val(dna.decorationSidescolor)
    animationVariation(dna.animation)
    $('#animationvariation').val(dna.animation)



  
}

// Changing cat colors
$('#bodycolor').change(()=>{
    var colorVal = $('#bodycolor').val()
    headColor(colors[colorVal],colorVal)
})
$('#eyescolor').change(()=>{
  var colorVal = $('#eyescolor').val()
  eyesColor(colors[colorVal],colorVal)
})
$('#earscolor').change(()=>{
  var colorVal = $('#earscolor').val()
  earsColor(colors[colorVal],colorVal)
})
$('#mouthcolor').change(()=>{
  var colorVal = $('#mouthcolor').val()
  mouthColor(colors[colorVal],colorVal)
})
$('#decorationcolor').change(()=>{
  var colorVal = $('decorationcolor').val()
  decorationColor(colors[colorVal],colorVal)
})
$('#decorationMidColor1').change( () => {
  var colorVal = $('#decorationMidColor1').val()
  decorationMidColor1(colors[colorVal], colorVal)
})

$('#decorationSides').change( () => {
  var colorVal = $('#decorationSides').val()
  decorationSides(colors[colorVal], colorVal)
})
$('#animation').change( () => {
  var colorVal = parseInt( $('#animation').val())
  animationVariation(animationVal)
})

//Changing cat designs
$('#eyeshape').change( () => {
  var shape = parseInt($('#eyeshape').val())
  eyeVariation(shape)
})

$('#decoration').change( () => {
  var style = parseInt($('#decoration').val())
  decoration(style)
})

catFactory


//Random color
function getColor() {
    var randomColor = Math.floor(Math.random() * 16777215).toString(16);
    return randomColor
}

function genColors(){
    var colors = []
    for(var i = 10; i < 99; i ++){
      var color = getColor()
      colors[i] = color
    }
    return colors
}

//This function code needs to modified so that it works with Your cat code.
function headColor(color,code) {
    $('.cat__head, .cat__chest').css('background', '#' + color)  //This changes the color of the cat
    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat
}
function eyesColor(color,code) {
    $('.cat__eye--left, .cat__eye--right').css('background', '#' + color)  //This changes the color of eyes
    $('#eyescode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function earsColor(color,code) {
    $('.cat__ear--left, .cat__ear--right').css('background', '#' + color)  //This changes the color of eyes
    $('#earscode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaears').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function mouthColor(color,code) {
    $('.cat__mouth-contour').css('background', '#' + color)  //This changes the color of mouth
    $('#mouthcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnamouth').html(code) //This updates the body color part of the DNA that is displayed below the cat
}



//###################################################
//Functions below will be used later on in the project
//###################################################
function animationVariation(num){
    $('#dnaanimation').html(num);
    switch (num) {
        case 1:
            animationType1();
            break;
        case 2:
            animationType2();
            break;
        
    }
}

function animationType1(){
    requestAnimation();
    $("#head").addClass("movingHead");
}

function resetAnimation(){
    $("#head").removeclass("movingHead");
    //add any animation class that you create
}



function eyeVariation(num) {

    $('#dnashape').html(num)
    switch (num) {
        case 1:
            normalEyes()
            $('#eyeName').html('Basic') //Set the badge for "Basic"
            break
            case 2:
                normalEyes()
                $('#eyeName').html('Chill')
                return eyesType1()
                break
   }
    }
    
function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

async function normalEyes() {
      $('.cat__eye').find('span').css('border', 'none')
}
async function eyesType1() {
    await $('.cat__eye').find('span').css('border-top', '15px solid')
}

async function eyesType2() {
    await $('.cat__eye').find('span').css('border-left', '15px solid')
}

async function normaldecoration() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    $('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "48px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

HTML

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Academy kitties </title>
  <script type="text/javascript" src="assets/js/jquery-3.4.1.js"></script>
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  <script src="assets/bootstrap/js/popper.js"></script>
  <script src="assets/bootstrap/js/bootstrap.min.js"></script>
 
  <link rel="stylesheet" href="assets/css/animations.css">
  <link rel="stylesheet" href="assets/css/mystyle.css">
  <link rel="stylesheet" href="assets/css/cats.css">
  <link rel="stylesheet" href="assets/css/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
</head>
  <body>
    <div class="container p-5" style="margin-top: 12vh;margin-bottom: 10vh;">
        <div align="center">
        <h1 class="c-white">Crypto-Kitties-Factory</h1>
        <p class="c-white">Create your custom Crypto-Kitty</p>
    </div>
        <div class="row">
            <div class="col-lg-4 catBox m-2 light-b-shadow">
                <div class="cat">
                    <div id="catEars" class="cat__ear">
                        <div id="leftEar" class="cat__ear--left">
                            <div class="cat__ear--left-inside"></div>
                        </div>
                        <div id="rightEar" class="cat__ear--right">
                            <div class="cat__ear--right-inside"></div>
                        </div>
                    </div>

                    <div id="head" class="cat__head">
                        <div id="midDot" class="cat__head-dots">
                            <div id="leftDot" class="cat__head-dots_first"></div>
                            <div id="rightDot" class="cat__head-dots_second"></div>
                        </div>
                        <div id="catEyes" class="cat__eye">
                            <div class="cat__eye--left">
                                <span class="pupil-left"></span>
                            </div>
                            <div class="cat__eye--right">
                                <span class="pupil-right"></span>
                            </div>
                        </div>
                        <div class="cat__nose"></div>

                        <div class="cat__mouth-contour"></div>
                        <div class="cat__mouth-left"></div>
                        <div class="cat__mouth-right"></div>

                        <div id="whiskLeft"  class="cat__whiskers-left"></div>
                        <div id="whiskRight" class="cat__whiskers-right"></div>
                    </div>

                    <div class="cat__body">

                        <div class="cat__chest"></div>

                        <div class="cat__chest_inner"></div>


                        <div class="cat__paw-left"></div>
                        <div class="cat__paw-left_inner"></div>


                        <div id="pawRIGHT" class="cat__paw-right"></div>
                        <div id="pawRIGHTINNER"  class="cat__paw-right_inner"></div>


                        <div id="tail" class="cat__tail"></div>
                    </div>
                </div>
                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnamouth"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnaears"></span>
                        
                         <!-- Cattributes -->
                         <span id="dnashape"></span>
                         <span id="dnadecoration"></span>
                         <span id="dnadecorationMid"></span>
                         <span id="dnadecorationSides"></span>
                         <span id="dnadanimation"></span>
                         <span id="dnaspecial"></span>
                    </b>
                </div>
            </div>
            <div class="col-lg-7 cattributes m-2 light-b-shadow">

<!-- Cat colors -->
<div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Head and body</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bodycolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Eyes</b><span class="badge badge-dark ml-2" id="eyescode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="eyescolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Ears</b><span class="badge badge-dark ml-2" id="earscode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="earscolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Mouth</b><span class="badge badge-dark ml-2" id="mouthcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="mouthcolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Eyes shape</b><span class="badge badge-dark ml-2" id="eyeName"></span></label>
                    <input type="range" min="1" max="7" class="form-control-range" id="eyeshape">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Decorative Patern</b><span class="badge badge-dark ml-2" id="decorationName"></span></label>
                    <input type="range" min="1" max="7" class="form-control-range" id="decorationpattern">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Decoration Mid Color</b><span class="badge badge-dark ml-2" id="midcolorcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="decorationmid">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Decoration Sides Color</b><span class="badge badge-dark ml-2" id="sidecolorcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="decorationsides">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Animations</b><span class="badge badge-dark ml-2" id="animationName"></span></label>
                    <input type="range" min="1" max="6" class="form-control-range" id="animation">
                </div>
            </div>

            </div>

            </div>
            <br>

        </div>



    </div>
    <footer align="left">
        <p>Michael McClimon's Defi Project July 2021</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>

</html>

animations.css

.movingHead {
    animation: moveHead 2s infinite;
}

@keyframes moveHead {
    0% {
        transform: rotate(0deg);
    }
    33% {
        transform: rotate(7deg);
    }
    66% {
        transform: rotate(-7deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.movingEyes {
    animation: moveEyes 2s infinite;
}

@keyframes moveEyes {
    0% {
        left: -32px;
    }
    33% {
        left: 0px;
    }
    66% {
        left: -50px;
    }
    100% {
        left: -32px;
    }
}

.earScale {
    animation: bigEars 4s infinite;
}

@keyframes bigEars {
    0% {
        transform: scale(1);
        left: 0px;
    }
    50% {
        transform: scale(1.3);
        left: 15px;
    }
    100% {
        transform: scale(1);
        left: 0px;
    }
}

.tailWig {
    animation: wiggelyTail 1s infinite;
}

@keyframes wiggelyTail {
    0% {
        transform: skewY(0deg)
    }
    33% {
        transform: skewY(20deg)
    }
    90%{
        transform: skewY(-20deg)
    }
    100% {
        transform: skewY(0deg)
    }
}

.whiskShake {
    animation: shakeWhisks 1.5s infinite;
}

@keyframes shakeWhisks {
    0% {
        transform: skewY(0deg)
    }
    33% {
        transform: skewY(8deg)
    }
    90%{
        transform: skewY(-8deg)
    }
    100% {
        transform: skewY(0deg)
    }
}

.sayHello {
    animation: wink 1s infinite;
}

@keyframes wink {
    0% {
        transform: rotate(0deg)
    }
    33% {
        transform: rotate(35deg)
    }
    90%{
        transform: rotate(-35deg)
    }
    100% {
        transform: rotate(0deg)
    }
}
.midDotSpinning {
    animation: midDotSpinning 2s infinite;
}

@keyframes midDotSpinning {
    0% {
        transform: rotate3d(0);
    }
    50% {
        transform: rotate3d(0, 1, 0, 3.14rad);
    }
    100% {
        transform: rotate3d(0);
    }
}

catFactory.js


//Random color
function getColor() {
    var randomColor = Math.floor(Math.random() * 16777215).toString(16);
    return randomColor
}

function genColors(){
    var colors = []
    for(var i = 10; i < 99; i ++){
      var color = getColor()
      colors[i] = color
    }
    return colors
}

//This function code needs to modified so that it works with Your cat code.
function headColor(color,code) {
    $('.cat__head, .cat__chest').css('background', '#' + color)  //This changes the color of the cat
    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function eyesColor(color,code) {
    $('.cat__eye--left, .cat__eye--right').css('background', '#' + color)  //This changes the color of eyes
    $('#eyescode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function earsColor(color,code) {
    $('.cat__ear--left, .cat__ear--right').css('background', '#' + color)  //This changes the color of eyes
    $('#earscode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaears').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function mouthColor(color,code) {
    $('.cat__mouth-contour').css('background', '#' + color)  //This changes the color of mouth
    $('#mouthcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnamouth').html(code) //This updates the body color part of the DNA that is displayed below the cat
}
function decorationMidColor(color,code) {
    $('.cat__head-dots').css('background', '#' + color)  //This changes the mid decoration color of the cat
    $('#midcolorcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnadecorationMid').html(code) //This updates the eye color part of the DNA that is displayed below the cat
}
function decorationSidesColor(color,code) {
    $('.cat__head-dots_first, .cat__head-dots_second').css('background', '#' + color)  //This changes the side decoration color of the cat
    $('#sidecolorcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnadecorationSides').html(code) //This updates the eye color part of the DNA that is displayed below the cat
}


//###################################################
//Functions below will be used later on in the project
//###################################################
function eyeVariation(num) {

    $('#dnashape').html(num)
    
    switch (num) {
        case 1:
            normalEyes()
            $('#eyeName').html('Basic')
            break
        case 2:
            normalEyes()
            $('#eyeName').html('Chill')
            eyesType1()
            break
        case 3:
            normalEyes()
            $('#eyeName').html('Looking Up')
            eyesType2()
            break
        case 4:
            normalEyes()
            $('#eyeName').html('Looking Left')
            eyesType3()
            break
        case 5:
            normalEyes()
            $('#eyeName').html('Looking Right')
            eyesType4()
            break
        case 6:
            normalEyes()
            $('#eyeName').html('Focused')
            eyesType5()
            break
        case 7:
            normalEyes()
            $('#eyeName').html('Dreamy')
            eyesType6()
            break
        default:
            console.log("Undefined eyeshape : "+ num)
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
        case 2:
            $('#decorationName').html('Long')
            normaldecoration()
            decorationType1()
            break
        case 3:
            $('#decorationName').html('Longer')
            normaldecoration()
            decorationType2()
            break
        case 4:
            $('#decorationName').html('Long to Left')
            normaldecoration()
            decorationType3()
            break
        case 5:
            $('#decorationName').html('Long to Right')
            normaldecoration()
            decorationType4()
            break
        case 6:
            $('#decorationName').html('Long Spread')
            normaldecoration()
            decorationType5()
            break
        case 7:
            $('#decorationName').html('Longer Spread')
            normaldecoration()
            decorationType6()
            break
        default:
            console.log("Undefined pattern : "+ num)
    }
}

function animationsPlayer(anim) {
    $('#dnaanimation').html(anim)
    switch (anim) {
        case 1:
            $('#animationName').html('Wobbely Head')
            animationType1();
            break
        case 2:
            $('#animationName').html('Side Looking')
            animationType2();
            break
        case 3:
            
            $('#animationName').html('Decoration Twist')
            animationType3();
            break
        case 4:
            
            $('#animationName').html('Big Ears')
            animationType4();
            break
        case 5:
            
            $('#animationName').html('Wiggley Tail')
            animationType5();
            break
        case 6:
            
            $('#animationName').html('Whiskers Shake')
            animationType6();
            break

        }
}

function animationType1() {
    resetAnimation();
    $("#head").addClass("movingHead");
}

function animationType2() {
   resetAnimation();
   $("#catEyes").addClass("movingEyes");
}

function animationType3() {
    resetAnimation();
    $("#midDot").addClass("midDotSpinning");
 }

 function animationType4() {
    resetAnimation();
    $("#catEars").addClass("earScale");
 }

 function animationType5() {
    resetAnimation();
    $("#tail").addClass("tailWig");
 }

 function animationType6() {
    resetAnimation();
    $("#whiskLeft, #whiskRight").addClass("whiskShake");
 }

 function resetAnimation(){
    $("#head").removeClass("movingHead");
    $("#catEyes").removeClass("movingEyes");
    $("#midDot").removeClass("midDotSpinning");
    $("#catEars").removeClass("earScale");
    $("#tail").removeClass("tailWig");
    $("#whiskLeft, #whiskRight").removeClass("whiskShake");
    $("#pawRIGHT, #pawRIGHTINNER").removeClass("sayHello");
    
}

async function normalEyes() {
    await $('.cat__eye').find('span').css('border', 'none')
}

async function eyesType1() {
    await $('.cat__eye').find('span').css('border-top', 'solid 15px')
}

async function eyesType2() {
    await $('.cat__eye').find('span').css('border-bottom', 'solid 15px')
}

async function eyesType3() {
    await $('.cat__eye').find('span').css('border-left', 'solid 10px')
}

async function eyesType4() {
    await $('.cat__eye').find('span').css('border-right', 'solid 10px')
}

async function eyesType5() {
    await $('.cat__eye').find('span').css('border-top', 'solid 7px')
    await $('.cat__eye').find('span').css('border-bottom', 'solid 7px')
    await $('.cat__eye').find('span').css('border-left', 'solid 7px')
    await $('.cat__eye').find('span').css('border-right', 'solid 7px')
}

async function eyesType6() {
    //await $('.cat__eye').find('span').css('border-top', 'solid 7px')
    await $('.cat__eye').find('span').css('border-bottom', 'solid 7px')
    await $('.cat__eye').find('span').css('border-left', 'solid 7px')
    await $('.cat__eye').find('span').css('border-right', 'solid 7px')
}

async function normaldecoration() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    $('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "48px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}
async function decorationType1() {
    // Long
    $('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "55px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}
async function decorationType2() {
    //Longer
    $('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "63px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "50px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "50px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

async function decorationType3() {
    // Long Left
    $('.cat__head-dots').css({ "transform": "rotate(20deg)", "height": "55px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}
async function decorationType4() {
    // Long Right
    $('.cat__head-dots').css({ "transform": "rotate(-20deg)", "height": "55px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

async function decorationType5() {
    // Long Spread
    $('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "55px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(28deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(-28deg)", "height": "42px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}
async function decorationType6() {
    //Longer Spread
    $('.cat__head-dots').css({ "transform": "rotate(0deg)", "height": "63px", "width": "14px", "top": "1px", "border-radius": "0 0 50% 50%" })
    $('.cat__head-dots_first').css({ "transform": "rotate(28deg)", "height": "50px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    $('.cat__head-dots_second').css({ "transform": "rotate(-28deg)", "height": "50px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

catSettings.js


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthcolor" : 10,
    "eyescolor" : 10,
    "earscolor" : 10,
    //Cattributes
    "eyesShape" : 1,
    "decorationPattern" : 1,
    "decorationMidcolor" : 10,
    "decorationSidescolor" : 10,
    "animation" :  1,
    "lastNum" :  1
    }

// when page load
$( document ).ready(function() {
  $('#dnabody').html(defaultDNA.headColor);
  $('#dnamouth').html(defaultDNA.mouthColor);
  $('#dnaeyes').html(defaultDNA.eyesColor);
  $('#dnaears').html(defaultDNA.earsColor);
    
   $('#dnashape').html(defaultDNA.eyesShape)
   $('#dnadecoration').html(defaultDNA.decorationPattern)
   $('#dnadecorationMid').html(defaultDNA.decorationMidcolor)
   $('#dnadecorationSides').html(defaultDNA.decorationSidescolor)
   $('#dnaanimation').html(defaultDNA.animation)
   $('#dnaspecial').html(defaultDNA.lastNum)

  renderCat(defaultDNA)
});

function getDna(){
    var dna = ''
    dna += $('#dnabody').html()
    dna += $('#dnamouth').html()
    dna += $('#dnaeyes').html()
    dna += $('#dnaears').html()
    dna += $('#dnashape').html()
    dna += $('#dnadecoration').html()
    dna += $('#dnadecorationMid').html()
    dna += $('#dnadecorationSides').html()
    dna += $('#dnaanimation').html()
    dna += $('#dnaspecial').html()

    return parseInt(dna)
}

function renderCat(dna){
    headColor(colors[dna.headcolor],dna.headcolor)
    $('#bodycolor').val(dna.headcolor)
    eyesColor(colors[dna.eyescolor],dna.eyescolor)
    $('#eyescolor').val(dna.eyescolor)
    earsColor(colors[dna.earscolor],dna.earscolor)
    $('#earscolor').val(dna.earscolor)
    mouthColor(colors[dna.mouthcolor],dna.mouthcolor)
    $('#mouthcolor').val(dna.mouthcolor)
    eyeVariation(dna.eyesShape)
    $('#eyeshape').val(dna.eyesShape)
    decorationVariation(dna.decorationPattern)
    $('#decorationpattern').val(dna.decorationPattern)
    decorationMidColor(colors[dna.decorationMidcolor],dna.decorationMidcolor)
    $('#decorationmid').val(dna.decorationMidcolor)
    decorationSidesColor(colors[dna.decorationSidescolor],dna.decorationSidescolor)
    $('#decorationsides').val(dna.decorationSidescolor)
    animationsPlayer(dna.animation)
    $('#animation').val(dna.animation)

  
}

// Changing cat colors
$('#bodycolor').change(()=>{
    var colorVal = $('#bodycolor').val()
    headColor(colors[colorVal],colorVal)
})
$('#eyescolor').change(()=>{
  var colorVal = $('#eyescolor').val()
  eyesColor(colors[colorVal],colorVal)
})
$('#earscolor').change(()=>{
  var colorVal = $('#earscolor').val()
  earsColor(colors[colorVal],colorVal)
})
$('#mouthcolor').change(()=>{
  var colorVal = $('#mouthcolor').val()
  mouthColor(colors[colorVal],colorVal)
})
$('#eyeshape').change(()=>{
  var shape = parseInt($('#eyeshape').val())
  eyeVariation(shape)
})

$('#decorationpattern').change(()=>{
  var pattern = parseInt($('#decorationpattern').val())
  decorationVariation(pattern)
})

$('#decorationmid').change(()=>{
  var colorVal = $('#decorationmid').val()
  decorationMidColor(colors[colorVal],colorVal)
})

$('#decorationsides').change(()=>{
  var colorVal = $('#decorationsides').val()
  decorationSidesColor(colors[colorVal],colorVal)
})
$('#animation').change(()=>{
  var anim = parseInt($('#animation').val())
  console.log(anim)
  animationsPlayer(anim)
})
2 Likes

Fun one :alien: :male_detective:

Screenshot 2021-08-10 at 17.15.23

animations.css
.moveHead{
    animation: moveHead 3s infinite;
}

.moveTail{
    animation: moveTail 4s infinite;
}

.moveMouth1{
    animation: moveMouth1 3s infinite;
}

.moveMouth2{
    animation: moveMouth2 3s infinite;
}





@keyframes moveHead {
    0% {
        transform: rotate(0deg)
    }
    33% {
        transform: rotate(10deg);
    }
    66% {
        transform: rotate(-10deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes moveTail {
    0% {
        transform: rotate(0deg)
    }
    20% {
        transform: rotate(20deg);
    }
    80% {
        transform: rotate(-40deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes moveMouth1 {
    0% {
        transform: rotate(-210deg)
    }
    33% {
        transform: rotate(-190deg);
    }
    66% {
        transform: rotate(-230deg);
    }
    100% {
        transform: rotate(-210deg);
    }
}

@keyframes moveMouth2 {
    0% {
        transform: rotate(-150deg)
    }
    33% {
        transform: rotate(-170deg);
    }
    66% {
        transform: rotate(-130deg);
    }
    100% {
        transform: rotate(-150deg);
    }
}
index.html
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Academy kitties </title>
  <script type="text/javascript" src="assets/js/jquery-3.4.1.js"></script>
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  <script src="assets/bootstrap/js/popper.js"></script>
  <script src="assets/bootstrap/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="assets/css/mystyle.css">
  <link rel="stylesheet" href="assets/css/cats.css">
  <link rel="stylesheet" href="assets/css/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
  <link rel="stylesheet" href="assets/css/animations.css">
</head>
  <body>
    <div class="container p-5" style="margin-top: 12vh;margin-bottom: 10vh;">
        <div align="center">
        <h1 class="c-white">Kitties-Factory</h1>
        <p class="c-white">Create your custom Kitty</p>
    </div>
        <div class="row">
            <div class="col-lg-4 catBox m-2 light-b-shadow">
                <div class="cat">
                    <div id="ears" class="ears">
                        <div class="ear left_ear">
                            <div class="left_inner_ear"></div>
                        </div>
                        <div class="ear right_ear">
                            <div class="right_inner_ear"></div>
                        </div>
                    </div>
                    <div id="tail" class="tail"></div>
                    <div class="body">
                        <div class="inner_body"></div>
                        <div id="paws" class="paws">
                            <div class="paw left_paw">
                                <div class="bottom_left_toe"></div>
                                <div class="top_left_toe"></div>
                            </div>
                            <div class="paw right_paw">
                                <div class="bottom_right_toe"></div>
                                <div class="top_right_toe"></div>
                            </div>
                        </div>
                    </div>
                    <div id="head" class="head">
                        <div class="eyes">
                            <div class="eye">
                                <div class="pupils">
                                    <div class="eye_glimmer_big"></div>
                                    <div class="eye_glimmer_small"></div>
                                </div>
                            </div>
                            <div class="eye">
                                <div class="pupils">
                                    <div class="eye_glimmer_big"></div>
                                    <div class="eye_glimmer_small"></div>
                                </div>
                            </div>
                        </div>
                        <div class="nose"></div>
                        <div id="left_mouth" class="left_mouth"></div>
                        <div id="right_mouth" class="right_mouth"></div>
                        <div id="whiskers">
                            <div class="right_whisker_1"></div>
                            <div class="right_whisker_2"></div>
                            <div class="right_whisker_3"></div>
                            <div class="left_whisker_1"></div>
                            <div class="left_whisker_2"></div>
                            <div class="left_whisker_3"></div>
                        </div>
                        
                        <div class="decoration_middle"></div>
                        <div class="decoration_left"></div>
                        <div class="decoration_right"></div>
                    </div>
                </div>
                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnabelly"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnapupils"></span>
                        
                         <!-- Cattributes -->
                         <span id="dnashape"></span>
                         <span id="dnadecoration"></span>
                         <span id="dnadecorationMid"></span>
                         <span id="dnadecorationSides"></span>
                         <span id="dnaanimation"></span>
                         <span id="dnaspecial"></span>
                    </b>
                </div>
            </div>
            <div class="col-lg-7 cattributes m-2 light-b-shadow">

<!-- Cat colors -->
<div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Head and body</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bodycolor">
                </div>
            
                <div class="form-group">
                    <label for="formControlRange"><b>Belly and ears</b><span class="badge badge-dark ml-2" id="bellycode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bellycolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Eye</b><span class="badge badge-dark ml-2" id="eyecode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="eyecolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Pupils</b><span class="badge badge-dark ml-2" id="pupilcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="pupilcolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Eye shape</b><span class="badge badge-dark ml-2" id="eyeName"></span></label>
                    <input type="range" min="1" max="7" class="form-control-range" id="eyeshape">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Decoration shape</b><span class="badge badge-dark ml-2" id="decorationName"></span></label>
                    <input type="range" min="1" max="7" class="form-control-range" id="decorationshape">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Middle decoration color</b><span class="badge badge-dark ml-2" id="middleDecorationCode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="middleDecorationColor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Sides decoration color</b><span class="badge badge-dark ml-2" id="sidesDecorationCode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="sidesDecorationColor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Animation</b><span class="badge badge-dark ml-2" id="animationCode"></span></label>
                    <input type="range" min="1" max="4" class="form-control-range" id="animation">
                </div>
            </div>

            </div>

            </div>
            <br>

        </div>



    </div>
    <footer align="left">
        <p>Ivan on Tech Academy Bootcamp July 2020</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>

</html>
catSettings.js
var colors = Object.values(allColors())

var defaultDNA = {
    "headColor" : 30,
    "bellyColor" : 39,
    "eyeColor" : 43,
    "pupilColor" : 67,
    //Cattributes
    "eyesShape" : 1,
    "decorationPattern" : 1,
    "decorationMidcolor" : 10,
    "decorationSidescolor" : 10,
    "animation" :  1,
    "lastNum" :  1
    }

// when page load
$( document ).ready(function() {
  $('#dnabody').html(defaultDNA.headColor);
  $('#dnabelly').html(defaultDNA.bellyColor);
  $('#dnaeyes').html(defaultDNA.eyeColor);
  $('#dnapupils').html(defaultDNA.pupilColor);
    
   $('#dnashape').html(defaultDNA.eyesShape)
   $('#dnadecoration').html(defaultDNA.decorationPattern)
   $('#dnadecorationMid').html(defaultDNA.decorationMidcolor)
   $('#dnadecorationSides').html(defaultDNA.decorationSidescolor)
   $('#dnaanimation').html(defaultDNA.animation)
  $('#dnaspecial').html(defaultDNA.lastNum)

  renderCat(defaultDNA)
});

function getDna(){
    var dna = ''
    dna += $('#dnabody').html()
    dna += $('#dnabelly').html()
    dna += $('#dnaeyes').html()
    dna += $('#dnapupils').html()
    dna += $('#dnashape').html()
    dna += $('#dnadecoration').html()
    dna += $('#dnadecorationMid').html()
    dna += $('#dnadecorationSides').html()
    dna += $('#dnaanimation').html()
    dna += $('#dnaspecial').html()

    return parseInt(dna)
}

function renderCat(dna){
    changeHeadColor(colors[dna.headColor],dna.headColor)
    $('#bodycolor').val(dna.headColor)

    changeBellyColor(colors[dna.bellyColor],dna.bellyColor)
    $('#bellycolor').val(dna.bellyColor)
    
    changeEyeColor(colors[dna.eyeColor],dna.eyeColor)
    $('#eyecolor').val(dna.eyeColor)

    changePupilColor(colors[dna.pupilColor],dna.pupilColor)
    $('#pupilcolor').val(dna.pupilColor)

    eyeVariation(dna.eyesShape)
    $('#eyeshape').val(dna.eyesShape)

    decorationVariation(dna.decorationPattern)
    $('#decorationshape').val(dna.decorationPattern)

    middleDecorationColor(dna.decorationMidcolor)
    $('#middleDecorationColor').val(dna.decorationMidcolor)

    sidesDecorationColor(dna.decorationSidescolor)
    $('#sidesDecorationColor').val(dna.decorationSidescolor)

    animationVariation(dna.animation)
    $('#animation').val(dna.animation)
}

// Changing cat colors
$('#bodycolor').change(()=>{
    var colorVal = $('#bodycolor').val()
    changeHeadColor(colors[colorVal],colorVal)
})

$('#bellycolor').change(()=>{
  var colorVal = $('#bellycolor').val()
  changeBellyColor(colors[colorVal],colorVal)
})

$('#eyecolor').change(()=>{
  var colorVal = $('#eyecolor').val()
  changeEyeColor(colors[colorVal],colorVal)
})

$('#pupilcolor').change(()=>{
  var colorVal = $('#pupilcolor').val()
  changePupilColor(colors[colorVal],colorVal)
})

$('#eyeshape').change(()=>{
  var shape = parseInt($('#eyeshape').val())
  eyeVariation(shape)
})

$('#decorationshape').change(()=>{
  var shape = parseInt($('#decorationshape').val())
  decorationVariation(shape)
})

$('#middleDecorationColor').change(()=>{
  var colorVal = $('#middleDecorationColor').val()
  middleDecorationColor(colors[colorVal],colorVal)
})

$('#sidesDecorationColor').change(()=>{
  var colorVal = $('#sidesDecorationColor').val()
  sidesDecorationColor(colors[colorVal],colorVal)
})

$('#animation').change(()=>{
  var animationVal = parseInt($('#animation').val())
  animationVariation(animationVal)
})
catFactory.js
//Random color
function getColor() {
    var randomColor = Math.floor(Math.random() * 16777215).toString(16);
    return randomColor
}

function genColors(){
    var colors = []
    for(var i = 10; i < 99; i ++){
      var color = getColor()
      colors[i] = color
    }
    return colors
}


//This function code needs to modified so that it works with Your cat code.
function changeHeadColor(color,code) {
    $('.head, .ear, .body, .paw, .tail').css('background', '#' + color)  //This changes the color of the cat
    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function changeBellyColor(color,code) {
    $('.inner_body, .left_inner_ear, .right_inner_ear').css('background', '#' + color)  //This changes the color of the cat
    $('#bellycode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabelly').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function changeEyeColor(color,code) {
    $('.eye').css('background', '#' + color)  //This changes the color of the cat
    $('#eyecode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function changePupilColor(color,code) {
    $('.pupils').css('background', '#' + color)  //This changes the color of the cat
    $('#pupilcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnapupils').html(code) //This updates the body color part of the DNA that is displayed below the cat
}


//###################################################
//Functions below will be used later on in the project
//###################################################
function eyeVariation(num) {

    $('#dnashape').html(num)
    switch (num) {
        case 1:
            normalEyes()
            $('#eyeName').html('Normal')
            break
        case 2:
            normalEyes()
            $('#eyeName').html('Chill')
            eyesType1()
            break
        case 3:
            normalEyes()
            $('#eyeName').html('Crying')
            eyesType2()
            break
        case 4:
            normalEyes()
            $('#eyeName').html('Small eyes')
            eyesType3()
            break
        case 5:
            normalEyes()
            $('#eyeName').html('Squinty')
            eyesType4()
            break
        case 6:
            normalEyes()
            $('#eyeName').html('Right')
            eyesType5()
            break
        case 7:
            normalEyes()
            $('#eyeName').html('Left')
            eyesType6()
            break
            
    }
}

async function normalEyes() {
    await $('.pupils').css('border', 'none')
    
}
async function eyesType1() {
    await $('.pupils').css('border-top', '9px solid')
}
async function eyesType2() {
    await $('.pupils').css('border-bottom', '13px solid blue')
}
async function eyesType3() {
    await $('.pupils').css('border',' 10px solid')
}
async function eyesType4() {
    await $('.pupils').css('border-top',' 9px solid')
    await $('.pupils').css('border-bottom', '9px solid')
}
async function eyesType5() {
    await $('.pupils').css('border-left',' 10px solid')
}
async function eyesType6() {
    await $('.pupils').css('border-right',' 10px solid')
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Normal')
            normaldecoration()
            break
        case 2:
            normaldecoration()
            $('#decorationName').html('Long')
            decorationType1()
            break
        case 3:
            normaldecoration()
            $('#decorationName').html('Wide')
            decorationType2()
            break
        case 4:
            normaldecoration()
            $('#decorationName').html('Round')
            decorationType3()
            break
        case 5:
            normaldecoration()
            $('#decorationName').html('Horizontal')
            decorationType4()
            break
        case 6:
            normaldecoration()
            $('#decorationName').html('Thin')
            decorationType5()
            break
        case 7:
            normaldecoration()
            $('#decorationName').html('Mean')
            decorationType6()
            break
    }
}
    

async function normaldecoration() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    $('.decoration_middle').css({ 'transform': 'rotate(0deg)', 'height': '40px', 'width': '20px', 'border-radius': '50%', 'left': '91px', 'bottom': '150px' })
    $('.decoration_left').css({ 'transform': 'rotate(-35deg)', 'height': '25px', 'width': '12px', 'border-radius': '65%', 'left': '70px', 'bottom': '150px' })
    $('.decoration_right').css({ 'transform': 'rotate(35deg)', 'height': '25px', 'width': '12px', 'border-radius': '65%', 'left': '119px', 'bottom': '150px' })
}
async function decorationType1() {
    await $('.decoration_middle').css({'height':'70px', 'bottom': '120px'})
}
async function decorationType2() {
    await $('.decoration_left').css({'transform': 'rotate(-130deg)', 'left': '50px', 'bottom': '160px'})
    await $('.decoration_right').css({'transform': 'rotate(130deg)', 'left': '135px', 'bottom': '160px'})
}

async function decorationType3() {
    await $('.decoration_left').css({'border-radius':'90%', 'height': '20px', 'width': '20px', 'left': '65px'})
    await $('.decoration_right').css({'border-radius':'90%', 'height': '20px', 'width': '20px'})
    await $('.decoration_middle').css({'border-radius':'90%', 'height': '30px', 'width': '30px', 'left': '86px', 'bottom': '160px'})
}
async function decorationType4() {
    await $('.decoration_middle').css({'transform': 'rotate(90deg)'})
    await $('.decoration_right').css({'left': '124px'})
    await $('.decoration_left').css({'left': '65px'})
}
async function decorationType5() {
    await $('.decoration_middle').css({'width': '10px', 'left': '96px'})
    await $('.decoration_right').css({'width': '6px', 'left': '72px'})
    await $('.decoration_left').css({'width': '6px', 'left': '124px'})
}
async function decorationType6() {
    await $('.decoration_middle').css({'width': '10px', 'height': '30px', 'left': '96px'})
    await $('.decoration_right').css({'height': '50px', 'bottom': '130px'})
    await $('.decoration_left').css({'height': '50px', 'bottom': '130px'})
}

function middleDecorationColor(color,code) {
    $('.decoration_middle').css('background', '#' + color)  //This changes the color of the cat
    $('#middleDecorationCode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnadecorationMid').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function sidesDecorationColor(color,code) {
    $('.decoration_left').css('background', '#' + color)  //This changes the color of the cat
    $('.decoration_right').css('background', '#' + color)  //This changes the color of the cat
    $('#sidesDecorationCode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnadecorationSides').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function animationVariation (num) {
    $('#dnaanimation').html(num);
    switch (num) {
        case 1:
            removeAnimations()
            animationType1()
            $('#animationCode').html('Wobble head')
            break
        case 2:
            removeAnimations()
            animationType2()
            $('#animationCode').html('Wobble tail')
            break
        case 3:
            removeAnimations()
            animationType3()
            $('#animationCode').html('Wobble mouth')
            break
        case 4:
            removeAnimations()
            animationType4()
            $('#animationCode').html('Wobble paws')
            break
    }
}

function removeAnimations () {
    $("#head").removeClass("moveHead");
    $("#tail").removeClass("moveTail");
    $("#left_mouth").removeClass("moveMouth1");
    $("#right_mouth").removeClass("moveMouth2");
    $("#paws").removeClass("moveHead");
}

function animationType1 () {
    $("#head").addClass("moveHead");
}

function animationType2 () {
    $("#tail").addClass("moveTail");
}

function animationType3 () {
    $("#left_mouth").addClass("moveMouth1");
    $("#right_mouth").addClass("moveMouth2");
}

function animationType4 () {
    $("#paws").addClass("moveHead");
}
2 Likes

Major problem…

I don’t know what happened as I remember all the sliders working, but I opened up my project to work on it and now none of the sliders are working. The badge icon is gone too… can someone please help me debug this. i’m completely stuck

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Academy kitties </title>
  <script type="text/javascript" src="assets/js/jquery-3.4.1.js"></script>
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  <script src="assets/bootstrap/js/popper.js"></script>
  <script src="assets/bootstrap/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="assets/css/mystyle.css">
  <link rel="stylesheet" href="assets/css/cats.css">
  <link rel="stylesheet" href="assets/css/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
  <link rel="stylesheet" href="assets/css/animations.css">


</head>
  <body>
    <div class="container p-5" style="margin-top: 5vh;margin-bottom: 10vh;">
        <div align="center">
        <h1 class="c-white">Kitties-Factory</h1>
        <p class="c-white">Create your custom Kitty</p>
    </div>
        <div class="row">
            <div class="col-lg-4 catBox m-2 light-b-shadow">
              <div class= "cat">

                <div id="ears">
                  <div class="ear leftEar"></div>
                  <div class="ear rightEar"></div>
                  <div class="earLine leftEarLine"></div>
                  <div class="earLine rightEarLine"></div>
                </div>

                <div id="head" class="face">
                  <div id="eyes" class="eyeballs">
                    <div class="eye">
                      <span class="pupils"></span>
                        <span class="innerPupil"></span>
                          <span class="tinyPupil"></span>
                    </div>
                    <div class="eye">
                      <span class="pupils"></span>
                      <span class="innerPupilRight"></span>
                        <span class="tinyPupilRight"></span>
                    </div>
                  </div>

                  <div class="nose"></div>

                  <div class="mouthLeft"></div>
                  <div class="mouthLeft mouthRight"></div>

                  <div class="cat__whiskers-left"></div>
                  <div class="cat__whiskers-right"></div>
                </div>

                <div class="backPawLeft backLeft"></div>
                <div class="backPawRight backRight"></div>

                <div id="tail" class="cat-tail movingTail"></div>

                <div class="body">

                  <div class="torso">

                    <div class="stomach"></div>

                    <div class="catPawLeft leftPaw"></div>

                    <div class="catPawRight rightPaw"></div>
                  </div>
                </div>
              </div>

                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnapupils"></span>
                         <span id="dnaears"></span>
                         <span id="dnaeartips"></span>
                         <span id="dnatummy"></span>
                         <span id="dnafeet"></span>
                         <span id="dnatail"></span>
                         <span id="dnapaws"></span>
                         <span id="dnashadow"></span>

                         <!-- Cattributes -->
                         <span id="dnashape"></span>
                         <span id="dnadecoration"></span>
                         <span id="dnadecorationMid"></span>
                         <span id="dnadecorationSides"></span>
                         <span id="dnadanimation"></span>
                         <span id="dnaspecial"></span>
                    </b>
                </div>
            </div>

            <div class="col-lg-5 cattributes m-2 light-b-shadow">

<!-- Cat colors -->
            <div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Head and body</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bodycolor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Eyes</b><span class="badge badge-dark ml-2" id="eyescode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="eyesColor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Pupils</b><span class="badge badge-dark ml-2" id="pupilscode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="pupils">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Ears</b><span class="badge badge-dark ml-2" id="earscode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="earscolor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Ear Tips & Tail</b><span class="badge badge-dark ml-2" id="earTipsColorCode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="earTipsColor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Tummy</b><span class="badge badge-dark ml-2" id="tummyCode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="tummyColor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Paws</b><span class="badge badge-dark ml-2" id="pawColorCode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="pawColor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Glow</b><span class="badge badge-dark ml-2" id="shadowColorCode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="shadowColor">
                </div>

            </div>

            </div>

              <div class="col-lg-2 cattributes m-2 light-b-shadow">

                <div class="form-group">
                    <label for="formControlRange"><b>Eye Shape</b><span class="badge badge-dark ml-2" id="eyeShapeCode"></span></label>
                    <input type="range" min="1" max="4" class="form-control-range" id="eyeShape">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Vibe</b><span class="badge badge-dark ml-2" id="vibeCode"></span></label>
                    <input type="range" min="1" max="4" class="form-control-range" id="vibe">
                </div>

              </div>


            </div>
            <br>

        </div>





    </div>
    <footer align="left">
        <p>Ivan on Tech Academy Bootcamp July 2020</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>

</html>

catSettings


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 76,
    "eyesColor" : 10,
    "pupilsColor" : 75,
    "earsColor" : 10,
    "earTipsColor" : 10,
    "tummyColor" : 10,
    "pawColor" : 10,
    "shadowColor" : 10,
    //Cattributes
    "eyesShape" : 1,
    "decorationPattern" : 1,
    "decorationMidcolor" : 13,
    "decorationSidescolor" : 13,
    "animation" :  1,
    "lastNum" :  1
    }

// when page load
$( document ).ready(function() {
  $('#dnabody').html(defaultDNA.headColor);
  $('#dnaeyes').html(defaultDNA.eyesColor);
  $('#dnapupils').html(defaultDNA.mouthColor);
  $('#dnaears').html(defaultDNA.earsColor);
  $('#dnaeartips').html(defaultDNA.earTipsColor);
  $('#dnatummy').html(defaultDNA.tummyColor);
  $('#dnapaws').html(defaultDNA.pawColor);
  $('#dnashadow').html(defaultDNA.shdowColor);

  $('#dnashape').html(defaultDNA.eyesShape)
  $('#dnadecoration').html(defaultDNA.decorationPattern)
  $('#dnadecorationMid').html(defaultDNA.decorationMidcolor)
  $('#dnadecorationSides').html(defaultDNA.decorationSidescolor)
  $('#dnaanimation').html(defaultDNA.animation)
  $('#dnaspecial').html(defaultDNA.lastNum)

  renderCat(defaultDNA)
});

function getDna(){
    var dna = ''
    dna += $('#dnabody').html()
    dna += $('#dnaeyes').html()
    dna += $('#dnapupils').html()
    dna += $('#dnaears').html()
    dna += $('#dnaeartips').html()
    dna += $('#dnatummy').html()
    dna += $('#dnapaws').html()
    dna += $('#dnashadow').html()
    dna += $('#dnashape').html()
    dna += $('#dnadecoration').html()
    dna += $('#dnadecorationMid').html()
    dna += $('#dnadecorationSides').html()
    dna += $('#dnaanimation').html()
    dna += $('#dnaspecial').html()

    return parseInt(dna)
}

function renderCat(dna){
    headColor(colors[dna.headcolor],dna.headcolor)
    $('#bodycolor').val(dna.headcolor)
}

// Changing cat colors
$('#bodycolor').change(()=>{
    var colorVal = $('#bodycolor').val()
    headColor(colors[colorVal],colorVal)
});

$('#eyesColor').change(()=>{
    var colorVal = $('#eyesColor').val()
    eyesColor(colors[colorVal],colorVal)
});

$('#pupils').change(()=>{
    var colorVal = $('#pupils').val()
    pupilsColor(colors[colorVal],colorVal)
});

$('#earscolor').change(()=>{
    var colorVal = $('#earscolor').val()
    earsColor(colors[colorVal],colorVal)
});

$('#earTipsColor').change(()=>{
    var colorVal = $('#earTipsColor').val()
    earTipsColor(colors[colorVal],colorVal)
});

$('#tummyColor').change(()=>{
    var colorVal = $('#tummyColor').val()
    tummyColor(colors[colorVal],colorVal)
});

$('#pawColor').change(()=>{
    var colorVal = $('#pawColor').val()
    pawColor(colors[colorVal],colorVal)
});

$('#shadowColor').change(()=>{
    var colorVal = $('#shadowColor').val()
    shadowColor(colors[colorVal],colorVal)
});

$('#eyeShape').change(()=>{
    var shapeVal = parseInt($('#eyeShape').val())
    eyeVariation(shapeVal)
});

$('#vibe').change(()=>{
    var value = parseInt($('#vibe').val())
    decorationVariation(value)
});

catFactory


//Random color
function getColor() {
    var randomColor = Math.floor(Math.random() * 16777215).toString(16);
    return randomColor
}

function genColors(){
    var colors = []
    for(var i = 10; i < 99; i ++){
      var color = getColor()
      colors[i] = color
    }
    return colors
}

//This function code needs to modified so that it works with Your cat code.
function headColor(color,code) {
    $('.face, .torso').css('background', '#' + color)  //This changes the color of the cat
    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function eyesColor(color,code) {
    $('.eye').css('background', '#' + color)  //This changes the color of the cat
    $('#eyescode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function pupilsColor(color,code) {
    $('.pupils').css('background', '#' + color)  //This changes the color of the cat
    $('#pupilscode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnapupils').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function earsColor(color,code) {
    $('.earLine').css('background', '#' + color)  //This changes the color of the cat
    $('#earscode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaears').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function earTipsColor(color,code) {
    $('.ear, .cat-tail').css('background', '#' + color)  //This changes the color of the cat
    $('#earTipsColorCode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeartips').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function tummyColor(color,code) {
    $('.stomach').css('background', '#' + color)  //This changes the color of the cat
    $('#tummyCode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnatummy').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function pawColor(color,code) {
    $('.catPawLeft, .catPawRight, .backPawLeft, .backPawRight').css('background', '#' + color)  //This changes the color of the cat
    $('#pawColorCode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnapaws').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function shadowColor(color,code) {
    $('.backPawLeft, .backPawRight, .cat-tail, .torso, .face, .eye').css('box-shadow', ' 8px 8px 5px #' + color)  //This changes the color of the cat
    $('#shadowColorCode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnashadow').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

//###################################################
//Functions below will be used later on in the project
//###################################################
function eyeVariation(num) {

    $('#dnashape').html(num)
    switch (num) {
        case 1:
            normalEyes()
            $('#eyeShapeCode').html('Big')
            break

        case 2:
            normalEyes()
            $('#eyeShapeCode').html('Cute')
            eyesType1()
            break

        case 3:
            normalEyes()
            $('#eyeShapeCode').html('Chillin')
            eyesType2()
            break

        case 4:
            normalEyes()
            $('#eyeShapeCode').html('Happy Pills')
            eyesType3()
            break

    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            normaldecoration()
            $('#vibeCode').html('Default')
            break

        case 2:
            normaldecoration()
            $('#vibeCode').html('Cross')
            stomach2()
            break

        case 3:
            normaldecoration()
            $('#vibeCode').html('X')
            stomach3()
            break

        case 4:
            normaldecoration()
            $('#vibeCode').html('Message')
            stomach4()
            break
    }
}

async function normalEyes() {
    await $('.eye').find('span').css('border', 'none')
}

async function eyesType1() {
    await $('.eye').find('span').css(
      'background-color': '#4DE1FF',
      'border-radius': '50%',
      'width': '30px',
      'height': '25px',
      'margin-left': '8px',
      'margin-top': '3px',
      'border-left': '10px solid',
      'position': 'absolute')
}

async function eyesType2() {
    await $('.eye').find('span').css('border-top', '10px solid')
}

async function eyesType3() {
    await $('.eye').find('span').css('border-bottom', '10px solid')
}

async function normaldecoration() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    await $('.stomach').css({'left': '20px',
    'top': '82px',
    'width': '98px',
    'height': '40px',
    'border': '5px solid transparent',
    'border-radius': '50% 50% 40% 40%',
    'clip-path': 'none'})
    //$('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    //$('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

async function stomach2() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    await $('.stomach').css({'left': '20px',
    'top': '82px',
    'width': '98px',
    'height': '40px',
    'border': '5px solid transparent',
    //'border-radius': '40% 30% 80% 50%',
    'clip-path': 'polygon(10% 25%, 35% 25%, 35% 0%, 65% 0%, 65% 25%, 90% 25%, 90% 50%, 65% 50%, 65% 100%, 35% 100%, 35% 50%, 10% 50%'})
    //$('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    //$('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

async function stomach3() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    await $('.stomach').css({'left': '20px',
    'top': '82px',
    'width': '98px',
    'height': '40px',
    'border': '5px solid transparent',
    //'border-radius': '40% 30% 80% 50%',
    'clip-path': 'polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%'})
    //$('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    //$('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

async function stomach4() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    await $('.stomach').css({'left': '20px',
    'top': '82px',
    'width': '98px',
    'height': '40px',
    'border': '5px solid transparent',
    //'border-radius': '40% 30% 80% 50%',
    'clip-path': 'polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%)',
    })
    //$('.cat__head-dots_first').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "50% 0 50% 50%" })
    //$('.cat__head-dots_second').css({ "transform": "rotate(0deg)", "height": "35px", "width": "14px", "top": "1px", "border-radius": "0 50% 50% 50%" })
}

css

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: inherit;
}
html {
    box-sizing: border-box;
    overflow-y: scroll;
}
body {
    background: #607d8b;

}

.cat{
  position: relative;
  margin: fill;
  width: 100px;
  height: 255px;
}

.ear{
  background: #2600E6;
  width: 60px;
  height: 65px;
  position: absolute;
  transform: rotate(15deg);
  border-radius: 25%;
}

.leftEar{
  left: 25px;
  top: 8px;
}

.rightEar{
  transform: scale(1,-1);
  margin-left: 150px;
  transform: rotate(70deg);
  top: 8px;
}

.earLine{
  background: #EE03FF;
  width: 60px;
  height: 60px;
  position: absolute;
  transform: rotate(15deg);
  border-radius: 25%;
  margin-left: 5px;
  margin-top: 12px;
}

.leftEarLine{
  left: 22px;
}

.rightEarLine{
  transform: scale(1,-1);
  top: 1px;
  margin-left: 150px;
  transform: rotate(70deg);
}

.face {
  background-color: #CF03DE;
  height: 160px;
  width: 235px;
  /*curvature */
  border-radius: 50%;
  top: 15px;
  box-shadow: 5px 7px 4px #F6A6FC;
  position: absolute;
}

.eyeballs{
  /* anchor point for any image within it*/
  position: relative;
  /* specifies how far from the top of the body are the eyes going to appear*/
  top: 35px;
  left: 40px;
  /* automatically displays things on the same row, look up Flex stuff*/
  display: flex;
}

.eye{
  background-color: #2600E6;
  border-radius: 50%;
  width: 45px;
  height: 30px;
  margin: 15px;
  box-shadow: 3px 3px 3px 2px #F6A6FC;
}

.pupils{
  background-color: #4DE1FF;
  border-radius: 50%;
  width: 30px;
  height: 25px;
  margin-left: 8px;
  margin-top: 3px;
  border-left: 10px solid;
  position: absolute;
}

.innerPupil{
  content: '';
  top: 21px;
  left: 30px;
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.innerPupilRight{
  content: '';
  top: 21px;
  left: 105px;
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.tinyPupil{
  content: '';
  top: 31px;
  left: 29px;
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.tinyPupilRight{
  content: '';
  top: 31px;
  left: 103px;
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.nose {
     content: '';
     position: absolute;
     left: 103px;
     top: 81px;
     width: 0;
     height: 0;
     border: 15px solid transparent;
     border-top: 18px solid #FF9F75;
     border-radius: 40%;
   }

.mouthLeft{
  position: absolute;
  left: 103px;
  top: 91px;
  width: 15px;
  height: 15px;
  -webkit-border-radius: 50%;
  border-radius: 50%;
  border: 4px solid  #000;
  border-right: 3px solid rgba(255, 255, 255, 0);
  border-top: 3px solid rgba(255, 255, 255, 0);
  transform: rotate(-45deg);
}

.mouthRight{
  left:117px;
}

.cat__whiskers-left, .cat__whiskers-right {
    position: relative;
}
.cat__whiskers-left, .cat__whiskers-right, .cat__whiskers-left::after, .cat__whiskers-right::after, .cat__whiskers-left::before, .cat__whiskers-right::before {
    width: 30px;
    height: 4px;
    background: #373737;
}
.cat__whiskers-left::before, .cat__whiskers-right::before, .cat__whiskers-left::after, .cat__whiskers-right::after {
    content: '';
    position: absolute;
    left: 0;
}
.cat__whiskers-left {
    top: 40px;
    left: -5px;
}
.cat__whiskers-left::before {
    top: -16px;
    transform: rotate(15deg);
}
.cat__whiskers-left::after {
    top: 16px;
    transform: rotate(-15deg);
}
.cat__whiskers-right {
    top: 33px;
    left: 212px;
}
.cat__whiskers-right::before {
    top: -16px;
    transform: rotate(-15deg);
}
.cat__whiskers-right::after {
    top: 16px;
    transform: rotate(15deg);
}

.body {
  position: relative;
}

.torso{
  position: absolute;
  left: 44px;
  top: 140px;
  width: 150px;
  height: 140px;
  background: #CF03DE;
  border: 5px solid  transparent;
  border-radius: 50% 50% 40% 40%;
  z-index: 3;
  box-shadow: 4px 7px 4px #F6A6FC;
}

.stomach{
  position: relative;
  left: 20px;
  top: 82px;
  width: 98px;
  height: 40px;
  background: #F6A6FC;
  border: 5px solid  transparent;
  border-radius: 50% 50% 40% 40%;
}

.catPawLeft, .catPawRight {
      position: absolute;
      top: 120px;
      width: 28px;
      height: 40px;
      background: #EE03FF;
      border: none;
      border-bottom: 5px solid transparent;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-radius: 90% 90% 70% 70%;
      z-index: 5;
      box-shadow: 2px 2px 2px darkgrey;
  }

.leftPaw{
  left: 38px;
}

.rightPaw{
  left: 75px;
}

.backPawLeft, .backPawRight {
    content: '';
    position: absolute;
    top: 40px;
    left: 0px;
    width: 35px;
    height: 32px;
    background: #9F02AB;
    border-radius: 45%;
    border: 5px solid transparent;
    z-index: 2;
    box-shadow: 4px 4px 4px #F6A6FC;
}

.backLeft{
  left: 45px;
  top: 260px;
}

.backRight{
  left: 160px;
  top: 260px;
}

.cat-tail {
  position: absolute;
  top: 200px;
  left: 170px;
  width: 90px;
  height: 23px;
  background: #2600E6;
  border: 5px solid transparent;
  border-radius: 45%;
  z-index: 3;
  transform: rotate(100deg);
  box-shadow: 8px 8px 4px #F6A6FC;
}

animations

.movingTail{
  animation: moveTail 3s infinite;
}


@keyframes moveTail {
  /*define the move in a matter of percentages aka 0-100% = full movement */

  /*deinfe what's going to happen at the start of the animation*/
  0% {
    /*head starts in normal position*/
    transform: rotate(-50deg);
  }

  50% {
    transform: rotate(-20deg);
  }

  /*define what the finishing position looks like */
  100% {
    transform: rotate(-50deg);
  }

}

hey @William ! This cases is mostly because functions are not setting up the info inside this sliders or spans. Remeber that for sliders we have to use

Notice that in your renderCat function you are only calling headColors()
Inside this function is not changing any slider value.
You can add this functionality and to each or this functions and also include it into renderCat

renderCat function needs to change each part of the DNA you are passing.

So please include the rest like eyesColor etc… To the renderCat()

let me know hows going.

Hi Kenn.eth,

Thank you for the reply. Unfortunately, this cannot be the problem as I haven’t touched the renderCat() function the entire project, yet the sliders were still working.

It must be a different issue… It worked fine all the way up until I started playing around with the animation… and even for the first few animation modifications it WAS working…

Now, it just stopped :confused: so discouraging

Did you try to change the render function to work with all the parts?

Hi there,

not sure why my animation doesn’t work when using a slider, when I insert it manually it does work, but not very well with my Mood Type slider, can’t seam to figure out those two, spend 5hrs today just on that and feel stuck, it turns out that I have no idea how this catSettings.js interact with what and how it actually work, I thought I did but just feel lost as nothing works and I tried just about everything, its probably a simple minor thing that need to be done. Feel helpless, please rescue :smile: :smile: :smile:

this is my repository as can’t paste all my code here as have more than 32000 letters

https://github.com/KamilSzcze/Crypto-Doggies-2.git

#EDITED#
Ok so I think I narrowed it down to the point that I think something is wrong with my functions in catFactory either animationVariation or animationType1 those are not working, and just can’t seam to find the issue or maybe i’m wrong please check if you see anything.
Edited again, functions should be async so changed that but still not wroking. Hm

#LAST EDITION# OMG animationVariation() need to have an input!!! Hahahaha!!! 8hours later lol! anyway i’m glad that i sorted it myself, it had few other things, I guess it all teaching me something.

function animationVariation(){
    $('#dnaanimation').html(num)

    switch (num) {
        case 1:
            resetAnimation()
            $('#animationName').html('Blinking Eyes')
            animationType1()
            break
        case 2:
            resetAnimation()
            $('#animationName').html('Nothing for now')
            animationType2() 
            break
    }
   
}

async function animationType1(){
    $(".left_eye_lid, .right_eye_lid").addClass("blinkingEyes1")
}

async function resetAnimation(){
    $(".left_eye_lid, .right_eye_lid").removeClass("blinkingEyes1")
}

async function animationType2(){
    resetAnimation() 
}

thanks in advance

Kamil

hey @Kamil37 ! Yeah you are right just gotta pass the num argument to your animationVariation
The num value comes from slider input value. If you keep having issues i can check out your git repo link because this is broken.

1 Like

Ok finally done, all works fine… need a break lol

here’s my code:


            <!-- Cat colors -->
            <div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Head, body and ears colour</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bodycolor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Mouth, belly, inner ears and outer eyes colour</b><span class="badge badge-dark ml-2" id="bellycode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="bellycolor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Eye colour</b><span class="badge badge-dark ml-2" id="eyescode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="eyescolor">
                </div>
                
                <div class="form-group">
                    <label for="formControlRange"><b>Fringe, paws, tail and eyelids colour</b><span class="badge badge-dark ml-2" id="fringecode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="fringecolor">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Mood Types</b><span class="badge badge-dark ml-2" id="eyeName"></span></label>
                    <input type="range" min="1" max="9" class="form-control-range" id="eyeshape">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Fringe Types</b><span class="badge badge-dark ml-2" id="decorationName"></span></label>
                    <input type="range" min="1" max="9" class="form-control-range" id="fringeTypes">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Fringe colour 1</b><span class="badge badge-dark ml-2" id="fringecode1"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="fringecolor1">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Fringe colour 2</b><span class="badge badge-dark ml-2" id="fringecode2"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="fringecolor2">
                </div>

                <div class="form-group">
                    <label for="formControlRange"><b>Animation</b><span class="badge badge-dark ml-2" id="animationName"></span></label>
                    <input type="range" min="1" max="9" class="form-control-range" id="animation">
                </div>

            </div>
            </div>

            </div>

            </div>
            <br>

        </div>



    </div>
    <footer align="left">
        <p>Ivan on Tech Academy Bootcamp July 2020</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>
  <script src="assets/js/jquery-3.4.1.js"></script>

</html>


//Random color
function getColor() {
    var randomColor = Math.floor(Math.random() * 16777215).toString(16);
    return randomColor
}

function genColors(){
    var colors = []
    for(var i = 10; i < 99; i ++){
      var color = getColor()
      colors[i] = color
    }
    return colors
}

//This function code needs to modified so that it works with Your cat code.
function headColor(color,code) {
    $('.head, .cheeks, .chin, .neck, .body, .left_leg, .right_leg, .right_ear, .right_ear_end, .left_ear, .left_ear_end').css('background', '#' + color)  //This changes the color of the cat
    
    $('#headcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function bellyColor(color,code) {
    $('.belly, .mouth, .mouth_2, .right_inner_ear, .left_inner_ear, .eye, .left_cheek, .right_cheek').css('background', '#' + color)  //This changes the color of the cat
    $('#bellycode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnamouth').html(code) //This updates the body color part of the DNA that is displayed below the dog
}

function eyesColor(color,code) {
    $('.left_outer_pupil, .right_outer_pupil').css('background', '#' + color)  //This changes the color of the dog
    $('#eyescode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function fringeColor(color,code) {
    $('.fringe_1, .fringe_2, .fringe_3, .fringe_4, .fringe_5').css('border-top-color', '#' + color)
    $('.fringe_1, .fringe_2, .fringe_3, .fringe_4, .fringe_5').css('border-left-color', '#' + color)
    $('.tail').css('border-left-color', '#' + color)
    $('.tail').css('border-top-color', '#' + color)
    $('.left_eye_lid, .right_eye_lid').css('border-top-color', '#' + color)
    $('.left_eye_lid, .right_eye_lid').css('border-bottom-color', '#' + color)
    $('.left_foot, .right_foot, .back_left_foot, .back_right_foot').css('background', '#' + color)  //This changes the color of the dog
    $('#fringecode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnaears').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function fringeColor1(color,code) {
    $('.fringe_2, .fringe_4, .fringe_5').css('border-top-color', '#' + color)
    $('.fringe_2, .fringe_4, .fringe_5').css('border-left-color', '#' + color)
    
    $('#fringecode1').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnadecorationMid').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

function fringeColor2(color,code) {
    $('.fringe_1, .fringe_3').css('border-top-color', '#' + color)
    $('.fringe_1, .fringe_3').css('border-left-color', '#' + color)
    
    $('#fringecode2').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnadecorationMid').html(code) //This updates the body color part of the DNA that is displayed below the cat
}

//$("#fringecode").addClass('myApp');
//.left_foot, .right_foot, .back_left_foot, .back_right_foot
//.left_foot, .right_foot, .back_left_foot, .back_right_foot, .left_cheek, .right_cheek

//############################
//MOODS VARIATIONS STARTS HERE
//############################

function eyeVariation(num) {

    $('#dnashape').html(num)// that changes the DNA code number under the dog when we change the slider

    switch (num) { //switch is "like" simple if statement 
        case 1: //so if num = 1 than... normalEyes
            normalEyes() //here we execute the actual funcion that is called normalEyes, which you can find below
            normalMouthAndTongue()
            $('#eyeName').html('Basic') //here we set the badge to "Basic"
            break
        case 2: 
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Happy')
            eyesType2()
            break
        case 3: 
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Chill')
            eyesType3()
            break
        case 4: 
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Not Happy')
            eyesType4()
            break
        case 5: 
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Sneaky 1')
            eyesType5()
            break
        case 6: 
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Sneaky 2')
            eyesType6()
            break
        case 7: 
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Surprised')
            eyesType7()
            break
        case 8:
            normalEyes() 
            normalMouthAndTongue()
            $('#eyeName').html('Jolly')
            eyesType8()
            break
        case 9:
            normalEyes()
            normalMouthAndTongue()
            $('#eyeName').html('Shocked')
            eyesType9()
            break
    }
}


async function normalEyes() {
    await $('.left_eye_lid, .right_eye_lid').css({'border-top': '0px solid', 'border-bottom': '0px solid'})
   /* await $('.right_outer_pupil').css('top', '-4px')
    await $('.left_outer_pupil').css('top', '-4px') 
    await $('.left_eye_lid').css('top', '-35px')
    await $('.right_eye_lid').css('top', '-30px')
    await $('.right_outer_pupil').css('left', '-9px')
    await $('.left_outer_pupil').css('left', '-2px') */ 
}

/*async function normalEyes2() {
    await $('.right_outer_pupil').css('top', '9px')
    await $('.left_outer_pupil').css('top', '8px')
    await $('.right_outer_pupil').css('left', '-9px')
    await $('.left_outer_pupil').css('left', '-2px')
    await $('.left_eye_lid, .right_eye_lid').css({'border-top': '0px solid', 'border-bottom': '0px solid'})
     
}*/

async function normalMouthAndTongue() {
    await $('.tongue_1, .tongue_2, .tongue_3, .tongue_4, .tongue_5').css('background', '#eda6a6')
    await $('.mouth_3').css('height', '55px')
    await $('.mouth_3').css('width', '55px')
    await $('.mouth_3').css('top', '285px')
    await $('.mouth_3').css('left', '180px')
    await $('.mouth_3').css('transform', 'rotate(225deg)')
    await $('.mouth_3').css('border-radius', '50px')
    await $('.mouth').css('height', '95px')
    await $('.mouth').css('width', '98px')
    await $('.mouth').css('top', '260px')
    await $('.mouth').css('left', '160px')
    
}

async function eyesType2() {
    await $('.left_eye_lid, .right_eye_lid').css('border-top', '15px solid')
    await $('.right_outer_pupil').css('top', '-4px')
    await $('.left_outer_pupil').css('top', '-4px')
    await $('.left_eye_lid').css('top', '-30px')
    await $('.right_eye_lid').css('top', '-35px')
}


async function eyesType3() {
    await $('.left_eye_lid, .right_eye_lid').css('border-top', '32px solid')
    await $('.right_outer_pupil').css('top', '-4px')
    await $('.left_outer_pupil').css('top', '-4px')
    await $('.left_eye_lid').css('top', '-30px')
    await $('.right_eye_lid').css('top', '-35px')
}

async function eyesType4() {
    await $('.left_eye_lid, .right_eye_lid').css('border-top', '42px solid')
    await $('.tongue_1, .tongue_2, .tongue_3, .tongue_4, .tongue_5').css('background', '#ffffff00')
    await $('.mouth_3').css('height', '40px')
    await $('.mouth_3').css('width', '40px')
    await $('.mouth_3').css('top', '274px')
    await $('.mouth_3').css('left', '189px')
}

async function eyesType5() {   
    await $('.tongue_1, .tongue_2, .tongue_3, .tongue_4, .tongue_5').css('background', '#ffffff00')
    await $('.mouth_3').css('height', '40px')
    await $('.mouth_3').css('width', '40px')
    await $('.mouth_3').css('top', '274px')
    await $('.mouth_3').css('left', '189px')
    await $('.left_eye_lid, .right_eye_lid').css('border-top', '32px solid')
    await $('.left_eye_lid, .right_eye_lid').css('border-bottom', '32px solid')
}

async function eyesType6() {
    await $('.left_eye_lid, .right_eye_lid').css('border-top', '32px solid')
    await $('.left_eye_lid, .right_eye_lid').css('border-bottom', '32px solid')
}

async function eyesType7() {   
    await $('.tongue_1, .tongue_2, .tongue_3, .tongue_4, .tongue_5').css('background', '#ffffff00')
    await $('.mouth_3').css('height', '28px')
    await $('.mouth_3').css('width', '21px')
    await $('.mouth_3').css('top', '314px')
    await $('.mouth_3').css('left', '198px')
    await $('.mouth_3').css('transform', 'none')
    await $('.mouth_3').css('border-radius', '50px 50px 20px 20px')
}

async function eyesType8() {
    await $('.left_eye_lid, .right_eye_lid').css('border-top', '42px solid')
    await $('.tongue_1, .tongue_2, .tongue_3, .tongue_4, .tongue_5').css('background', '#ffffff00')
    await $('.mouth_3').css('height', '20px')
    await $('.mouth_3').css('width', '88px')
    await $('.mouth_3').css('top', '299px')
    await $('.mouth_3').css('left', '164px')
    await $('.mouth_3').css('transform', 'none')
}

async function eyesType9() {
    /*await $('.right_outer_pupil').css('top', '0px')
    await $('.left_outer_pupil').css('top', '0px')
    await $('.right_outer_pupil').css('left', '8px')
    await $('.left_outer_pupil').css('left', '6px')*/   
    await $('.tongue_1, .tongue_2, .tongue_3, .tongue_4, .tongue_5').css('background', '#ffffff00')
    await $('.mouth_3').css('height', '51px')
    await $('.mouth_3').css('width', '23px')
    await $('.mouth_3').css('top', '314px')
    await $('.mouth_3').css('left', '196px')
    await $('.mouth_3').css('transform', 'none')
    await $('.mouth_3').css('border-radius', '50px')
    await $('.mouth').css('height', '118px')
    await $('.mouth').css('width', '81px')
    await $('.mouth').css('top', '260px')
    await $('.mouth').css('left', '167px')
}



//############################
//FRINGE VARIATION STARTS HERE
//############################

function decorationVariation(num) {
    
    $('#dnadecoration').html(num)
    
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
        case 2:
            normaldecoration()
            $('#decorationName').html('Messy')
            fringeType2()
            break
        case 3:
            normaldecoration()
            $('#decorationName').html('Crown')
            fringeType3()
            break
        case 4:
            normaldecoration()
            $('#decorationName').html('Gelly')
            fringeType4()
            break
        case 5:
            normaldecoration()
            $('#decorationName').html('Floppy')
            fringeType5()
            break
        case 6:
            normaldecoration()
            $('#decorationName').html('Funky')
            fringeType6()
            break
        case 7:
            normaldecoration()
            $('#decorationName').html('Funky Long')
            fringeType7()
            break
        case 8:
            normaldecoration()
            $('#decorationName').html('To The Side')
            fringeType8()
            break
        case 9:
            normaldecoration()
            $('#decorationName').html('To The Side Floppy')
            fringeType9()
            break
            
    }
}             

async function normaldecoration() {
    //Remove all style from other decorations
    //In this way we can also use normalDecoration() to reset the decoration style
    $('.fringe_1').css({ "transform": "rotate(43deg)", "top": "85px", "left": "65px", "width": "55px", "height": "49px"})
    $('.fringe_2').css({ "transform": "rotate(12deg)", "top": "101px", "left": "66px", "width": "54spx", "height": "57px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(358deg)", "top": "120px", "left": "74px", "width": "47px", "height": "52px"})
    $('.fringe_4').css({ "transform": "rotate(74deg)", "top": "75px", "left": "75px", "width": "64px", "height": "68px"})
    $('.fringe_5').css({ "transform": "rotate(327deg)", "top": "127px", "left": "86px", "width": "67px", "height": "52px"})
}

async function fringeType2() {
    $('.fringe_1').css({ "transform": "rotate(91deg)", "top": "85px", "left": "80px"})
    $('.fringe_2').css({ "transform": "rotate(91deg)", "top": "91px", "left": "64px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(91deg) scale(1, -1)", "top": "78px", "left": "82px"})
    $('.fringe_4').css({ "transform": "rotate(90deg) scale(1, -1)", "top": "73px", "left": "130px"})
    $('.fringe_5').css({ "transform": "rotate(89deg)", "top": "82px", "left": "17px"})
}

async function fringeType3() {
    $('.fringe_1').css({ "transform": "rotate(91deg) scale(1, -1)", "top": "78px", "left": "82px"})
    $('.fringe_2').css({ "transform": "rotate(91deg)", "top": "71px", "left": "66px", "width": "60px", "height": "75px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(89deg)", "top": "72px", "left": "98px"})
    $('.fringe_4').css({ "transform": "rotate(90deg) scale(1, -1)", "top": "73px", "left": "130px"})
    $('.fringe_5').css({ "transform": "rotate(91deg)", "top": "85px", "left": "39px"})
}

async function fringeType4() {
    $('.fringe_1').css({ "transform": "rotate(271deg)", "top": "138px", "left": "49px"})
    $('.fringe_2').css({ "transform": "rotate(270deg)", "top": "134px", "left": "66px", "width": "62px", "height": "42px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(270deg)", "top": "130px", "left": "116px", "width": "63px", "height": "63px"})
    $('.fringe_4').css({ "transform": "rotate(270deg) scale(1, -1)", "top": "133px", "left": "99px"})
    $('.fringe_5').css({ "transform": "rotate(270deg) scale(1, -1)", "top": "122px", "left": "54px", "width": "75px", "height": "71px"})
}

async function fringeType5() {
    $('.fringe_1').css({ "transform": "rotate(352deg)", "top": "118px", "left": "65px"})
    $('.fringe_2').css({ "transform": "rotate(320deg)", "top": "125px", "left": "87px", "width": "46px", "height": "57px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(282deg)", "top": "132px", "left": "103px", "width": "47px", "height": "52px"})
    $('.fringe_4').css({ "transform": "rotate(24deg)", "top": "95px", "left": "53px"})
    $('.fringe_5').css({ "transform": "rotate(244deg)", "top": "112px", "left": "112px", "width": "67px", "height": "52px"})
}

async function fringeType6() {
    $('.fringe_1').css({ "transform": "rotate(91deg)", "top": "85px", "left": "95px"})
    $('.fringe_2').css({ "transform": "rotate(91deg)", "top": "104px", "left": "78px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(91deg) scale(1, -1)", "top": "102px", "left": "62px"})
    $('.fringe_4').css({ "transform": "rotate(146deg) scale(1, -1)", "top": "115px", "left": "157px"})
    $('.fringe_5').css({ "transform": "rotate(35deg)", "top": "118px", "left": "14px"})
} 

async function fringeType7() {
    $('.fringe_1').css({ "transform": "rotate(104deg)", "top": "53px", "left": "72px", "width": "85px", "height": "85px"})
    $('.fringe_2').css({ "transform": "rotate(81deg)", "top": "62px", "left": "15px", "width": "104px", "height": "109px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(91deg) scale(1, -1)", "top": "60px", "left": "68px", "width": "112px", "height": "117px"})
    $('.fringe_4').css({ "transform": "rotate(146deg) scale(1, -1)", "top": "115px", "left": "169px", "width": "85px", "height": "96px"})
    $('.fringe_5').css({ "transform": "rotate(46deg)", "top": "96px", "left": "-39px", "width": "87px", "height": "87px"})
}

async function fringeType8() {
    $('.fringe_1').css({ "transform": "rotate(89deg)", "top": "64px", "left": "50px", "width": "85px", "height": "96px"})
    $('.fringe_2').css({ "transform": "rotate(77deg)", "top": "61px", "left": "10px", "width": "104px", "height": "109px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(91deg)", "top": "43px", "left": "-13px", "width": "112px", "height": "117px"})
    $('.fringe_4').css({ "transform": "rotate(89deg)", "top": "51px", "left": "51px", "width": "102px", "height": "112px"})
    $('.fringe_5').css({ "transform": "rotate(90deg)", "top": "67px", "left": "-7px", "width": "87px", "height": "87px"})
}

async function fringeType9() {
    $('.fringe_1').css({ "transform": "rotate(269deg)", "top": "120px", "left": "119px", "width": "85px", "height": "96px"})
    $('.fringe_2').css({ "transform": "rotate(264deg)", "top": "117px", "left": "91px", "width": "104px", "height": "109px", "z-index": "11"})
    $('.fringe_3').css({ "transform": "rotate(271deg)", "top": "133px", "left": "64px", "width": "87px", "height": "87px"})
    $('.fringe_4').css({ "transform": "rotate(271deg)", "top": "129px", "left": "144px", "width": "102px", "height": "112px"})
    $('.fringe_5').css({ "transform": "rotate(269deg)", "top": "137px", "left": "48px", "width": "112px", "height": "117px"})
}

function animationVariation(num){
    $('#dnaanimation').html(num)

    switch (num) {
        
        case 1:
            resetAnimation()
            $('#animationName').html('No Animation')
            break
        case 2:
            resetAnimation()
            $('#animationName').html('Blinking Eyes Basic')
            animationType2() //animationType1 doesent exist just to create relation with case numbers
            break
        case 3:
            resetAnimation()
            $('#animationName').html('Blinking Eyes Happy')
            animationType3() 
            break
        case 4:
            resetAnimation()
            $('#animationName').html('Blinking Eyes Chill')
            animationType4() 
            break
        case 5:
            resetAnimation()
            $('#animationName').html('Blinking Eyes Sneaky')
            animationType5() 
            break
        case 6:
            resetAnimation()
            $('#animationName').html('Blinking Eyes Shocked')
            animationType6() 
            break
        case 7:
            resetAnimation()
            $('#animationName').html('Happy Tail')
            animationType7() 
            break
        case 8:
            resetAnimation()
            $('#animationName').html('Breathing')
            animationType8() 
            break
        case 9:
            resetAnimation()
            $('#animationName').html('Sniffing')
            animationType9() 
            break
    }
   
}

async function resetAnimation(){
    $(".left_eye_lid, .right_eye_lid").removeClass("blinkingEyes2")
    $(".left_eye_lid, .right_eye_lid").removeClass("blinkingEyes3")
    $(".left_eye_lid, .right_eye_lid").removeClass("blinkingEyes4")
    $(".left_eye_lid, .right_eye_lid").removeClass("blinkingEyes5")
    $(".left_eye_lid, .right_eye_lid").removeClass("blinkingEyes6")
    $(".tail").removeClass("happyTail")
    $(".tongue_4, .tongue_5, .tongue_3").removeClass("breathing")
    $(".nose").removeClass("sniffing")
}

async function animationType2(){
    $(".left_eye_lid, .right_eye_lid").addClass("blinkingEyes2")
}

async function animationType3(){
    $(".left_eye_lid, .right_eye_lid").addClass("blinkingEyes3")
    $(".tail").addClass("happyTail")
}

async function animationType4(){
    $(".left_eye_lid, .right_eye_lid").addClass("blinkingEyes4") 
}

async function animationType5(){
    $(".left_eye_lid, .right_eye_lid").addClass("blinkingEyes5")
}

async function animationType6(){
    $(".left_eye_lid, .right_eye_lid").addClass("blinkingEyes6")
}

async function animationType7(){
    $(".tail").addClass("happyTail")
}

async function animationType8(){
    $(".tongue_4, .tongue_5, .tongue_3").addClass("breathing")
}

async function animationType9(){
    $(".nose").addClass("sniffing")
}

.blinkingEyes2{

    animation-name: blinkEyes2;

    animation-duration: 8s;

    animation-iteration-count: infinite;

    

}

@keyframes blinkEyes2{

    0%, 30% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    31% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    32% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    33% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    34%, 74% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    75% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    76% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    80%, 100% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    

}

.blinkingEyes3{

    animation-name: blinkEyes3;

    animation-duration: 8s;

    animation-iteration-count: infinite;

    

}

@keyframes blinkEyes3{

    0%, 30% {

        border-top-width: 15px;

        border-bottom-width: 15px;

    }

    31% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    32% {

        border-top-width: 15px;

        border-bottom-width: 15px;

        

    }

    33% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    34%, 74% {

        border-top-width: 15px;

        border-bottom-width: 15px;

    }

    75% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    76% {

        border-top-width: 15px;

        border-bottom-width: 15px;

    }

    80%, 100% {

        border-top-width: 15px;

        border-bottom-width: 15px;

    }

}

.blinkingEyes4{

    animation-name: blinkEyes4;

    animation-duration: 15s;

    animation-iteration-count: infinite;

    

}

@keyframes blinkEyes4{

    0%, 27% {

        border-top-width: 37px;

        border-bottom-width: 0px;

    }

    31% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    32% {

        border-top-width: 37px;

        border-bottom-width: 0px;

    }

    

    34%, 73% {

        border-top-width: 37px;

        border-bottom-width: 0px;

    }

    75% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    77% {

        border-top-width: 37px;

        border-bottom-width: 0px;

    }

    80%, 100% {

        border-top-width: 37px;

        border-bottom-width: 0px;

    }

    

}

.blinkingEyes5{

    animation-name: blinkEyes5;

    animation-duration: 15s;

    animation-iteration-count: infinite;

    

}

@keyframes blinkEyes5{

    0% {

        border-top-width: 25px;

        border-bottom-width: 25px;

    }

    11% {

        border-top-width: 37px;

        border-bottom-width: 37px;

    }

    12% {

        border-top-width: 33px;

        border-bottom-width: 33px;

    }

    13% {

        border-top-width: 33px;

        border-bottom-width: 33px;

        

    }

    14% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    15%, 54% {

        border-top-width: 35px;

        border-bottom-width: 35px;

    }

    55% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    56% {

        border-top-width: 33px;

        border-bottom-width: 33px;

    }

    95%, 100% {

        border-top-width: 25px;

        border-bottom-width: 25px;

    }

}

.blinkingEyes6{

    animation-name: blinkEyes6;

    animation-duration: 8s;

    animation-iteration-count: infinite;

    

}

@keyframes blinkEyes6{

    0%, 5% {

        border-top-width: 37px;

        border-bottom-width: 37px;

    }

    6%, 11% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    12% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    13% {

        border-top-width: 0px;

        border-bottom-width: 0px;

        

    }

    14% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    15%, 54% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    55% {

        border-top-width: 41px;

        border-bottom-width: 41px;

    }

    56%, 94% {

        border-top-width: 0px;

        border-bottom-width: 0px;

    }

    95%, 100% {

        border-top-width: 37px;

        border-bottom-width: 37px;

    }

}

.happyTail{

    animation-name: happyTail;

    animation-duration: 1s;

    animation-iteration-count: infinite;

    

}

@keyframes happyTail{

    0% {

        width: 126px

    }

    10% {

        width: 60px

    }

    20% {

        width: 126px

    }

    30% {

        width: 60px

    }

    40% {

        width: 126px

    }

    50% {

        width: 60px

    }

    60% {

        width: 126px

    }

    70% {

        width: 60px;

    }

    80% {

        width: 126px;

    }

    90% {

        width: 60px;

    }

    100% {

        width: 126px

    }

}

.breathing{

    animation-name: breathing;

    animation-duration: 1.5s;

    animation-iteration-count: infinite;

    

}

@keyframes breathing{

    0% {

        top: 330px

    }

    10% {

        top: 337px

    }

    20% {

        top: 330px

    }

    30% {

        top: 337px

    }

    40% {

        top: 330px

    }

    50% {

        top: 337px

    }

    60% {

        top: 330px

    }

    70% {

        top: 337px

    }

    80% {

        top: 330px

    }

    90% {

        top: 337px

    }

    100% {

        top: 330px

    }

}

.sniffing{

    animation-name: sniffing;

    animation-duration: 1.5s;

    animation-iteration-count: infinite;

    

}

@keyframes sniffing{

    0% {

        top: 253px

    }

    10% {

        top: 251px

    }

    20% {

        top: 253px

    }

    30% {

        top: 251px

    }

    40% {

        top: 253px

    }

    50% {

        top: 251px

    }

    60% {

        top: 253px

    }

    70% {

        top: 251px

    }

    80% {

        top: 253px

    }

    90% {

        top: 251px

    }

    100% {

        top: 253px

    }
}
1 Like

Job done, let me know what you think guys!
https://crypto-cats.netlify.app/

Still got a couple of bugs though, but I’ve wasted enough time for now!

  • An eye animation synchronization issue when switching eyes shape while the eyes animation is already running.
  • My cat doesn’t always fit properly in his box depending on the screen size. I guess I’ve messed up the CSS somewhere haha!

Here is my GitHub for the code (easier than pasting every files here :sweat_smile:):
https://github.com/Pedrojok01/CryptoCats

1 Like

Here you go. I’ve just added the additional code in the catFactory.js and animation.css files. The rest is either untouched or has been done before. For the full code visit: https://github.com/EmmerichS/HelloKitties

catFactory.js
//Animation
function animationVariation(num) {

    $('#dnaanimation').html(num)

    switch (num) {
        case 1:
            resetAnimation()
            $('#animationcode').html('Basic')
            break
        case 2: 
            resetAnimation()
            $('#animationcode').html('Indian')
            headRotate()
            break
        case 3:
            resetAnimation()
            $('#animationcode').html('Bigfoot')
            bigFoot()
            break
        case 4:
            resetAnimation()
            $('#animationcode').html('LLR')
            LLR()
            break
        case 5:
            resetAnimation()
            $('#animationcode').html('Round the World')
            roundTheWorld()
            break
        case 6:
            resetAnimation()
            $('#animationcode').html('Dali')
            dali()
            break
        case 7:
            resetAnimation()
            $('#animationcode').html('Rudolf')
            rudolf()
            break
        case 8:
            resetAnimation()
            $('#animationcode').html('Wave')
            wave()
            break
        case 9:
            resetAnimation()
            $('#animationcode').html('Ears')
            ears()
            break
        case 10:
            resetAnimation()
            $('#animationcode').html('Cheeky')
            cheeky()
            break
    }
}

function resetAnimation() {
    $('#head').removeClass('headRotate');
    $('#right_foot').removeClass('bigFoot');
    $('#left_foot').removeClass('bigFoot');
    $('.eye').removeClass('LLR');
    $('.roundTheWorld').removeClass('roundTheWorld');
    $('.whisker').removeClass('dali');
    $('#nose').removeClass('rudolf');
    $('#left_arm').removeClass('wave');
    $('.left_ear').removeClass('ears');
    $('.right_ear').removeClass('ears');
    $('#tongue').removeClass('cheeky');
}

function headRotate() {
    $('#head').addClass('headRotate');
}

function bigFoot() {
    $('#right_foot').addClass('bigFoot');
    $('#left_foot').addClass('bigFoot');
}

function LLR() {
    $('.eye').addClass('LLR');
}

function roundTheWorld() {
    $('#head').addClass('roundTheWorld');
}

function dali() {
    $('.whisker').addClass('dali');
}

function rudolf() {
    $('#nose').addClass('rudolf');
}

function wave() {
    $('#left_arm').addClass('wave');
}

function ears() {
    $('.left_ear').addClass('ears');
    $('.right_ear').addClass('ears');
}

function cheeky() {
    $('#tongue').addClass('cheeky');
}
animation.css
.headRotate {
    animation: headRotate 1s infinite;
}
@keyframes headRotate {
    0% {
        transform: rotate(5deg);
    }
    50% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(5deg);
    }
}

.bigFoot {
    animation: bigFoot 3s infinite;
}
@keyframes bigFoot {
    0% {
        transform: scale(1, 1);
    }
    50% {
        transform: scale(1.5, 1.5);
    }
    100% {
        transform: scale(1, 1);
    }
}

.LLR {
    animation: LLR 1.5s infinite;
}
@keyframes LLR {
    0% {
        justify-content: flex-end;
    }
    50% {
        justify-content: flex-start;
    }
    100% {
        justify-content: flex-end;
    }
}

.roundTheWorld {
    animation: roundTheWorld 10s infinite;
}
@keyframes roundTheWorld {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.dali {
    animation: dali 2s infinite;
}
@keyframes dali {
    0% {
        width: 25px;
    }
    50% {
        width: 50px;
    }
    100% {
        width: 25px;
    }
}

.rudolf {
    animation: rudolf 2s infinite;
}
@keyframes rudolf {
    0% {
        background-color: red;
    }
    50% {
        transform: scale(1.5, 1.5);
        background-color: red;
    }
    100% {
        transform: scale(1, 1);
        background-color: red;
    }
}

.wave {
    animation: wave 2.5s infinite;
}
@keyframes wave {
	0% { 
        transform: rotate(40deg);
	}
	50% { 
        transform: rotate(30deg);
	}
	100% { 
        transform: rotate(40deg);
	}
}

.ears {
    animation: ears 6s infinite;
}
@keyframes ears {
    0% {
        transform: rotate(0deg);
    }
    12.5% {
        transform: rotate(30deg);
    }
    37.5% {
        transform: rotate(-30deg);
    }
    50% {
        transform: rotate(0deg);
    }
    62.5% {
        transform: rotate(-30deg);
    }
    87.5% {
        transform: rotate(30deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.cheeky {
    animation: cheeky 3s infinite;
}
@keyframes cheeky {
    0% {
        background-color: red;
        height: 10px;
    }
    50% {
        background-color: red;
        height: 23px;
    }
    100% {
        background-color: red;
        height: 10px;
    }
}
1 Like

dig

animations.css

.movingHead{
    animation: moveHead 5s infinite;
}

@keyframes moveHead {
    0% {
        transform: rotate(0deg);
    }

    30% {
        transform: rotate(5deg);
    }
    
    60% {
        transform: rotate(-5deg);
    }
    
    100% {
        transform: rotate(0deg);
    }
}

.diggingHead{
    animation: digHead 5s infinite;
}

@keyframes digHead {
    0% {
        transform: translate(0px, 0px);
    }

    30% {
        transform: translate(0px, 5px);
    }
    
    60% {
        transform: translate(0px, -5px);
    }
    
    100% {
        transform: translate(0px, 0px);
    }    
}

.movingTail{
    animation:moveTail 2s infinite;
}
@keyframes moveTail{
    0% {
        transform: rotate(0deg);  
    }
    33% {
        transform: rotate(20deg);
    }
    66% {  
        transform: rotate(-10deg);   
    }
    100% {
        transform: rotate(0deg);   
    }
}

catFactory.js

function animationVariation(num){
    $('#dnaanimation').html(num)
    switch (num) {
        case 1:
            resetAnimation()
            $('#animationName').html('None')            
            break
        case 2:
            $('#animationName').html('Moving Head')
            movingHead();
            break
        case 3:
            $('#animationName').html('Digging Head');
            diggingHead();
            break
        case 4:
            $('#animationName').html('Moving Tail');
            moveTail();
            break
    }
}

async function movingHead(){
    await resetAnimation();
    $('#head').addClass('movingHead');
}

async function diggingHead(){
    await resetAnimation();
    $('#head').addClass('diggingHead');
    $('.cat__ear').addClass('diggingHead')
}

async function moveTail(){
    await resetAnimation();
    $("#tail").addClass("movingTail");  
}

async function resetAnimation(){
    await $('#head').removeClass('movingHead');
    await $('#head').removeClass('diggingHead');
    await $('#tail').removeClass('movingTail');
    await $('.cat__ear').removeClass('diggingHead')
}
1 Like

glorious
Screen Shot 2021-11-01 at 14.36.13

animations.css

.movingHead {
    animation: moveHead 3s infinite;
}
.movingTail {
    animation: moveTail 2s infinite;
}
.movingNose {
    animation: moveNose 4s infinite;
}
.movingPaw1 {
    animation: movePaw1 2s infinite;
}
.movingPaw2 {
    animation: movePaw2 2s infinite;
}
.movingWhisker {
    animation: moveWhisker 2s infinite;
}
.movingWhiskerB {
    animation: moveWhiskerB 2s infinite;
}
.hypnotique {
    animation: hypnotize 4s infinite;
}

@keyframes moveHead {
    0% {
        transform: rotate(0deg);
    }
    33% {
        transform: rotate(5deg);
    }
    66% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes moveTail {
    0% {
        transform: rotate(-40deg);

    }
    30% {
        transform: rotate(-45deg);
        left: 158px;
    }
    80% {
        transform: rotate(-35deg);
        left: 162px;
    }
    100% {
        transform: rotate(-40deg);
    }
}

@keyframes moveNose {
    0%{transform: translate(0px,0px);}

    54%{transform: translate(0px,1px);}
    56%{transform: translate(0px,-1px);}
    58%{transform: translate(0px,1px);}
    60%{transform: translate(0px,-1px);}

    84%{transform: translate(0px,1px);}
    86%{transform: translate(0px,-1px);}
    88%{transform: translate(0px,1px);}
    90%{transform: translate(0px,-1px);}

    92%{transform: translate(0px,1px);}
    93%{transform: translate(0px,-1px);}
    94%{transform: translate(0px,1px);}
    95%{transform: translate(0px,-1px);}

    96%{transform: translate(0px,1px);}
    97%{transform: translate(0px,-1px);}
    98%{transform: translate(0px,1px);}
    99%{transform: translate(0px,-1px);}

    100%{transform: translate(0px,0px);}
}

@keyframes movePaw1 {
    0% {transform: translate(0px, 0px);}

    50% {transform: translate(0px, -5px);}
    60% {transform: translate(0px, 0px);}
    70% {transform: translate(0px, -5px);}
    80% {transform: translate(0px, 0px);}
    90% {transform: translate(0px, -5px);}

    100{transform: translate(0px, 0px);}
}
@keyframes movePaw2 {
    0% {transform: translate(0px, 0px);}

    40% {transform: translate(0px, -4px);}
    50% {transform: translate(0px, 0px);}
    60% {transform: translate(0px, -5px);}
    70% {transform: translate(0px, 0px);}
    80% {transform: translate(0px, -3px);}

    100{transform: translate(0px, 0px);}
}

@keyframes moveWhisker {
    0%{transform: skewX(0deg);}
    50%{transform: skewX(0deg);}

    60% {transform: skewX(-10deg);}
    70% {transform: skewX(10deg);}
    80% {transform: skewX(-10deg);}
    90% {transform: skewX(10deg);}

    100%{transform: skewX(0deg);}
}
@keyframes moveWhisker {
    0%{transform: skewX(0deg);}
    50%{transform: skewX(0deg);}

    60% {transform: skewX(-5deg);}
    70% {transform: skewX(5deg);}
    80% {transform: skewX(-5deg);}
    90% {transform: skewX(5deg);}

    100%{transform: skewX(0deg);}
}

@keyframes hypnotize {
      0% {opacity: 100%;}
      25% {opacity: 50%;}
      50% {opacity: 5%;}
      75% {opacity: 50%;}
      100% {opacity: 99%;}
}

1 Like

Here is my code for the Animation Assignment
Animation.css

.movingHead{
    animation: moveHead 2s infinite;
}

@keyframes moveHead {
    0% {transform: rotate(0deg);
    }
    35% {transform: rotate(5deg);
    }
    70% {transform: rotate(-5deg);
    }
    100% {transform: rotate(0);
    }
}

.diggingHead{
    animation: digHead 4s infinite;
}

@keyframes digHead {
    0% {
        transform: translate(0px, 0px);
    }
    30% {
        transform: translate(0px, 5px);
    }
    60% {
        transform: translate(0px, -5px);
    }
    100% {
        transform: translate(0px, 0px);
    }    
}

.movingTail{
    animation:moveTail 2s infinite;
}

@keyframes moveTail{
    0% {
        transform: rotate(0deg);  
    }
    25% {
        transform: rotate(20deg);
    }
    50% {  
        transform: rotate(-10deg);   
    }
    100% {
        transform: rotate(0deg);   
    }
}

CatFactory.js

function animationVariation(num) {
    $('#dnaanimation').html(num)
    switch (num) {
        case 1:
            removeAnimation()
            $('#animationName').html('Still Head')          
            break
        case 2:
            removeAnimation()
            animationType1()
            $('#animationName').html('Moving Head')
            break
        case 3:
            removeAnimation()
            animationType2()
            $('#animationName').html('Moving Head & Ears');
            break
        case 4:
            removeAnimation()
            animationType3()
            $('#animationName').html('Moving Tail');
            break
    }
}


function animationType1(){
$('#head').addClass('movingHead');
}

function animationType2(){
    $('#head').addClass('diggingHead');
    $('.cat__ear').addClass('diggingHead')
}

function animationType3(){
    $("#tail").addClass("movingTail");  
}

// Add any animation class that you creat below
function removeAnimation(){ 
    $('#head').removeClass('movingHead');
    $('#head').removeClass('diggingHead');
    $('.cat__ear').removeClass('diggingHead')
    $('#tail').removeClass('movingTail');   
}

index.html

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Academy Kitties </title>
  <script type="text/javascript" src="assets/js/jquery-3.4.1.js"></script>
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  <script src="assets/bootstrap/js/popper.js"></script>
  <script src="assets/bootstrap/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="assets/css/Animations.css">
  <link rel="stylesheet" href="assets/css/mystyle.css">
  <link rel="stylesheet" href="assets/css/cats.css">
  <link rel="stylesheet" href="assets/css/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
</head>
  <body>
    <div class="container p-5" style="margin-top: 12vh;margin-bottom: 10vh;">
        <div align="center">
        <h1 class="c-white">Kitties-Factory</h1>
        <p class="c-white">Chantilly Kitty Laboratory</p>
    </div>
        <div class="row">
            <div class="col-lg-4 catBox m-2 light-b-grey">
                <div class="cat">
                    <div class="cat__ear">
                        <div id="leftEar" class="cat__ear--left">
                            <div class="cat__ear--left-inside"></div>
                        </div>
                        <div id="rightEar" class="cat__ear--right">
                            <div class="cat__ear--right-inside"></div>
                        </div>
                    </div>

                    <div id="head" class="cat__head">
                        <div id="midDot" class="cat__head-dots">
                            <div id="leftDot" class="cat__head-dots_first"></div>
                            <div id="rightDot" class="cat__head-dots_second"></div>
                        </div>
                        <div class="cat__eye">
                            <div class="cat__eye--left">
                                <span class="pupil-left"></span>
                            </div>
                            <div class="cat__eye--right">
                                <span class="pupil-right"></span>
                            </div>
                        </div>
                        <div class="cat__nose"></div>

                        <div class="cat__mouth-contour"></div>
                        <div class="cat__mouth-left"></div>
                        <div class="cat__mouth-right"></div>

                        <div class="cat__whiskers-left"></div>
                        <div class="cat__whiskers-right"></div>
                    </div>

                    <div class="cat__body">

                        <div class="cat__chest"></div>

                        <div class="cat__chest_inner"></div>


                        <div class="cat__paw-left"></div>
                        <div class="cat__paw-left_inner"></div>


                        <div class="cat__paw-right"></div>
                        <div class="cat__paw-right_inner"></div>


                        <div id="tail" class="cat__tail"></div>
                    </div>
                </div>
                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnamouth"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnaears"></span>
                         <span id="dnapaws"></span>
                        
                         <!-- Cattributes -->
                         <span id="dnashape"></span>
                         <span id="dnadecoration"></span>
                         <span id="dnadecorationMid"></span>
                         <span id="dnadecorationSides"></span>
                         <span id="dnaanimation"></span>
                         <span id="dnaspecial"></span>
                    </b>
                </div>
            </div>
            <div class="col-lg-7 cattributes m-2 light-b-grey">
        
<!-- Cat colors -->
<div id="catColors">
                <div class="form-group">
                    <label for="formControlRange"><b>Head and Body</b><span class="badge badge-dark ml-2" id="headcode"></span></label>
                    <input type="range" min="9" max="98" class="form-control-range" id="bodycolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Ears and Tail</b><span class="badge badge-dark ml-2" id="earscode"></span></label>
                    <input type="range" min="9" max="98" class="form-control-range" id="earscolor">
                </div>
                 <div class="form-group">
                    <label for="formControlRange"><b>Eyes and Mouth</b><span class="badge badge-dark ml-2" id="eyescode"></span></label>
                    <input type="range" min="9" max="98" class="form-control-range" id="eyescolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Paws</b><span class="badge badge-dark ml-2" id="pawscode"></span></label>
                    <input type="range" min="9" max="98" class="form-control-range" id="pawscolor">
                </div>
                 <div class="form-group">
                    <label for="formControlRange"><b>Eyes Shape</b><span class="badge badge-dark ml-2" id="eyeName"></span></label>
                    <input type="range" min="1" max="7" class="form-control-range" id="eyeshape">
                 </div>
                 <div class="form-group">
                    <label for="formControlRange"><b>Head Decoration Shape</b><span class="badge badge-dark ml-2" id="decorationName"></span></label>
                    <input type="range" min="1" max="7" class="form-control-range" id="decorationshape">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Head Middle Decoration</b><span class="badge badge-dark ml-2" id="midDecorName"></span></label>
                    <input type="range" min="11" max="98" class="form-control-range" id="middleDecorationColor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>Head Sides Decoration</b><span class="badge badge-dark ml-2" id="leftRightDecorName"></span></label>
                    <input type="range" min="1" max="98" class="form-control-range" id="sidesDecorationColor">
                </div>    
                <div class="form-group">
                    <label for="formControlRange"><b>Animations</b><span class="badge badge-dark ml-2" id="animationName"></span></label>
                    <input type="range" min="1" max="4" class="form-control-range" id="animation">
                </div>              
            </div>

            </div>

            </div>
            <br>

        </div>



    </div>
    <footer align="left">
        <p>Petrus Myburgh Kitty Oct 2021</p>
    </footer>

  </body>
  <script src="assets/js/colors.js"></script>
  <script src="assets/js/catSettings.js"></script>
  <script src="assets/js/catFactory.js"></script>

</html>

1 Like