Skip to content

Commit

Permalink
HAR-126: Еще больше адаптировал под мобилу
Browse files Browse the repository at this point in the history
  • Loading branch information
glebkos committed May 5, 2024
1 parent 9917a17 commit f0e66c8
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/entity/errorWindow/ui/errorWindow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
border-radius: variables.$element-border-radius;
background-color: variables.$background-color;
position: fixed;
inset: auto 20px 20px auto;
inset: auto 20px 60px auto;
padding: 20px 35px 20px 20px;
}

Expand Down
8 changes: 6 additions & 2 deletions source/pages/boardEdit/ui/boardEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {BoardEditAPI} from '../api/api.js';
import {ErrorWindowView} from '../../../entity/errorWindow/ui/errorWindow.js';
import {errors, NORMAL_COLOR} from '../../../shared/config.js';
import {boardValidation} from '../../../shared/utils/validation.js';
import {Profile} from '../../profile/ui/profile.js';
import {BoardView} from '../../board/ui/boardView.js';

/**
* Handle board create and update page
Expand All @@ -30,7 +32,8 @@ export class BoardEdit extends View {

const backButton = document.querySelector('#board-back-button');
backButton.addEventListener('click', (event) => {
history.pushState(null, null, '/board/' + board.board_id);
const board = new BoardView();
board.render(board.board_id);
});

const boardAPI = new BoardEditAPI(board.board_id);
Expand Down Expand Up @@ -77,7 +80,8 @@ export class BoardEdit extends View {
const backButton = document.querySelector('#board-back-button');
backButton.addEventListener('click', (event) => {
const user = JSON.parse(localStorage.getItem('user'));
history.pushState(null, null, '/profile/' + user.nickname);
const profile = new Profile();
profile.render(user.nickname);
});

const boardAPI = new BoardEditAPI(null);
Expand Down
11 changes: 11 additions & 0 deletions source/pages/boardEdit/ui/boardEdit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,14 @@
width: 700px;
}

@media screen and (max-width: 430px) {
$width: 75vw;

.board-window{
width: $width;
}

.board-form{
width: $width;
}
}
2 changes: 1 addition & 1 deletion source/pages/login/ui/loginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class LoginView extends View {

const signupButton = this.root.querySelector('#login_signup_button');
signupButton.addEventListener('click', () => {
whistory.pushState(null, null, '/signup');
history.pushState(null, null, '/signup');
});
}

Expand Down
4 changes: 3 additions & 1 deletion source/pages/pin/ui/pinView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {ErrorWindowView} from '../../../entity/errorWindow/ui/errorWindow.js';
import {errors} from '../../../shared/config.js';
import {Error} from '../../error/ui/error.js';
import {pinValidation} from '../../../shared/utils/validation.js';
import {Profile} from '../../profile/ui/profile.js';

/**
* Handle pin page
Expand Down Expand Up @@ -107,7 +108,8 @@ export class PinView extends View {
profileButton.addEventListener('click', async (event) => {
event.preventDefault();
const user = JSON.parse(localStorage.getItem('user'));
history.pushState(null, null, '/profile/' + user.nickname);
const profile = new Profile();
profile.render(user.nickname);
});

const createSubmit = this.root.querySelector('#pin-form-save');
Expand Down
6 changes: 6 additions & 0 deletions source/pages/profileEdit/ui/profile-edit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
gap: 50px;
padding: 40px;
}

@media screen and (max-width: 430px) {
.profile-edit__window{
width: 75vw;
}
}
8 changes: 4 additions & 4 deletions source/pages/signup/ui/signupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ export class SignupView extends View {

nicknameInput.addEventListener('focusout', (event) => {
event.preventDefault();
if (nicknameValidation(nicknameInput.value)) {
// if (nicknameValidation(nicknameInput.value)) {
nickHint.style.visibility = 'hidden';
}
// }
});

passwordInput.addEventListener('focusout', (event) => {
event.preventDefault();
if (passwordValidation(passwordInput.value)) {
// if (passwordValidation(passwordInput.value)) {
passHint.style.visibility = 'hidden';
}
// }
});

nicknameInput.addEventListener('input', (event) => {
Expand Down
7 changes: 7 additions & 0 deletions source/pages/signup/ui/signupView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
display: flex;
margin-top: 10px;
}

@media screen and (max-width: 430px) {
.hint{
inset: 50px auto auto 0;
z-index: 2;
}
}
7 changes: 7 additions & 0 deletions source/widgets/profileEditWindow/ui/profile-edit-window.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@
width: 150px;
height: 150px;
}

@media screen and (max-width: 430px) {
.form{
flex-direction: column;
width: auto;
}
}

0 comments on commit f0e66c8

Please sign in to comment.