Skip to content

Commit d3879dc

Browse files
author
Programming-Sai
committed
Added some finishing touches to the dashboard(enhanced responsiveness for mobile devices). Working on responivesness for tablets
1 parent 22f629f commit d3879dc

File tree

15 files changed

+462
-168
lines changed

15 files changed

+462
-168
lines changed

src/app/admin/dashboard/dashboard.module.css

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,18 @@
110110

111111

112112

113-
@media screen and (max-width:480px) {
114-
.topContainer{
115-
flex-direction: column;
116-
}
117-
}
118-
119113
.secondRow {
120114
display: grid;
121115
width: 100%;
122116
gap: 20px;
123117
grid-template-columns: repeat(3, 1fr);
124118
grid-template-areas:
125119
"a a b"
126-
"e d b"
127-
"c f f"
128-
"c h g"
120+
"c d b"
121+
"f f f"
122+
"e h h"
129123
"i i g"
124+
"i i g"
130125
;
131126
grid-auto-rows: 200px auto fit-content;
132127
margin-top: 20px;
@@ -173,7 +168,8 @@
173168

174169
.card6{
175170
grid-area: f;
176-
height: 400px;
171+
height: 480px;
172+
padding: 20px 100px !important;
177173
}
178174

179175
.card7{
@@ -185,11 +181,55 @@
185181

186182
.card8{
187183
grid-area: h;
188-
display: none !important;
184+
width: 100%;
185+
height: 400px;
186+
overflow-y: scroll;
187+
display: flex;
188+
flex-direction: column;
189+
justify-content: flex-start;
190+
align-items: flex-start;
189191
}
190192

191193

192194
.card9{
193195
grid-area: i;
194196
height: 500px;
195197
}
198+
199+
200+
201+
@media screen and (max-width:640px) {
202+
.container{
203+
width: 100%;
204+
left: 0;
205+
206+
}
207+
.topContainer{
208+
flex-direction: column;
209+
}
210+
.card6{
211+
padding: 10px !important;
212+
}
213+
214+
.card{
215+
width: 100% !important;
216+
}
217+
218+
.card5{
219+
width: 400px !important;
220+
}
221+
222+
.secondRow {
223+
display: flex;
224+
justify-content: space-between;
225+
align-items: center;
226+
flex-direction: column;
227+
}
228+
}
229+
230+
@media screen and (max-width:480px) {
231+
232+
.card5{
233+
width: 340px !important;
234+
}
235+
}

src/app/admin/dashboard/page.jsx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,21 @@ import Card from '@/components/card/Card';
66
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
77
import { faEarth, faNewspaper, faStopwatch, faTv } from '@fortawesome/free-solid-svg-icons';
88
import PopularPosts from '@/components/popularposts/PopularPosts';
9-
import { PostPerformanceChart, GrowthRateChart, ContentEngagementChart, TrafficSourcesChart } from '@/components/charts/Charts';
9+
import { PostPerformanceChart, GrowthRateChart, ContentEngagementChart, TrafficSourcesChart, SEOMetrics } from '@/components/charts/Charts';
1010
import AdminCommentsSection from '@/components/admincommentssection/AdminCommentsSection';
1111
import AdminRecentPosts from '@/components/adminrecentpost/AdminRecentPosts';
1212
import ServerStatus from '@/components/serverstatus/ServerStatus';
13+
import Glow from '@/components/glow/Glow';
1314

1415

1516

1617
const DashBoard = () => {
1718
const { toggleSidePane } = useContext(ThemeContext);
1819

19-
const circumference = 2 * Math.PI * 36;
2020

21-
22-
23-
2421
return (
25-
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '250px', zIndex:10}}>
22+
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '240px', zIndex:10}}>
2623

27-
28-
2924
<div className={styles.topContainer}>
3025
<Card className={styles.cardTop} justify={'space-between'}>
3126
<div className={styles.text}>
@@ -76,16 +71,13 @@ const DashBoard = () => {
7671
</Card>
7772
</div>
7873

79-
80-
81-
82-
8374
<div className={styles.secondRow}>
8475
<Card className={`${styles.card} ${styles.card1}`}>
8576
<PostPerformanceChart />
8677
</Card>
78+
8779

88-
<PopularPosts className={`${styles.card} ${styles.card2}`} borderRad='5px' marginBlock='0' isOutline='0' />
80+
<PopularPosts glow={false} imageWidth={10} className={`${styles.card} ${styles.card2}`} borderRad='5px' marginBlock='0' isOutline='0' />
8981

9082

9183
<Card className={`${styles.card} ${styles.card3}`}>
@@ -109,7 +101,7 @@ const DashBoard = () => {
109101
</Card>
110102

111103
<Card className={`${styles.card} ${styles.card8}`}>
112-
Number of Drafts, Published and Scheduled OR Popular Posts
104+
<SEOMetrics />
113105
</Card>
114106

115107
<Card className={`${styles.card} ${styles.card9}`}>

src/app/admin/globals.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
color: var(--text-color);
55
width: 100vw;
66
overflow: hidden;
7-
/* overflow: scroll; */
87
}
98

109
.wrapper{

src/app/globals.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
--back-color: rgba(6,120,11,0.6);
1111
--footer-bg: rgba(217, 217, 217, 0.43);
1212
--brightness: 0.2;
13-
--alpha: 0.5;
13+
--alpha: 0.3;
1414
}
1515

1616
.dark{
@@ -43,11 +43,11 @@ body, html {
4343
height: 100%;
4444
min-height: 100vh;
4545
scroll-behavior: smooth;
46-
font-family: 'Open Sans', sans-serif;
4746
}
4847

49-
h1, h2, h3, h4, h5, h6 {
50-
font-family: 'Merriweather', Georgia, serif;
48+
body, html, h1, h2, h3, h4, h5, h6 {
49+
font-family: 'Open Sans', sans-serif;
50+
5151
}
5252

5353
a, li {

src/components/admincommentssection/admincommentssection.module.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
padding: 8px;
1818
text-align: left;
1919
}
20+
.commentsTable thead{
21+
background-color: var(--back-color);
22+
}
2023

2124
.commentsTable th {
2225
font-weight: bold;

src/components/adminrecentpost/AdminRecentPosts.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ const AdminRecentPosts = () => {
6565
useEffect(() => {
6666
const interval = setInterval(() => {
6767
setCurrentSlide((prevSlide) => (prevSlide + 1) % totalSlides);
68+
if (currentSlide === totalSlides-1){
69+
sliderData.push(sliderData.shift())
70+
}
6871
}, 5000);
6972

7073
return () => clearInterval(interval);

src/components/adminrecentpost/adminrecentpost.module.css

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
.sliderItems{
19-
width: 400px;
19+
width: 380px;
2020
height: 100%;
2121
position: relative;
2222
justify-content: flex-start;
@@ -137,4 +137,33 @@
137137
transform: scale(1);
138138
}
139139
}
140-
140+
141+
142+
@media screen and (max-width:640px) {
143+
.sliderItems{
144+
width: 400px;
145+
}
146+
}
147+
148+
@media screen and (max-width:480px) {
149+
.sliderItems{
150+
width: 340px;
151+
}
152+
.textContainer h4, .textContainer p:first-child, .textContainer{
153+
width: 105%;
154+
}
155+
.stats {
156+
display: grid;
157+
grid-template-columns: repeat(3, 1fr);
158+
gap: 10px;
159+
width: 10%;
160+
}
161+
162+
.stat {
163+
width: 90px;
164+
}
165+
.stat:last-child {
166+
grid-column: span 5;
167+
width: 93.5%;
168+
}
169+
}

src/components/card/card.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
transition: all 0.9s ease;
99
}
1010

11+
.container::-webkit-scrollbar{
12+
width: 10px;
13+
}
14+
1115

1216
.container:hover{
1317
border: 1px solid var(--border-color);

0 commit comments

Comments
 (0)