diff --git a/gpcon.js b/gpcon.js
index ea540d4..d20ec49 100644
--- a/gpcon.js
+++ b/gpcon.js
@@ -61,23 +61,7 @@ function onFrame() { // gets repeatedly executed
buttEle.setAttribute("id",'button_'+j) // set new button's ID so we can get it later and change it's style
buttdiv.appendChild(buttEle); // add newly created button to the 'container'
- // now to add SVG-generated graphics to some non-round-shaped buttons
- if (j==9) {// start
- buttEle.innerHTML = '';
- }
- if (j==12) {//up
- buttEle.innerHTML = '';
- }
- if (j==13) {//down
- buttEle.innerHTML = '';
- }
- if (j==14) {//left
- buttEle.innerHTML = '';
- }
- if (j==15) {//right
- buttEle.innerHTML = '';
- }
- buttons[j] = true; // remember that jth button has been added
+ buttons[j] = true; // // for now all we need is to remember the fact that jth button has been added
} else { // this part kick in when jth button has been added already
let buttEle = document.getElementById('button_'+j); // we get correnponding element in our HTML document
@@ -104,22 +88,23 @@ function onFrame() { // gets repeatedly executed
}
} else { // if current button is *not* pressed we should revert it's style
if (j==9) {// once again, the 'start' button needs special attention
- buttEle.innerHTML = '';
+ buttEle.innerHTML = '';
} else {
if (j<=11) { // round-shaped buttons can be processed similarly
buttEle.style.background='rgba(70,70,70,0.5)';
+ buttEle.style['background-image'] = "linear-gradient(to bottom, rgba(190,190,190,0.25) 0%, rgba(50,50,50,0.25) 100%), linear-gradient(to right, rgba(190,190,190,0.25) 0%, rgba(50,50,50,0.25) 100%)";
}
if (j==12) { // and of cource directional buttons: up
- buttEle.innerHTML = '';
+ buttEle.innerHTML = '';
}
if (j==13) {// down
- buttEle.innerHTML = '';
+ buttEle.innerHTML = '';
}
if (j==14) {// left
- buttEle.innerHTML = '';
+ buttEle.innerHTML = '';
}
if (j==15) {// right
- buttEle.innerHTML = '';
+ buttEle.innerHTML = '';
}
}
}
diff --git a/main.css b/main.css
index 4f2ec51..5a36bcc 100644
--- a/main.css
+++ b/main.css
@@ -1,5 +1,5 @@
body {
-/*background:rgba(0,80,80,0.7); */
+
}
.button {
@@ -33,8 +33,6 @@ body {
.button_9 {
border:0px;
background:transparent;
- height:25px;
- width:25px;
}
@@ -59,17 +57,17 @@ body {
}
.button_2::after {
- content:"□";
+ content:"□"; /*square*/
color: rgba(250,80,80,0.5);
font-size:35px;
- top:-12px;
+ top:-10px;
}
.button_3::after {
- content:"△";
+ content:"△";/*triangle*/
color: rgba(60,200,100,0.5);
font-size:23px;
- top:-3px;
+ top:-2px;
}
.button_4::after {
@@ -188,7 +186,7 @@ body {
#buttons {
position:absolute;
- transform: scale(0.9);
+ transform: scale(1);
}