Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit b6435b5

Browse files
Minor Cricket Field
1 parent 856932b commit b6435b5

File tree

9 files changed

+118
-25
lines changed

9 files changed

+118
-25
lines changed

css/dashboard.css

+75-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
--light-red:#F5B7B1;
88
--light-green:#A3E4D7;
99
--dark-green:#1ABC9C;
10+
--green-saturated:#48C9B0;
1011
--dark-red:#E74C3C;
1112
--light-gray:#D5DBDB;
1213
--dark-gray:#95A5A6;
@@ -343,6 +344,32 @@ body{
343344
filter:invert(1);
344345
}
345346

347+
#league-row{
348+
display:flex;
349+
flex-direction:row;
350+
align-items:center;
351+
justify-content:center;
352+
}
353+
354+
#league-row > div{
355+
margin:0 1vw;
356+
}
357+
358+
#comments{
359+
height:40vmin;
360+
overflow-y:scroll;
361+
padding-right:1vw;
362+
}
363+
364+
#comments::-webkit-scrollbar-track {
365+
background: var(--light-gray);
366+
}
367+
368+
#comments::-webkit-scrollbar-thumb {
369+
background: var(--light-green);
370+
border-radius:0.375vmax;
371+
}
372+
346373
.comment{
347374
width:35vmin;
348375
display:flex;
@@ -352,7 +379,7 @@ body{
352379
padding:1vw 2vmin;
353380
border-radius:2vmin;
354381
background:var(--light-gray);
355-
margin-bottom:2vmin;
382+
margin:2vmin 0;
356383
}
357384

358385
.wicket{
@@ -403,4 +430,51 @@ body{
403430
.comment > div > p{
404431
margin:0;
405432
font-size:1.5vmin;
433+
}
434+
435+
#cricket-field{
436+
width:40vmin;
437+
height:40vmin;
438+
border-radius:21vmin;
439+
border:1vmin solid var(--light-gray);
440+
box-shadow:0 0 3vmin 0 var(--dark-gray);
441+
display:flex;
442+
flex-direction:column;
443+
justify-content:center;
444+
align-items:center;
445+
position:relative;
446+
overflow:hidden;
447+
}
448+
449+
#cricket-field::before{
450+
content:'';
451+
position:absolute;
452+
width:45vmin;
453+
height:45vmin;
454+
top:-2.5vmin;
455+
left:-2.5vmin;
456+
background-image:url('../images/patterns/darkpattern.png');
457+
background-repeat:repeat;
458+
background-size:30px 30px;
459+
image-rendering: pixelated;
460+
transform:rotate(0deg);
461+
}
462+
463+
#cricket-inner-green{
464+
width:15vmin;
465+
height:20vmin;
466+
background:rgba(255,255,255,0.25);
467+
border:0.75vmin solid var(--light-gray);
468+
border-radius:8.25vmin;
469+
position:relative;
470+
display:flex;
471+
flex-direction:column;
472+
align-items:center;
473+
justify-content:center;
474+
}
475+
476+
#cricket-pitch{
477+
background:#F5B041;
478+
width:3vmin;
479+
height:8vmin;
406480
}

dashboard/index.html

+6-22
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,14 @@ <h1>T20 World Cup Draft on October 25th, 2021 7:00 A.M.</h1>
6060
<div id="results">
6161
<div class="leagues-result result-item">
6262
<div id="league-row">
63-
<div id="cricket-pitch"></div>
64-
<div id="comments">
65-
<div class="comment sixer">
66-
<h1>6</h1>
67-
<div>
68-
<h2>Rohit Sharma Hits a 6</h2>
69-
<p>Rohit Sharma hits a Six to bring total to 145</p>
70-
</div>
71-
</div>
72-
<div class="comment">
73-
<h1>4</h1>
74-
<div>
75-
<h2>Rohit Sharma Hits a 4</h2>
76-
<p>Rohit Sharma hits a Four to bring total to 149</p>
77-
</div>
78-
</div>
79-
<div class="comment wicket">
80-
<h1>W</h1>
81-
<div>
82-
<h2>Rohit Sharma c Glenn Maxwell</h2>
83-
<p>Rohit Sharma is out for 149.</p>
84-
</div>
63+
<div id="cricket-field">
64+
<div id="cricket-inner-green">
65+
<div class="cricket-circle"></div>
66+
<div id="cricket-pitch"></div>
67+
<div class="cricket-circle"></div>
8568
</div>
8669
</div>
70+
<div id="comments"></div>
8771
</div>
8872
<div id="scorecard"></div>
8973
</div>

images/logos/fc.png

-279 KB
Loading

images/patterns/darkpattern.png

128 Bytes
Loading

images/patterns/lightpattern.png

128 Bytes
Loading

images/people/person10.png

74.1 KB
Loading

images/people/person11.png

217 KB
Loading

images/people/person9.png

53.6 KB
Loading

js/dashboard.js

+37-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,41 @@ function randomProfile(){
2121
}
2222
profilePicture.style.background = colors[Math.trunc(Math.random() * colors.length)]
2323

24-
bannerImage.src = "../images/people/person" + (Math.trunc(Math.random() * 8) + 1) + ".png"
24+
bannerImage.src = "../images/people/person" + (Math.trunc(Math.random() * 11) + 1) + ".png"
2525
console.log(bannerImage.src)
2626
}
2727

28+
function createComment(score, header, subheader){
29+
let newDiv = document.createElement('div');
30+
31+
if(score == 'w'){
32+
newDiv.classList.add('wicket');
33+
score = score.toUpperCase();
34+
} else if(score == 6){
35+
newDiv.classList.add('sixer');
36+
}
37+
38+
newDiv.classList.add('comment');
39+
40+
let newHeader = document.createElement('h1');
41+
newHeader.appendChild(document.createTextNode(score));
42+
let childDiv = document.createElement('div');
43+
44+
let subHeader = document.createElement('h2');
45+
let para = document.createElement('p');
46+
47+
subHeader.appendChild(document.createTextNode(header));
48+
para.appendChild(document.createTextNode(subheader));
49+
50+
childDiv.appendChild(subHeader);
51+
childDiv.appendChild(para);
52+
53+
newDiv.appendChild(newHeader);
54+
newDiv.appendChild(childDiv);
55+
56+
document.getElementById('comments').appendChild(newDiv);
57+
}
58+
2859
function toggleModal(){
2960
modalActive = !modalActive;
3061
if(modalActive){
@@ -130,4 +161,8 @@ function addNews(){
130161
createNewsStory(4, "https://wallpapercave.com/wp/wp3156823.jpg", 'ipl', 'Chennai Wins IPL', 'IPL CSK x KKR', 9999, 9999);
131162
}
132163

133-
initialize()
164+
initialize()
165+
createComment('1', 'Virat Kohli Get 1 Run', 'Virat Kohli Shuffles things Along')
166+
createComment(6, 'Rohit Sharma Hits a 6', 'Rohit Sharma Hits a Six with a total of 23')
167+
createComment(4, 'Rohit Sharma Hits a 4', 'Rohit sharma hits another boundary with a total of 27')
168+
createComment('w', 'R. Sharma c G. Maxwell', 'Rohit Sharma is out without contributing to his team')

0 commit comments

Comments
 (0)