Skip to content
Snippets Groups Projects
Commit 4aa5dab9 authored by deepdigger's avatar deepdigger
Browse files

added gifs for eyes, mouth and character and included it in the js

parent d185a19c
1 merge request!8Merge Changes into custom-server, mainly paint-functionality
*.kra~ *.kra*
\ No newline at end of file paintnet/*
*.log
client/res/MouthsAndEyes.gif

17 KiB

client/res/pi.gif

11 KiB

client/res/selectArrows.gif

6.68 KiB

...@@ -23,7 +23,7 @@ export default class SkribblMenu extends HTMLElement { ...@@ -23,7 +23,7 @@ export default class SkribblMenu extends HTMLElement {
border:none; border:none;
height:34px; height:34px;
width:34px; width:34px;
background: url('/res/selectArrows.png'); background: url('/res/selectArrows.gif');
background-size: 54px; background-size: 54px;
background-repeat: no-repeat; background-repeat: no-repeat;
cursor: pointer; cursor: pointer;
...@@ -74,6 +74,11 @@ export default class SkribblMenu extends HTMLElement { ...@@ -74,6 +74,11 @@ export default class SkribblMenu extends HTMLElement {
justify-content: center; justify-content: center;
position: relative; position: relative;
} }
#avatar-container{
flex: 0 0 auto;
width:66px;
height:96px;
}
......
...@@ -15,20 +15,23 @@ ...@@ -15,20 +15,23 @@
border-radius: 5px; border-radius: 5px;
} }
.container-character{ .container-character{
border: 2px solid #777; background:url("/res/pi.gif");
border-radius: 10px; background-size:contain;
background-repeat: no-repeat;
} }
.character-eyes{ .character-eyes{
height: 34px; height: 34px;
width: 34px; width: 68px;
background:url("/res/MouthsAndEyes.png"); background:url("/res/MouthsAndEyes.gif");
background-position: 10px 0; background-position: 25px 18px;
background-repeat: no-repeat;
} }
.character-mouth{ .character-mouth{
height: 34px; height: 34px;
width: 34x; width: 68x;
background:url("/res/MouthsAndEyes.png"); background:url("/res/MouthsAndEyes.gif");
background-position: 0px -52px; background-position: 24px -32px;
background-repeat: no-repeat;
} }
</style> </style>
...@@ -43,26 +46,31 @@ ...@@ -43,26 +46,31 @@
/** @param {boolean} toTheRight */ /** @param {boolean} toTheRight */
changeEye(toTheRight) { changeEye(toTheRight) {
let displacement = 80; let displacement = 38;
if (toTheRight){ if (toTheRight){
this.eyesDisplacement += displacement; this.eyesDisplacement += displacement;
}else{ }else{
this.eyesDisplacement -= displacement; this.eyesDisplacement -= displacement;
} }
if(this.eyesDisplacement>266){
this.eyesDisplacement = 10;
}
const eye = this.shadowRoot.getElementById("eyes"); const eye = this.shadowRoot.getElementById("eyes");
eye.style.backgroundPositionX = this.eyesDisplacement+"px"; eye.style.backgroundPositionX = this.eyesDisplacement+"px";
} }
/** @param {boolean} toTheRight */ /** @param {boolean} toTheRight */
changeMouth(toTheRight) { changeMouth(toTheRight) {
let displacement = 80; let displacement = 38;
if (toTheRight){ if (toTheRight){
this.mouthDisplacement += displacement; this.mouthDisplacement += displacement;
}else{ }else{
this.mouthDisplacement -= displacement; this.mouthDisplacement -= displacement;
} }
if(this.mouthDisplacement>266){
this.mouthDisplacement = 0;
}
const mouth = this.shadowRoot.getElementById("mouth"); const mouth = this.shadowRoot.getElementById("mouth");
mouth.style.backgroundPositionX = this.mouthDisplacement+"px"; mouth.style.backgroundPositionX = this.mouthDisplacement+"px";
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment