Assignment - Template and Color

Here is my Kitty, she looks more funnier with changing colors. :smiley:

mycryptoKitty

index.html

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Ishoboy 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">
</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 customized Crypto 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 class="ear left_inside"></div>
                </div>
                    <div class="ear right_ear"> 
                <div class="ear right_inside"></div>
                </div>
            </div>
            <div id="body">
                <div class="eyes">
                    <div class="eye">
                        <div class="pupils"></div></div>
                        <div class="eye">
                       <div class="pupils"></div></div>
                </div>
                <div class="nose"></div>
                <div class="mouth_right"></div>
                <div class="mouth_left"></div>
                <div class="whiskers">
                    <div class="whisker_left1"></div>
                    <div class="whisker_left2"></div>
                    <div class="whisker_left3"></div>
                    <div class="whisker_left4"></div>
                    <div class="whisker_left5"></div>
                    <div class="whisker_right1"></div>
                    <div class="whisker_right2"></div>
                    <div class="whisker_right3"></div>
                    <div class="whisker_right4"></div>
                    <div class="whisker_right5"></div>                
                </div>
                <div class="chin"></div>
                <div class = "belly">
                    <div class="belly_2">
                    </div>
                </div>
                <div class="foot_left">
                </div>
                <div class="foot_right">
                </div>
            </div>
            <div class="body_2">
                <div class="tail">
                </div>
                <div class="tail_end">
                </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>
    <div class="form-group">
        <label for="formControlRange"><b>Tummy and Back</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>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="eyecolor">
    </div>
    
    <div class="form-group">
        <label for="formControlRange"><b>Mouth and Tail</b><span class="badge badge-dark ml-2" id="mouthTailcode"></span></label>
        <input type="range" min="10" max="98" class="form-control-range" id="mouthTailcolor">
    </div>

    </div>
    <br>

</div>

</div>
<footer align="left">
<p>Ishoboy Kitty Factory 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>

cats.css

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

#body{
    background-color: rgb(208, 171, 89);
    width: 200px;
    height: 200px;
    border-radius: 65% 65% 56% 56%;
    position: relative;
}

.eyes{
    position: relative;
    top: 30px;
    display: flex;
}

.eye{
    background-color: white;
    border-radius: 52%;
    width: 54px;
    height: 54px;
    margin: 23px;
    position: relative;
}

.pupils{
    background-color: rgb(14, 13, 13);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0px;
    position:absolute;
    top: 13px;
    left: 13px;
}

.ears{
    position: relative;
}

.ear{
    border-radius: 90px 0 90px 0;
    background-color: rgb(208, 171, 89);
    height: 100px;
    width: 100px;
    position: absolute;
}

.left_ear{
    left: 0;
    transform: scale(1, -1) rotate(
0deg
);
}

.right_ear{
    left: 90px;
}

.left_inside{
    border-radius: 90% 0 90px 0;
    background-color: #e84d48;
    width: 25px;
    height: 24px;
    position: relative;
    top: 70.5px;
    left: -3px;
    transform: scale(1, -1) rotate( 
117deg
 );
}

.right_inside{
    border-radius: 90% 0 90px 0;
    background-color: #e84d48;
    width: 25px;
    height: 24px;
    top: 7px;
    left: 78px;
    transform: scale(1, -1) rotate( 
312deg
 );
    position: relative;
}

.nose{
    background-color: rgb(235, 217, 214);
    border-radius: 10% 10% 80% 80%;
    position: relative;
    top: -43px;
    margin: 64px;
    width: 23px;
    height: 14px;
    left: 23px;
}

.mouth_right{
    width: 45px;
    height: 14px;
    border: solid 2.5px #000;
    border-color: #000 transparent transparent transparent;
    border-radius: 278%/81px 72px 0 0;
    transform: rotate( 
208deg
 );
    position: relative;
    top: -99px;
    left: 94px;
}

.mouth_left{
    width: 43px;
    height: 15px;
    border: solid 2.5px #000;
    border-color: #000 transparent transparent transparent;
    border-radius: 223%/81px 72px 0 0;
    transform: rotate( 
150deg
 );
    position: relative;
    top: -113px;
    left: 62px;
}

.whiskers{
    position: relative;
}

.whisker_left1{
    position: relative;
    width: 35px;
    height: 101px;
    border-top: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 203px;
    float: right;
    margin-left: 100px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -139px;
    left: -170px;
    transform: rotate( 
16deg
 );
}

.whisker_left2{
    position: relative;
    width: 35px;
    height: 104px;
    border-top: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 102px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -234px;
    left: -109px;
    transform: rotate( 
17deg
 );
}

.whisker_left3{
    position: relative;
    width: 35px;
    height: 104px;
    border-top: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 102px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -331px;
    left: -107px;
    transform: rotate( 
13deg
 );
}

.whisker_left4{
    position: relative;
    width: 32px;
    height: 104px;
    border-top: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 101px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -428px;
    left: -99px;
    transform: rotate( 
367deg
 );
}

.whisker_left5{
    position: relative;
    width: 37px;
    height: 196px;
    border-top: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 104px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -525px;
    left: -94px;
    transform: rotate( 
-4deg
 );
}

.whisker_right1{
    position: relative;
    width: 37px;
    height: 35px;
    border-left: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 100px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -746px;
    left: 60px;
    transform: rotate( 
75deg
 );
}

.whisker_right2{
    position: relative;
    width: 37px;
    height: 35px;
    border-left: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 100px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -775px;
    left: 60px;
    transform: rotate( 
75deg
 );
}

.whisker_right3{
    position: relative;
    width: 37px;
    height: 35px;
    border-left: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 100px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -803px;
    left: 60px;
    transform: rotate( 
75deg
 );
}

.whisker_right4{
    position: relative;
    width: 37px;
    height: 35px;
    border-left: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 100px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -831px;
    left: 59px;
    transform: rotate( 
80deg
 );
}

.whisker_right5{
    position: relative;
    width: 37px;
    height: 35px;
    border-left: 3.5px solid rgb(0 0 0 / 98%);
    border-top-left-radius: 200px;
    float: left;
    margin-left: 100px;
    box-shadow: inset 0 0px 0 rgb(0 0 0 / 0%);
    top: -860px;
    left: 58px;
    transform: rotate( 
83deg
 );
}

.chin{
    width: 28px;
    height: 6px;
    border: solid 2.5px #000;
    border-color: #000 transparent transparent transparent;
    border-radius: 220%/81px 72px 0 0;
    transform: rotate( 
179deg
 );
    position: relative;
    top: -116px;
    left: 86px;
}

.belly{
    background-color: rgb(208, 171, 89);
    width: 175px;
    height: 172px;
    border-radius: 60% 62% 17% 20%;
    top: -96px;
    left: 10px;
    position: relative;
}

.belly_2{
    background-color: rgb(235, 218, 182);
    width: 75px;
    height: 112px;
    border-radius: 68% 64% 0% 7%;
    position: absolute;
    left: 49px;
    top: 61px;
}

.foot_left{
    background-color: grey;
    height: 18px;
    width: 37px;
    position: relative;
    border-radius: 0 0px 10px 10px;
    top: -99px;
    left: 24px;
}

.foot_right{
    background-color: grey;
    height: 18px;
    width: 37px;
    position: relative;
    border-radius: 0 0px 10px 10px;
    top: -116px;
    left: 133px;
}

.body_2{
    background-color: rgb(208, 171, 89);
    height: 128px;
    width: 63px;
    position: relative;
    border-radius: 0 136px 78px 5px;
    top: 21px;
    left: 169px;
}

.tail{
    position: relative;
    width: 106px;
    height: 66px;
    border-top: 3.5px solid rgb(208, 171, 89);
    border-top-left-radius: 105px;
    float: right;
    margin-left: 152px;
    box-shadow: inset 0 -54px 0 rgb(0 0 0 / 0%);
    top: -896px;
    left: 63px;
    transform: rotate( 
153deg
 );
}

.tail_end{
    position: absolute;
    margin-top: 63px;
    margin-left: 130px;
    height: 10px;
    width: 9px;
    border-radius: 50%;
    background-color: rgb(123, 11, 3);
    z-index: 1;
    top: -131px;
    left: -31px;
}

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) {
    $('#body, .belly').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 tummyColor(color,code) {
    $('.belly_2, .body_2').css('background', '#' + color)
    $('#tummycode').html('code:' +code)
    $('#dnabody').html(code)
}

function eyeColor(color,code) {
    $('.eyes').css('background', '#' + color)
    $('#eyescode').html('code: ' +code)
    $('#dnaeyes').html(code)
}

function mouthTailColor(color,code) {
    $('.mouth_right, .mouth_left, .tail').css('background', '#' + color)
    $('#mouthTailcode').html('code:' +code)
    $('#dnamouth').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
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

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

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%" })
}

catSettings.js


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 96,
    "earsColor" : 10,
    //Cattributes
    "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)
    $('#bodycolor').val(dna.headcolor)

    tummyColor(colors[dna.tummycolor],dna.tummycolor)
    $('#tummycolor').val(dna.tummycolor)
    
    eyeColor(colors[dna.eyecolor],dna.eyecolor)
    $('#eyecolor').val(dna.eyecolor)

    mouthTailColor(colors[dna.mouthTailcolor],dna.mouthTailcolor)
    $('#mouthTailcolor').val(dna.mouthTailcolor)
}

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

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

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

$('#mouthTailcolor').change(() => {
  var colorVal = $('#mouthTailcolor').val()
  mouthTailColor(colors[colorVal],colorVal)
})
1 Like

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
}


//###################################################
//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
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

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

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%" })
}

catSettings.js


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 96,
    "earsColor" : 10,
    //Cattributes
    "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)
    $('#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)
})
$('#earscolor').change(()=>{
  var colorVal = $('#earscolor').val()
  earsColor(colors[colorVal],colorVal)
})
$('#mouthcolor').change(()=>{
  var colorVal = $('#mouthcolor').val()
  mouthColor(colors[colorVal],colorVal)
})

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">
</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="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>
                        
                         <!-- 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>

            </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>

Screenshot 2021-06-30 16.12.57 Here is my page so far!!!

2 Likes

The sliders are working. I found it hard to create the ears. Can you please assist with the ears. My code below:

catsettings:


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 96,
    "earsColor" : 10,
    //Cattributes
    "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)
    $('#bodycolor').val(dna.headcolor)
}

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

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

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

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

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

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_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 MTTColor(color,code) {
    $('.mouth, .tummy, .tail').css('background', '#' + color)  //This changes the color of the cat
    $('#MTTcode').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 eyeColor(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 earColor(color,code) {
    $('.ear').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
}



//###################################################
//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
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

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

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%" })
}

cat.css:

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

.ears{
    position: relative;
}
.ear{
   width: 0;
    height: 0;
    border-bottom: 50px solid rgb(255, 241, 196);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    position: relative;
}

.left_ear{
    top: 90px;
    left: -11px;
    transform: rotate(-46deg);
}
.right_ear{
    left: 162px;
    transform: rotate(42deg);
    top: 35px;
}
.cat_head{
    background-color: rgb(255, 241, 196);
    width: 200px;
    height: 200px;
    border-radius: 50%; 
}
.eyes{
    position: relative;
    top: 30px;
    display: flex;
}
.eye{
    background-color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin: 25px;
    position: relative;
}
.pupils{
    background-color: rgb(152, 155, 204);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 10px;
}

.mouth{
   border-radius: 140px 0px 90px 0px;
   background-color: rgb(224, 109, 109);
   height: 30px;
   width: 30px;
   position: absolute;
   transform: rotate(45deg);
   left: 152px;
   top: 280px;
}
.nose{
   border-radius: 0px 0px 90px 0px;
   background-color: rgb(105, 104, 99);
   height: 21px;
   width: 21px;
   position: absolute;
   left: 157px;
   top: 255px;
   transform: rotate(45deg);
}
.mustaches{
    position: relative;
}

.mustache_1{
    width: 216%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(120deg);
    left: 11px;
    top: -5px;
}

.mustache_2{
    width: 216%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(133deg);
    left: 17px;
    top: -1px;
}
.mustache_3{
    width: 216%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(147deg);
    left: 21px;
    top: 5px;
}

.mustache_4{
    width: 216%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(152deg);
    left: -27px;
    top: 33px;

}

.mustache_5{
    width: 216%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(140deg);
    left: -23px;
    top: 38px;
}
.mustache_6{
    width: 216%;
    position: absolute;
    height: 3px;
    background: grey;
    transform:  rotate(126deg);
    left: -18px;
    top: 42px;
}
.inner_ears{
    position: relative;
}
.inner_ear{
    border-radius: 0px 0px 0px 45px;
    background-color: grey;
    height: 20px;
    width: 20px;
    position: absolute;
 }
 .leftEar{
    transform: scale(1,-1) rotate(-180deg);
    left: 12px;
    top: 17px;
 }
 .rightEar{
    transform: rotate(0deg);
     left: 161px;
     top: 13px;
 }

.cat_body{
    background-color: rgb(255, 241, 196);
    width: 200px;
    height: 100px;
    border-radius: 25%; 
    margin-top: -7%;
}
.tummy{
    margin-top: -26%;
    margin-left: 18%;
    margin-right: auto;
    height: 30px;
    width: 60px;
    border-radius: 50px 50px 0 0;
    background-color: #F4E7D1;
}
.toes{
    position: relative;
}
.toe_1{
    width: 50%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(96deg);
    left: -25px;
    top: 82px;
}

.toe_2{
    width: 50%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(96deg);
    left: -32px;
    top: 82px;
}
.toe_3{
    width: 50%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(96deg);
    left: -39px;
    top: 82px;
}

.toe_4{
    width: 50%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(86deg);
    left: 60px;
    top: 82px;
}

.toe_5{
    width: 50%;
    position: absolute;
    height: 3px;
    background: grey;
    transform: rotate(86deg);
    left: 67px;
    top: 82px;
}
.toe_6{
    width: 50%;
    position: absolute;
    height: 3px;
    background: grey;
    transform:  rotate(86deg);
    left: 74px;
    top: 82px;
}
.tail{
    width: 82px;
    border-radius: 76%;
    margin-top: 10%;
    margin-left: 34%;
    margin-right: auto;
    position: absolute;
    border: 15px solid rgb(255, 241, 196);
    display: inline-block;
    z-index: 0;
}


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">
</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_ear leftEar"></div>               
                      <div class="inner_ear rightEar"></div> 
                    </div>
                    <div class="cat_head">
                        <div class="eyes">
                            <div class="eye">
                              <div class="pupils"></div>
                            </div>                  
                            <div class="eye">
                              <div class="pupils"></div>
                            </div>
                        </div>
                        <div class="nose">
                            <div class="mustaches">
                                <div class="mustache_1"></div>
                                <div class="mustache_2"></div>
                                <div class="mustache_3"></div>
                                <div class="mustache_4"></div>
                                <div class="mustache_5"></div>
                                <div class="mustache_6"></div>
                            </div>
                        </div>               
                        <div class="mouth"></div>
                    </div>
                
                    <div class="cat_body">
                        <div class="tail"></div>
                    </div>
                    <div class="tummy">
                       <div class="toes">
                          <div class="toe_1"></div>
                          <div class="toe_2"></div>
                          <div class="toe_3"></div>
                          <div class="toe_4"></div>
                          <div class="toe_5"></div>
                          <div class="toe_6"></div>
                        </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>Mouth, Tummy and Tail</b><span class="badge badge-dark ml-2" id="MTTcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="MTTcolor">
                </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>Ear</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>

            </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>

@AdamFortuna I’ve been stucked for the past days now with some issues…firstly which python server do you use, secondly how did you fire it up and get our cloned repository on it.IMG-20210704-WA0034

pls help me explain here so u can continue with my learning

Checkout the typos. Like headcolor you are missing the capital “C” so i notice

Is capital C. Check each property carefully.

hey bro pls can you help by showing me the python live server being used and how it’s set up?

hey @Phaxsam i show in simple steps.

1) Install python 3 (3.9 for example)

2) Go to your folder from CMD or powerShell. In windows is cd /your_folder_location

1) Once you are located in the folder run the this commnad on CMD windown python3 -m http.server

Thats will start server by default on port 8000. To open that server into a browser just type in the url localhost/8000

Default location will be your index.html file.
If you are using visual code studio as a code editor is better to install the LiveServer plugin wich its have a server easy to use with a single click on visual code studio.

Hopes this help.

1 Like

still getting this…pls can you do a screen record for me

I’ll so much appreciate it

Where are you getting stuck ? Did you try LiveServer from visual code?
It its just as i descripbe. You can also watch a short video tutorial.

yes…I installed the extension but I don’t still know how to go about it

Try running python -m http.server 8000 in your command prompt. just without “python3” just “python”.
i had the same issue and when i try to run it with just python it worked somehow.

1 Like

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">
</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="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>
                        
                         <!-- 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>

            </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) {
    $('.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 eyeVariation(num) {

    $('#dnashape').html(num)
    switch (num) {
        case 1:
            normalEyes()
            $('#eyeName').html('Basic')
            break
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

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

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%" })
}

CatSettings.js


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 96,
    "earsColor" : 10,
    //Cattributes
    "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)
    $('#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)
})
$('#earscolor').change(()=>{
  var colorVal = $('#earscolor').val()
  earsColor(colors[colorVal],colorVal)
})
$('#mouthcolor').change(()=>{
  var colorVal = $('#mouthcolor').val()
  mouthColor(colors[colorVal],colorVal)
})
1 Like

okay…I’m trying that now

I had no choice but use Filip’s coding. My cat’s code was very stressful to work with once it was much simpler and hard to make it look even near to Filip’s. The stress to make it work is not worth it. Filip’s coding is basically flawless.
Here is what I got!Shot 0012

1 Like

Just letting you know your work helped me tremendously to understand how this assignment should be done. Big thank you!

2 Likes

Hello! I modified the shape of the template cat slightly, added contours and some stars on the forehead. The colors of my cat are in grayscale except for the eyes.

I also migrated the template code to Bootstrap 5 and applied auto-formatting using Prettier, in case you were wondering.

Now here is my solution for the assignment:

Screenshot
Screenshot from 2021-07-06 21-07-54

index.html

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My DApp</title>

    <link
      href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
      crossorigin="anonymous"
    />
    <script
      src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
      crossorigin="anonymous"
    ></script>

    <script type="text/javascript" src="assets/js/jquery-3.6.0.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" />
  </head>

  <body>
    <main>
      <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 justify-content-center">
          <div
            class="
              col-lg-4
              catBox
              m-2
              light-b-shadow
              position-relative
              d-flex
              justify-content-center
              text-center
            "
          >
            <!-- CAT HTML -->
            <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">
                  <span class="star1">&#128964;</span>
                  <span class="star2">&#128964;</span>
                  <span class="star3">&#128964;</span>
                </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>
            <div
              class="
                dnaDiv
                position-absolute
                bottom-0
                start-50
                translate-middle-x
              "
              id="catDNA"
            >
              <b class="">
                DNA:
                <!-- Colors -->
                <span id="dnaouter"></span>
                <span id="dnainner"></span>
                <span id="dnaeyes"></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-6 cattributes m-2 light-b-shadow">
            <!-- Cat colors -->
            <div id="catColors">
              <div class="mb-3">
                <label for="outercolor"
                  ><b>Outer Color</b
                  ><span class="badge bg-dark ms-2" id="outercode"></span
                ></label>
                <input
                  type="range"
                  min="10"
                  max="90"
                  class="form-range"
                  id="outercolor"
                />
              </div>
              <div class="mb-3">
                <label for="innercolor"
                  ><b>Inner Color</b
                  ><span class="badge bg-dark ms-2" id="innercode"></span
                ></label>
                <input
                  type="range"
                  min="10"
                  max="90"
                  class="form-range"
                  id="innercolor"
                />
              </div>
              <div class="mb-3">
                <label for="eyescolor"
                  ><b>Eyes Color</b
                  ><span class="badge bg-dark ms-2" id="eyescode"></span
                ></label>
                <input
                  type="range"
                  min="100"
                  max="460"
                  class="form-range"
                  id="eyescolor"
                />
              </div>
            </div>
          </div>
        </div>
        <br />
      </div>
    </main>

    <footer align="left">
      Ivan on Tech Academy - Ethereum DApp Programming Course 2021
    </footer>

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

catSettings.js

var defaultDNA = {
  //Colors
  outerColor: 20,
  innerColor: 20,
  eyesColor: 300,
  //Cattributes
  eyesShape: 1,
  decorationPattern: 1,
  decorationMidcolor: 13,
  decorationSidescolor: 13,
  animation: 1,
  lastNum: 1,
};

// when page load
$(document).ready(function () {
  renderCat(defaultDNA);
});

function getDna() {
  var dna = "";
  dna += $("#dnaouter").html();
  dna += $("#dnainner").html();
  dna += $("#dnaeyes").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) {
  $("#outercolor").val(dna.outerColor).change();
  $("#innercolor").val(dna.innerColor).change();
  $("#eyescolor").val(dna.eyesColor).change();
}

// Changing cat colors
$("#outercolor").change(() => {
  var val = $("#outercolor").val();
  outerColor(val);
});
$("#innercolor").change(() => {
  var val = $("#innercolor").val();
  innerColor(val);
});
$("#eyescolor").change(() => {
  var val = $("#eyescolor").val();
  eyesColor(val);
});

catFactory.js

function outerColor(code) {
  //This changes the color of the cat
  const color = parseInt(code);
  $(`.cat__head,
    .cat__chest,
    .cat__ear--right,
    .cat__ear--left,
    .cat__paw-left,
    .cat__paw-right,
    .cat__paw-left_inner,
    .cat__paw-right_inner,
    .cat__tail`).css("background", `hsl(0,0%,${color}%)`);

  $("#outercode").html("code: " + code); //This updates text of the badge next to the slider
  $("#dnaouter").html(code); //This updates the body color part of the DNA that is displayed below the cat
}

function innerColor(code) {
  const color = parseInt(code);
  $(`.cat__mouth-contour,
    .cat__chest_inner,
    .cat__ear--left-inside,
    .cat__ear--right-inside`).css("background", `hsl(0,0%,${color}%)`);

  $("#innercode").html("code: " + code); //This updates text of the badge next to the slider
  $("#dnainner").html(code); //This updates the body color part of the DNA that is displayed below the cat
}

function eyesColor(code) {
  //This changes the color of the cat
  const color = parseInt(code) - 100;
  $(".cat__eye span").css("background", `hsl(${color}, 100%, 40%)`);

  $("#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
}
1 Like

myKitty Template and Color
myKittyTemplateAndColor

myKitty 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">
    </head>
    <body>
        <div class="container p-5" style="margin-top: 12vh;margin-bottom: 10vh;">
            <div align="center">
            <h1 class="c-white">My Kitties-Factory</h1>
            <p class="c-white">Create your custom Kitty</p>
        </div>
        <div class="row">
            <div class="col-lg-5 catBox m-2 light-b-shadow">
                <div class="cat">
                    <div class="cat__ears">
                        <div class="ear left_ear"></div>
                        <div class="ear right_ear"></div>
                    </div>
                    <div id="head" class="cat__head">
                        <div class="eyes">
                            <div class="eye left_eye">
                                <div class="pupil_left"></div>
                            </div>
                            <div class="eye right_eye">
                                <div class="pupil_right"></div>
                            </div>
                        </div>
                        <div class="nose"></div>
                        <div class="mouth">
                            <div class="tongue"></div>
                        </div>
                    </div>
                    <div id="tail" class="cat__tail">
                        <div class="tail_shaft"></div>
                        <!-- <div class="tail_flick"></div> -->
                    </div>
                    <div id="body" class="cat__body">
                        <div class="cat__chest"></div>
                    </div>
                    <div id="paws" class="cat__paws">
                        <div class="paw left_paw">
                            <div class="toe-pads">
                                <div class="toe-pad1"></div>
                                <div class="toe-pad2"></div>
                                <div class="toe-pad3"></div>
                            </div>
                            <div class="palm-pad"></div>
                        </div>
                        <div class="paw right_paw">
                            <div class="toe-pads">
                                <div class="toe-pad1"></div>
                                <div class="toe-pad2"></div>
                                <div class="toe-pad3"></div>
                            </div>
                            <div class="toe-pad"></div>
                            <div class="palm-pad"></div>
                        </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-6 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>Mouth, Chest, Tail </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</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>
            </div>
        </div>
        <br>
        <footer align="left">
            <p>Sean Babb 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>

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

.cat__ears{
    position: relative;
}
.ear{
    border-radius: 90% 0 90% 0;
    background-color: rgb(255, 191, 0);
    height: 100px;
    width: 100px;
    position: absolute;
}
.left_ear{
    transform: scale(1, -1) rotate(0deg);
    left: 0;
}
.right_ear{
    left: 100px;
}

.cat__head{
    background-color: rgb(255, 191, 0);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: relative;
}
.eyes{
    position: relative;
    top: 30px;
    display: flex;
}
.left_eye{
    background-color: white;
    border-radius: 70% 15% 70% 15%;
    width: 50px;
    height: 50px;
    margin: 25px;
    position: relative;
}
.right_eye{
    background-color: white;
    border-radius: 15% 70% 15% 70%;
    width: 50px;
    height: 50px;
    margin: 25px;
    position: relative;
}
.pupil_left{
    background-color: black;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: absolute;
    top: 18px;
    left: 10px;
}
.pupil_right{
    background-color: black;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: absolute;
    top: 18px;
    left: 10px;
}
.nose{
    position: relative;
    width: 100px;
    height: 30px;
}
.nose::before,
.nose::after{
    position: absolute;
    content: "";
    left: 100px;
    top: 0px;
    width: 20px;
    height: 30px;
    background: rgb(64, 224, 208);
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}
.nose::after{
    left: 80px;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}
.mouth{
    background-color: rgb(238, 130, 238);
    width: 80px;
    height: 30px;
    border-radius: 10px 10px 40px 40px;
    position: relative;
    margin: 10px 0 0 60px;
}
.tongue{
    background: rgb(229, 43, 80);
    width: 30px;
    height: 35px;
    border-radius: 20% 20% 40% 40%;
    position: relative;
    top: 12px;
    left: 25px;
}
.cat__body{
    background-color: rgb(255, 191, 0);
    width: 245px;
    height: 250px;
    border-radius: 40% 40% 15% 15%;
}
.cat__chest{
    background-color: rgb(255, 160, 220);
    width: 150px;
    height: 200px;
    border-radius: 45% 45% 40% 40% ;
    margin: 0px 0 0px 50px;
    position: relative;
    top: 25px;
}
.cat__paws{
    position: relative;
    display: flex;
    justify-content: flex-start;
}
.paw{
    background-color: rgb(185, 106, 15);
    border-radius: 50%;
    width: 100px;
    height: 100px;
}
.left_paw{
    margin: -15px 0 0 0;
    padding: 5px;
    position: absolute;
    top: -75px;
    left: 3px;
}
.right_paw{
    margin: -15px 0px 0 0;
    padding: 5px;
    position: absolute;
    top: -75px;
    left: 140px;
}
.toe-pads{
    position: relative;
    display: flex;
}
.toe-pad1{
    background-color: rgb(64, 224, 208);
    border-radius: 50%;
    width: 20px;
    height: 25px;
    position: absolute;
    margin: 15px 0 0 15px;
}
.toe-pad2{
    background-color: rgb(64, 224, 208);
    border-radius: 50%;
    width: 20px;
    height: 25px;
    position: absolute;
    margin: 5px 0 0 40px;
}
.toe-pad3{
    background-color: rgb(64, 224, 208);
    border-radius: 50%;
    width: 20px;
    height: 25px;
    position: absolute;
    margin: 15px 0 0 65px;
}
.palm-pad{
    position: relative;
    width: 100px;
    height: 90px;
}
.palm-pad::before,
.palm-pad::after{
    position: absolute;
    content: "";
    left: 50px;
    top: 48px;
    width: 20px;
    height: 30px;
    background: rgb(64, 224, 208);
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}
.palm-pad::after{
    left: 30px;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}
.cat__tail{
    position: relative;
}
.tail_shaft{
    background-color: rgb(255, 191, 0);
    width: 150px;
    height: 45px;
    border-radius: 0 55% 38% 0;
    position: absolute;
    top: 190px;
    left: 155px;
}
myKitty catSettings.js

var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 96,
    "earsColor" : 10,
    //Cattributes
    "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);

  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)
    mouthColor(colors[dna.mouthcolor],dna.mouthcolor)
    $('#mouthcolor').val(dna.mouthcolor)
    eyesColor(colors[dna.eyescolor],dna.eyescolor)
    $('#eyescolor').val(dna.eyescolor)
    earsColor(colors[dna.earscolor],dna.earscolor)
    $('#earscolor').val(dna.earscolor)
}

// Changing cat colors
$('#bodycolor').change(()=>{
    var colorVal = $('#bodycolor').val()
    headColor(colors[colorVal],colorVal)
})
$('#mouthcolor').change(()=>{
    var colorVal = $('#mouthcolor').val()
    mouthColor(colors[colorVal],colorVal)
})
$('#eyescolor').change(()=>{
    var colorVal = $('#eyescolor').val()
    eyesColor(colors[colorVal],colorVal)
})
$('#earscolor').change(()=>{
    var colorVal = $('#earscolor').val()
    earsColor(colors[colorVal],colorVal)
})
myKitty 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
}

function headColor(color,code) {
    $('.cat__head, .cat__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 mouthColor(color,code) {
    $('.mouth, .cat__chest, .tail_shaft').css('background', '#' + color)  //This changes the color of the cat's mouth, chest, and tail
    $('#mouthcode').html('code: ' + code) //This updates text of the badge next to the slider
    $('#dnamouth').html(code) //This updates the mouth color part of the DNA that is displayed below the cat
}
function eyesColor(color,code) {
    $('.left_eye, .right_eye').css('background', '#' + color)  //This changes the color of the cat's eyes
    $('#eyescode').html('code: ' + code) //This updates text of the badge next to the slider
    $('#dnaeyes').html(code) //This updates the eyes color part of the DNA that is displayed below the cat
}
function earsColor(color,code) {
    $('.left_ear, .right_ear').css('background', '#' + color)  //This changes the color of the cat's ears
    $('#earscode').html('code: ' + code) //This updates text of the badge next to the slider
    $('#dnaears').html(code) //This updates the ears color part of the DNA that is displayed below the cat
}
1 Like

here is the code with my own cat…

<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">
</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 = "wiskers">
                        <div class = "wisker left_top" style="left:-8px; transform: scale(1,-1) rotate(-15deg);"></div>
                        <div class = "wisker right_top" style="left:180px; transform:rotate(-15deg);"></div>
                        <div class = "wisker left_middle" style="left:-8px; top:10px; transform: scale(1,-1);"></div>
                        <div class = "wisker right_middle" style="top:10px; left:180px;"></div>
                        <div class = "wisker left_bottom" style="left:-8px; top:20px; transform: scale(1,-1) rotate(15deg);"></div>
                        <div class = "wisker right_bottom" style="top:20px; left:180px; transform:rotate(15deg);"></div>
                    </div>
                    <div class="cat__ears">
                        <div class="ear left_ear" style="transform: scale(1,-1) rotate(10deg);"></div>
                        <div class="ear right_ear" style="left:100px;"></div>  
                        <div class="inner_ear left_ear" style="transform: scale(1,-1) rotate(10deg);"></div>
                        <div class="inner_ear right_ear" style="left:140px"></div>          
                    </div>

                    <div class = "cat__head">

                        <div class = "cat__eye">
                                <div class ="eye">
                                    <div class = "pupils"></div>
                                </div>
                                <div class ="eye">
                                    <div class = "pupils"></div>
                                </div>
                        </div>
                        <div class = "mouth_area">
                            <div class = "nose"></div>
                            <div class="mouths">
                                <div class ="mouth left"></div>
                                <div class ="mouth right" style="left:38px"></div>
                            </div>
                        </div>
                    </div> 

                    <div class ="feet">
                        <div class = "back_foot left"></div>
                        <div class = "back_foot right" style="left:120px"></div>
                    </div>
                    <div id = "body" class ="cat__chest">
                        <div class = "belly"></div>
                    </div>
                    <div class ="feet">
                        <div class = "front_foot left"></div>
                        <div class = "front_foot right" style="left:60px"></div>
                    </div>
                    <div class ="tail" style ="transform:rotate(45deg);"></div>
                </div>
        
        
                <!--
                   <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>
                <br>
                <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">
                    <label for="formControlRange"><b>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">
                    <label for="formControlRange"><b>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">
                    <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>

            </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>


var colors = Object.values(allColors())

var defaultDNA = {
    "headcolor" : 10,
    "mouthColor" : 13,
    "eyesColor" : 15,
    "earsColor" : 15,
    //Cattributes
    "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)
    $('#bodycolor').val(dna.headcolor)
    eyeColor(colors[dna.eyesColor],dna.eyesColor)
    $('#eyecolor').val(dna.eyesColor)

}

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

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

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

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


//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
}

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

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

//Change mouth color
function mouthColor(color,code) {
    $('.mouth_area').css('background', '#' + color)  //This changes the Ear color of the cat
    $('#mouthcode').html('code: '+code) //This updates text of the badge next to the slider
    $('#dnamouth').html(code) //This updates the Ear 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
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

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

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%" })
}

Here is my cat!

Screen Shot 2021-07-14 at 10.07.17 AM

Here is my code:
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_body, .cat_head, .cat_ear').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 pawColor(color,code) {
    $('.front_foot, .back_foot').css('background', '#' + color)  //This changes the color of the cat
    $('#pawcode').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 tailColor(color,code) {
    $('.tail_section').css('background', '#' + 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 eyeColor(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
}


//###################################################
//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
    }
}

function decorationVariation(num) {
    $('#dnadecoration').html(num)
    switch (num) {
        case 1:
            $('#decorationName').html('Basic')
            normaldecoration()
            break
    }
}

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

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%" })
}

catsettings.js


var colors = Object.values(allColors())

var defaultDNA = {
    "headColor" : 10,
    "tailColor" : 10,
    "eyesColor" : 10,
    "pawsColor" : 10,
    //Cattributes
    "eyesShape" : 1,
    "decorationPattern" : 1,
    "decorationMidcolor" : 13,
    "decorationSidescolor" : 13,
    "animation" :  1,
    "lastNum" :  1
    }

// when page load
$( document ).ready(function() {
  $('#dnabody').html(defaultDNA.headColor);
  $('#dnatail').html(defaultDNA.tailColor);
  $('#dnaeyes').html(defaultDNA.eyesColor);
  $('#dnapaws').html(defaultDNA.ears_pawsColor);
    
//   $('#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 += $('#dnatail').html()
    dna += $('#dnaeyes').html()
    dna += $('#dnapaws').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)

    pawColor(colors[dna.pawsColor],dna.pawsColor)
    $('#pawcolor').val(dna.pawsColor)

    tailColor(colors[dna.tailColor],dna.tailColor)
    $('#tailcolor').val(dna.tailColor)

    eyeColor(colors[dna.eysColor],dna.eyesColor)
    $('#eyecolor').val(dna.eyesColor)
}

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

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

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

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

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/colors.css">
  <link rel="stylesheet" href="assets/css/factory.css">
  <link rel="stylesheet" href="assets/css/frontend.css">
  <link rel="stylesheet" href="assets/css/myCats.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-6 catBox m-2 light-b-shadow">


                <div id = "cat">
                    <div class = "cat_ears"> 
                        <div class = "cat_ear_border" style= "  transform: scale(1,-1) rotate(-10deg); ">
                            <div class = "cat_ear" style = "transform: scale(.97,.97);">
                                <div class = "cat_ear_inner" style= "  transform: scale(.75,.75); "></div>
                            </div>
                        </div>
                        <div class = "cat_ear_border" style = " left: 87px; transform: rotate(-10deg);">
                            <div class = "cat_ear " style = "transform: scale(.97,.97);">
                                <div class = "cat_ear_inner" style= "  transform: scale(.75,.75); "></div>
                            </div>
                        </div>
                    </div>
                    <div class = "cat_tail">
                        <div class = "tail_border_group">
                            <div class = "tail_border b1">
                                <div class = "tail_border b2">
                                    <div class = "tail_border b3">
                                        <div class = "tail_border b4">
                                            <div class = "tail_border b5">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class = "tail_section_group">
                            <div class = "tail_section s1">
                                <div class = "tail_section s2">
                                    <div class = "tail_section s3">
                                        <div class = "tail_section s4">
                                            <div class = "tail_section s5">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class = "back_feet">
                        <div class = "back_foot_border" style= " left: -32;">
                            <div class = "back_foot right_foot" style= "transform: scale(.97,.93); "></div>
                        </div>
                        <div class = "back_foot_border" style= " left: 60; transform: scale(-1,1);">
                            <div class = "back_foot right_foot" style= "transform: scale(.97,.93); "></div>
                        </div>
                    </div>
                    <div class = "cat_body_border">
                    </div>
                    <div class = "cat_body">
                        <div class = "innerbody">
                            <div class = "front_feet">
                                <div class = "front_foot_border" style= " left: -7; transform: rotate(-36deg) ">
                                    <div class = "front_foot right_foot" style= " top: -2; transform: scale(.97,1); "></div>
                                </div>
                                <div class = "front_foot_border" style= " left: 47; transform: rotate(36deg) ;">
                                    <div class = "front_foot left_foot" style= "top: -2; transform: scale(.97,1); "></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class = "cat_head_border"></div>
                    <div class = "cat_head">
                        <div class = "eyes">
                            <div class = "eye">
                                <div class = "pupils">
                                    <div class = "pupils_shine">
                                        <div class = "pupils_shine" style= "top: 12; left: -5; transform: scale(.6,.6); "></div>
                                    </div>
                                    
                                </div>
                            </div>
                            <div class = "eye">
                                <div class = "pupils">
                                    <div class = "pupils_shine">
                                        <div class = "pupils_shine" style= "top: 12; left: -5; transform: scale(.6,.6); "></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <img class = whiskers src="./assets/css/png/whiskers.png">
                        <img class = mouth src="./assets/css/png/mouth1.png">
                    </div>
                </div>

                
                <br>
                <div class="dnaDiv" id="catDNA">
                    <b>
                        DNA:
                        <!-- Colors -->
                         <span id="dnabody"></span>
                         <span id="dnatail"></span>
                         <span id="dnaeyes"></span>
                         <span id="dnapaws"></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-4 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>Tail</b><span class="badge badge-dark ml-2" id="tailcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="tailcolor">
                </div>
                <div class="form-group">
                    <label for="formControlRange"><b>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>Paws</b><span class="badge badge-dark ml-2" id="pawcode"></span></label>
                    <input type="range" min="10" max="98" class="form-control-range" id="pawcolor">
                </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>

myCats.css

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



#cat{
    left: 70px;
    right: 70px;
    top: 0px;
    bottom: 50px;
    height: 250px;
    width: 250px;
    position:relative;
}

.cat_body{
    width: 200px;
    height: 130px;
    background-color: rgb(97, 255, 158);
    border-radius: 50% 50% 50% 50% / 100% 100% 20% 20%;
    top: 166;
    left: 2;
    position: absolute;
}

.cat_body_border{
    width: 204px;
    height: 132px;
    background-color: rgb(0, 0, 0);
    border-radius: 50% 50% 50% 50% / 100% 100% 20% 20%;
    top: 165;
    position: absolute;
}

.innerbody{
    width: 110px;
    height: 108px;
    background-color: rgb(249, 237, 206);
    border-radius: 50% 50% 50% 50% / 100% 100% 20% 20%;
    margin: 20px 0px 30px 45px;
    position: relative;
}

.cat_tail{
    border-radius: 50%;
    top: 245;
    left: 105;
    position: absolute;
}

.tail_border_group{
    
    top: 0;
    left: 0;
    position: relative;
}

.tail_border{
    height: 34px;
    width: 94px;
    background-color: rgb(0, 0, 0);
    border-radius: 50%;
    top: -19;
    left: 23;
    position: relative;
}

.tail_section_group{
    top: -32;
    left: 2;
    position: relative;
}

.tail_section{
    height: 30px;
    width: 90px;
    background-color: rgb(97, 255, 158);
    
    border-radius: 50%;
    top: -19;
    left: 23;
    position: relative;
}


.back_feet{
    border-radius: 50%;
    top: 266;
    position: absolute;
    display: flex;
}

.back_foot_border{
    height: 30px;
    width: 90px;
    background-color: rgb(0, 0, 0); ;
    border-radius: 90% 25% 0% 25%;
    position: relative;
}

.back_foot{
    height: 30px;
    width: 90px;
    background-color: rgb(97, 255, 158);
    border-radius: 90% 25% 0% 25%;
    position: relative;
}

.front_feet{
    border-radius: 50%;
    border-color: rgb(44, 63, 51);
    top: 55;
    position: absolute;
    display: flex;
}

.front_foot_border{
    height: 70px;
    width: 35px;
    background-color: rgb(0, 0, 0); 
    border-radius: 0% 0% 50% 50%;
    position: relative;
}
.front_foot{
    height: 70px;
    width: 35px;
    background-color: rgb(97, 255, 158);
    border-radius: 0% 0% 50% 50%;
    position: relative;
}


.cat_head{
    background-color:rgb(97, 255, 158);
    border-color: black;
    width: 200px;
    height: 200px;
    border-radius: 50% 50% 50% 50% ;
    position: absolute;
    
}

.cat_head_border{
    background-color:rgb(0, 0, 0);
    width: 204px;
    height: 201px;
    top: -2px;
    left: -2px;
    border-radius: 50% 50% 50% 50% ;
    position: absolute;
    
}

.eyes{
    position: relative;
    top: 30px;
    display: flex;
}

.eye{
    background-color: #fff;
    border-radius: 50%;
    top: -10px;
    width: 68px;
    height: 72px;
    margin: 18px;
    position: relative;
}
.pupils{
    background-color: black;
    border-radius: 50%;
    width: 57px;
    height: 64px;
    position: absolute;
    top: 3px;
    left: 3px;
}
.pupils_shine{
    background-color: rgb(255, 255, 255);
    border-radius: 50%;
    width: 13px;
    height: 13px;
    position: absolute;
    top: 12px;
    left: 8px;
}

.whiskers{
    transform: scaleX(.45) scaleY(.45);
    position: absolute;
    left: -130px;
    top: -115px;
}

.mouth{
    transform: scaleX(.25) scaleY(.25);
    position: absolute;
    left: -45px;
    top: -20px;
}


.cat_ears{
    left: -2px;
    top:-8px;
    position: relative;
}
.cat_ear_border{
    background-color: black;
    border-radius: 90% 0 90% 0 ;
    width: 115px;
    height: 115px;
    
    position: absolute;
}

.cat_ear{
    background-color:rgb(97, 255, 158);
    border-radius: 90% 0 90% 0 ;
    width: 115px;
    height: 115px;
    
    position: absolute;
}
.cat_ear_inner{
    background-color: rgb(249, 237, 206);
    border-radius: 90% 0 90% 0 ;
    width: 115px;
    height: 115px;
    
    position: absolute;
}
1 Like