Skip to content

Commit cf40168

Browse files
committed
📱 add responsive design on main template
1 parent 9a6e3fc commit cf40168

File tree

14 files changed

+157
-31
lines changed

14 files changed

+157
-31
lines changed

src/app/core/components/header/header.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<header>
22
<div class="options">
3+
<div class="burger" (click)="changeVisibilitySidebar()">
4+
<i class="bx bx-menu"></i>
5+
</div>
36
<div class="search">
47
<div class="input-group">
58
<input type="text" class="icon" #txtSearch
69
placeholder="Search...">
710
<i class="bx bx-search"></i>
811
</div>
9-
<button class="btn btn-primary filter">
10-
<i class="bx bx-equalizer"></i>
11-
</button>
1212
</div>
1313
<div class="user">
1414
here's user

src/app/core/components/header/header.component.scss

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
@import 'elements/_buttons.scss';
2+
@import 'settings/_media.scss';
3+
@import 'settings/_typography.scss';
24

35
header {
46
position: fixed;
57
margin-left: 250px;
68
height: 75px;
7-
padding: 1rem 0.8rem;
89
width: -webkit-fill-available;
910
background: var(--bg);
1011
border-bottom: 2px solid #e0e0e0;
11-
z-index: 100;
12+
z-index: 90;
13+
14+
@include width-medium {
15+
margin-left: 0;
16+
height: 70px;
17+
}
1218

1319
& .options {
1420
display: flex;
1521
align-items: center;
1622
justify-content: space-between;
1723
gap: 1rem;
24+
padding: 0 1rem;
25+
height: 100%;
1826

1927
& .search {
2028
flex: 1;
@@ -64,14 +72,31 @@ header {
6472
}
6573
}
6674

67-
.btn {
68-
&.filter {
69-
& i {
70-
@include fs-4;
71-
}
75+
.burger {
76+
display: none;
77+
color: var(--fc-primary);
78+
transition: 0.5s;
79+
border-radius: 50%;
80+
background: transparent;
81+
padding: 0.5rem;
82+
width: 45px;
83+
height: 45px;
84+
85+
&:hover {
86+
background: var(--bg-hover-2);
87+
cursor: pointer;
7288
}
73-
}
7489

90+
& i {
91+
@include fs-1;
92+
}
93+
94+
@include width-medium {
95+
display: flex;
96+
align-items: center;
97+
justify-content: center;
98+
}
99+
}
75100

76101
.user {
77102
flex: 1;

src/app/core/components/header/header.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ import { Component } from '@angular/core';
55
templateUrl: './header.component.html',
66
styleUrls: ['./header.component.scss']
77
})
8-
export class HeaderComponent {}
8+
export class HeaderComponent {
9+
changeVisibilitySidebar(): void {
10+
const sidebarElement = document.querySelector('.sidebar') as HTMLElement;
11+
sidebarElement.classList.toggle('closed');
12+
}
13+
}

src/app/core/components/sidebar/sidebar.component.html

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<nav class="sidebar">
1+
<nav class="sidebar closed">
22
<div class="logo">
3-
<i class="bx bx-folder"></i>
4-
<!-- <img src="" alt="cloud_box_image"> -->
53
<span class="name">Cloud Box</span>
4+
<div class="close">
5+
<i class="bx bx-x" (click)="changeVisibilitySidebar()"></i>
6+
</div>
67
</div>
78
<ul class="items">
89
<li class="item">
@@ -11,18 +12,6 @@
1112
<span class="name">Home</span>
1213
</a>
1314
</li>
14-
<li class="item">
15-
<a href="#">
16-
<i class='bx bx-cog'></i>
17-
<span class="name">Settings</span>
18-
</a>
19-
</li>
20-
<li class="item">
21-
<a href="#">
22-
<i class='bx bx-trash'></i>
23-
<span class="name">Deleted</span>
24-
</a>
25-
</li>
2615
<li class="item space">
2716
<div class="used-space">
2817
<span class="name">Espacio utilizado</span>

src/app/core/components/sidebar/sidebar.component.scss

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
@import 'settings/_typography.scss';
2+
@import 'settings/_media.scss';
23

34
nav {
45
position: fixed;
56
height: 100%;
67
width: 250px;
78
padding: 1rem 0.8rem;
89
z-index: 100;
9-
transition: 0.5s ease;
1010
display: flex;
1111
flex-direction: column;
1212
align-items: flex-start;
1313
background: var(--bg-sidebar);
1414
gap: 2rem;
15+
transition: margin-left 0.3s ease-in-out;
16+
17+
&.closed {
18+
margin-left: -250px;
19+
}
20+
21+
@media (min-width: 769px) {
22+
margin-left: 0 !important;
23+
}
1524
}
1625

1726
.logo {
1827
display: flex;
1928
align-items: center;
29+
justify-content: space-between;
2030
gap: 1rem;
31+
width: 100%;
2132

2233
& .name {
2334
@include fs-1;
@@ -110,3 +121,26 @@ nav {
110121
}
111122
}
112123

124+
.close {
125+
display: none;
126+
color: var(--fc-primary);
127+
transition: 0.5s;
128+
border-radius: 50%;
129+
background: var(--bg-hover-2);
130+
width: 45px;
131+
height: 45px;
132+
133+
&:hover {
134+
cursor: pointer;
135+
}
136+
137+
& i {
138+
@include fs-1;
139+
}
140+
141+
@include width-medium {
142+
display: flex;
143+
align-items: center;
144+
justify-content: center;
145+
}
146+
}

src/app/core/components/sidebar/sidebar.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ export class SidebarComponent implements OnDestroy, OnInit {
3232
const percentage = this.userActive.usedSpace / this.userActive.totalSpace * 100;
3333
return `${percentage}%`;
3434
}
35+
36+
changeVisibilitySidebar(): void {
37+
const sidebarElement = document.querySelector('.sidebar') as HTMLElement;
38+
sidebarElement.classList.toggle('closed');
39+
}
3540
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
@import 'settings/_media.scss';
2+
13
.content {
24
padding-top: 75px;
35
height: 100%;
6+
7+
@include width-medium {
8+
padding-top: 70px;
9+
}
410
}

src/app/features/folder/components/table-files/table-files.component.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import 'settings/_colors.scss';
22
@import 'settings/_typography.scss';
3+
@import 'settings/_media.scss';
34

45
.item {
56
display: flex;
@@ -12,6 +13,10 @@
1213
transition: 0.3s ease;
1314
cursor: pointer;
1415

16+
@include width-medium {
17+
padding: 0.5rem 0.2rem;
18+
}
19+
1520
&:hover {
1621
background: var(--bg-hover-3);
1722
}
@@ -24,6 +29,10 @@
2429
max-width: 80%;
2530
flex: 1;
2631

32+
@include width-medium {
33+
gap: 0.5rem;
34+
}
35+
2736
& .icon {
2837
@include fs-2;
2938
width: 2.5rem;
@@ -32,6 +41,12 @@
3241
display: flex;
3342
align-items: center;
3443
justify-content: center;
44+
45+
@include width-medium {
46+
width: 2rem;
47+
height: 2rem;
48+
@include fs-3;
49+
}
3550
}
3651

3752
& .name, & .type, & .size {
@@ -45,12 +60,29 @@
4560
@include fw-400;
4661
flex: 2;
4762
color: var(--fc-primary);
63+
64+
@include width-medium {
65+
@include fs-6;
66+
flex: 3;
67+
}
4868
}
4969

5070
& .type, & .size {
5171
@include fs-6;
5272
flex: 1;
5373
color: var(--fc-secondary);
74+
text-transform: uppercase;
75+
76+
@include width-medium {
77+
@include fs-7;
78+
}
79+
}
80+
81+
& .type {
82+
83+
@include width-medium {
84+
display: none;
85+
}
5486
}
5587
}
5688

src/app/shared/breadcrumbs/breadcrumb/breadcrumb.component.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import 'settings/_colors.scss';
22
@import 'settings/_typography.scss';
3+
@import 'settings/_media.scss';
34

45
.items {
56
display: flex;
@@ -17,6 +18,14 @@
1718
align-items: center;
1819
max-width: 300px;
1920

21+
@include width-medium {
22+
@include fs-4;
23+
}
24+
25+
@include width-small {
26+
@include fs-5;
27+
}
28+
2029
& a {
2130
color: var(--fc-primary);
2231
text-decoration: none;

src/app/shared/headers/actions/actions.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<app-breadcrumb></app-breadcrumb>
33
<div class="new">
44
<button #btnDrop class="btn btn-primary btn-select" (click)="openDrop(btnDrop)">
5-
Nuevo
5+
<span class="title">Nuevo</span>
66
<i class="bx bx-plus"></i>
77
</button>
88
<ul class="list-items">

0 commit comments

Comments
 (0)