Skip to content

Commit e584da8

Browse files
committed
home page styling
1 parent 33d08ec commit e584da8

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
lines changed

carrom.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@
7070
</tr>
7171

7272
<tr style="background-color: #fdfd96; color: #000;">
73-
<td>baba</td>
73+
<td id="p1namet"></td>
7474
<td id="p1total">0</td>
7575
<td id="p1avg">0</td>
7676
</tr>
7777

7878
<tr style="background-color: #FFB3BA; color: #000;">
79-
<td>dada</td>
79+
<td id="p2namet">dada</td>
8080
<td id="p2total">0</td>
8181
<td id="p2avg">0</td>
8282
</tr>
8383

8484
<tr style="background-color: #B8E2B8; color: #000;">
85-
<td>rohan</td>
85+
<td id="p3namet">rohan</td>
8686
<td id="p3total">0</td>
8787
<td id="p3avg">0</td>
8888
</tr>
8989

9090
<tr style="background-color: #A7C6ED; color: #000;">
91-
<td>ma</td>
91+
<td id="p4namet">ma</td>
9292
<td id="p4total">0</td>
9393
<td id="p4avg">0</td>
9494
</tr>

carrom.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,9 @@ const p4name = sessionStorage.getItem('p4name');
403403
document.getElementById('p1namep').textContent = p1name;
404404
document.getElementById('p2namep').textContent = p2name;
405405
document.getElementById('p3namep').textContent = p3name;
406-
document.getElementById('p4namep').textContent = p4name;
406+
document.getElementById('p4namep').textContent = p4name;
407+
408+
document.getElementById('p1namet').textContent = p1name;
409+
document.getElementById('p2namet').textContent = p2name;
410+
document.getElementById('p3namet').textContent = p3name;
411+
document.getElementById('p4namet').textContent = p4name;

index.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body{
2020
position:absolute;
2121
display: flex;
2222
top: 30%;
23-
left: 14%;
23+
left: 10%;
2424

2525
.radio {
2626
margin-left:40px;
@@ -89,14 +89,13 @@ body{
8989

9090
#p1name{
9191
position: absolute;
92-
/* top: 0; */
9392
left: 25%;
9493
background-color: #fdfd96;
9594
}
9695

9796
#p2name{
9897
position: absolute;
99-
top: 30%;
98+
top: 50%;
10099
left: 25%;
101100
background-color: #ffb3ba;
102101
}
@@ -127,7 +126,7 @@ body{
127126
text-align: center;
128127
color: #fff;
129128
position: absolute;
130-
top: 60%;
129+
top: 65%;
131130
left: 35%;
132131

133132
span{

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@
2323

2424
<div class="radio">
2525
<input type="radio" name="gamemode" id="gamemode1" value="1">
26-
<label for="gamemode1">1v1</label>
26+
<label for="gamemode1">1vs1</label>
2727
</div>
2828

2929
<div class="radio">
3030
<input type="radio" name="gamemode" id="gamemode2" value="2">
31-
<label for="gamemode2">2v2</label>
31+
<label for="gamemode2">2vs2</label>
3232
</div>
3333
</div>
3434

3535
<div class="names">
3636

3737
<input type="text" id="p1name" placeholder="player 1">
38+
<span style="position:absolute; top: 25%; left:47%" id="vsspan">vs</span>
3839
<input type="text" id="p2name" placeholder="player 2">
3940
<input type="text" id="p3name" placeholder="player 3">
4041
<input type="text" id="p4name" placeholder="player 4">

index.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1+
const p1namefield=document.getElementById('p1name');
2+
const p2namefield=document.getElementById('p2name');
13
const p3namefield=document.getElementById('p3name');
24
const p4namefield=document.getElementById('p4name');
35

46
const startbtn=document.getElementById('start');
7+
const vsspan=document.getElementById('vsspan');
58

69
document.getElementById('gamemode1').onclick=function(){
10+
711
p3namefield.style.visibility='hidden';
812
p4namefield.style.visibility='hidden';
9-
startbtn.style.top="60%";
13+
14+
p1namefield.style.top="0";
15+
p2namefield.style.top="50%";
16+
17+
vsspan.style.top="25%";
18+
19+
startbtn.style.top="65%";
1020
}
1121

1222
document.getElementById('gamemode2').onclick=function(){
23+
24+
p2namefield.style.top="15%";
25+
26+
vsspan.style.top="37%";
27+
1328
p3namefield.style.visibility='visible';
1429
p4namefield.style.visibility='visible';
15-
startbtn.style.top="80%";
30+
31+
p3namefield.style.top="61%";
32+
p4namefield.style.top="75%";
33+
34+
startbtn.style.top="75%";
1635
}
1736

1837
startbtn.onclick=function(){
@@ -27,6 +46,6 @@ startbtn.onclick=function(){
2746
sessionStorage.setItem('p3name', p3name);
2847
sessionStorage.setItem('p4name', p4name);
2948

30-
window.location.href = 'https://kilsw1ch.github.io/Carrom-Counter/carrom.html';
31-
// window.location.href = 'carrom.html';
49+
// window.location.href = 'https://kilsw1ch.github.io/Carrom-Counter/carrom.html';
50+
window.location.href = 'carrom.html';
3251
}

0 commit comments

Comments
 (0)