Skip to content

Commit c2e887e

Browse files
committed
now "create post" is mobilefirst
1 parent c19a642 commit c2e887e

File tree

8 files changed

+79
-49
lines changed

8 files changed

+79
-49
lines changed

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
<link rel="stylesheet" href="src/styles/components/post-card-container.css">
2323
<link rel="stylesheet" href="src/styles/components/post.css">
24+
25+
<link rel="stylesheet" href="src/styles/components/buttons.css">
2426
</head>
2527

2628
<body>

src/js/modules/create-post/createPost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function initCreatePost() {
1212
window.location = '/views/login.html'
1313
}
1414

15-
const createPostForm = document.querySelector('#createPostForm')
15+
const createPostForm = document.querySelector('#create-post-form')
1616
const notifications = document.querySelector(".notifications");
1717
const loader = document.querySelector(".loader")
1818

src/js/modules/create-post/createPostView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const buildCreatePostForm = () => {
2828
<input required id="post-price" name="post-price" type="number" min="1" max="9999999" step="0.01"
2929
placeholder="Introduce the price of your product." />
3030
31-
<div>
31+
<div class="radio-button">
3232
<label for="purchase">
3333
<input required type="radio" id="purchase" name="transactionType" value="purchase">
3434
Purchase

src/styles/common.css

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,22 @@ body {
2020
main {
2121
max-width: 1440px;
2222

23-
margin: clamp(5px, 2vw, 1rem) clamp(10px, 5vw, 2rem);
2423
margin-top: 0;
2524
margin-bottom: 0;
2625

26+
margin-left: auto;
27+
margin-right: auto;
28+
2729
padding: 1rem;
2830

2931
background-color: var(--bg-color-4);
30-
margin-left: auto;
31-
margin-right: auto;
32+
3233
}
3334

34-
video,
35+
/* video,
3536
iframe {
3637
max-width: 100%;
37-
}
38+
} */
3839

3940
a {
4041
text-decoration: none;
@@ -65,10 +66,29 @@ textarea,
6566
label,
6667
p,
6768
textarea,
68-
button {
69-
padding: 5px;
69+
button,
70+
select {
71+
padding: 7px;
7072
}
7173

74+
.radio-button{
75+
display: flex;
76+
flex-direction: row; /* formato horizontal */
77+
align-items: center; /* centra verticalmente el contenido */
78+
justify-content: start; /* opcional: centra horizontalmente */
79+
gap: 1rem;
80+
}
81+
82+
.radio-button label{
83+
display: flex;
84+
align-items: center;
85+
}
86+
87+
.radio-button label input{
88+
margin: 0;
89+
}
90+
91+
7292

7393
p {
7494
white-space: pre-line;

src/styles/components/buttons.css

Whitespace-only changes.

src/styles/form.css

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,51 @@
44
align-items: stretch;
55
flex-direction: column;
66

7-
padding: clamp(1rem, 5vw, 2rem);
7+
padding-left: clamp(1rem, 5vw, 4rem);
8+
padding-right: clamp(1rem, 5vw, 4rem);
9+
10+
padding-top: 1rem;
11+
padding-bottom: 1rem;
12+
13+
margin-right: 5%;
14+
margin-left: 5%;
815

916
background-color: var(--bg-color-3);
1017
}
1118

19+
form button{
20+
font-weight: bold;
21+
align-self: self-start;
22+
width: 1auto;
23+
padding-right: 1rem;
24+
padding-left: 1rem;
25+
}
26+
27+
textarea {
28+
max-width: 100%;
29+
min-width: 100%;
30+
31+
min-height: 10rem;
32+
max-height: 10rem;
33+
}
34+
1235
.form input,
1336
textarea,
14-
label,
15-
p {
37+
select {
1638
margin-bottom: 1rem;
1739
}
1840

1941
.form label {
2042
font-weight: bold;
43+
}
44+
45+
.form .radio-button{
46+
margin-bottom: 1rem;
47+
}
48+
49+
@media (min-width: 768px) {
50+
.form {
51+
margin-right: 20%;
52+
margin-left: 20%;
53+
}
2154
}

src/styles/navbar.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
margin-left: auto;
1414
margin-right: auto;
1515

16-
padding: clamp(1px, 5vw, 16px);
16+
padding-top: clamp(1px, 5vw, 16px);
17+
padding-bottom: clamp(1px, 5vw, 16px);
18+
1719

1820
max-width: 1440px;
1921

views/create-post.html

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,25 @@
2222
<link rel="stylesheet" href="../src/styles/components/loader.css">
2323
<link rel="stylesheet" href="../src/styles/components/loader-container.css">
2424

25-
25+
<link rel="stylesheet" href="../src/styles/components/buttons.css">
2626
</head>
2727

2828
<body>
29-
3029
<div class="navbar"></div>
3130

32-
<h1>Create Post</h1>
33-
34-
<div class="loader-container">
35-
<div class="loader hidden"></div>
36-
</div>
37-
38-
<div class="notifications"></div>
31+
<main>
32+
<h1>Create Post</h1>
3933

40-
<form id="createPostForm" class="form"></form>
41-
<!-- <form id="createPostForm" class="form">
42-
<label for="post-image">Photo: </label>
43-
<input type="file" id="post-image" name="photo" accept="image/*">
44-
45-
<label for="post-name">Product Name: </label>
46-
<input required id="post-name" name="post-name" type="text" maxlength="120"
47-
placeholder="Introduce the name of your post." />
48-
49-
<label for="post-description">Description: </label>
50-
<textarea required name="post-description" id="post-description" maxlength="300"
51-
placeholder="Max. Length 300"></textarea>
34+
<div class="loader-container">
35+
<div class="loader hidden"></div>
36+
</div>
5237

53-
<label for="post-price">Price: </label>
54-
<input required id="post-price" name="post-price" type="number" min="1" max="9999999" step="0.01"
55-
placeholder="Introduce the price of your product." />
38+
<div class="notifications"></div>
5639

57-
<div>
58-
<label for="purchase">
59-
<input required type="radio" id="purchase" name="transactionType" value="purchase">
60-
Purchase
61-
</label>
40+
<form id="create-post-form" class="form"></form>
41+
</main>
6242

63-
<label for="sale">
64-
<input required type="radio" id="sale" name="transactionType" value="sale">
65-
Sale
66-
</label>
67-
</div>
6843

69-
<button>Create Post</button>
70-
</form> -->
7144

7245
<div class="footer"></div>
7346
<script type="module" src="../src/js/main.js"></script>

0 commit comments

Comments
 (0)