Skip to content

Commit a7f72fc

Browse files
committed
adding footer and limiting input characters
1 parent 072b0d1 commit a7f72fc

File tree

5 files changed

+52
-20
lines changed

5 files changed

+52
-20
lines changed
File renamed without changes.

assets/option.png

-598 KB
Binary file not shown.

index.html

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ <h1>CATÁLAGO</h1>
4545

4646
</div>
4747

48+
<footer>
49+
<img src="assets/logo-introcomp-2.png" alt="">
50+
<p>INTROCOMP 2024 ・Todos os direitos reservados</p>
51+
</footer>
52+
4853
<script src="script.js"></script>
4954

5055
</body>

script.js

+25-14
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function film_construct(film_data, n_row){
7777

7878
var img = document.createElement('img');
7979
img.src = film_data['imgSrc'];
80-
img.style.width = '100%';
80+
img.classList = 'picture__img';
8181
film.appendChild(img);
8282
row_films.appendChild(film);
8383

@@ -173,11 +173,13 @@ function input_construct(n_row){
173173
input_title.placeholder = 'Insira o nome';
174174
input_title.classList = 'desc-title';
175175
input_title.id = 'input-title';
176+
input_title.maxLength = '15';
176177
var input_year = document.createElement('input');
177178
input_year.type = 'text';
178179
input_year.placeholder = 'Insira o ano de criação';
179180
input_year.classList = 'desc-year';
180181
input_year.id = 'input-year';
182+
input_year.maxLength = '4';
181183

182184
var desc_down = document.createElement('div');
183185
desc_down.classList = 'desc-down';
@@ -187,6 +189,7 @@ function input_construct(n_row){
187189
input_text.placeholder = 'Insira uma breve sinopse';
188190
input_text.classList = 'desc-text';
189191
input_text.id = 'input-text';
192+
input_text.maxLength = '380';
190193
var save = document.createElement('button');
191194
save.type = 'button';
192195
save.classList = 'save-button';
@@ -209,21 +212,21 @@ function add_img(){
209212
const file = inputTarget.files[0];
210213

211214
if (file) {
212-
const reader = new FileReader();
215+
const reader = new FileReader();
213216

214-
reader.addEventListener("load", function (e) {
215-
const readerTarget = e.target;
217+
reader.addEventListener("load", function (e) {
218+
const readerTarget = e.target;
216219

217-
var img = document.createElement("img");
218-
img.id = 'input-img-cover';
219-
img.src = readerTarget.result;
220-
img.classList.add("picture__img");
221-
add_img.innerHTML = '';
222-
add_img.appendChild(img);
223-
});
220+
var img = document.createElement("img");
221+
img.id = 'input-img-cover';
222+
img.src = readerTarget.result;
223+
img.classList.add("picture__img");
224+
add_img.innerHTML = '';
225+
add_img.appendChild(img);
226+
});
224227

225-
reader.readAsDataURL(file);
226-
}
228+
reader.readAsDataURL(file);
229+
}
227230
}
228231

229232
function input_destroy(){
@@ -236,11 +239,19 @@ function input_destroy(){
236239

237240
function input_save(){
238241

239-
var input_img = document.getElementById('input-img-cover').src;
242+
if(document.getElementById('input-img-cover') != null){
243+
var input_img = document.getElementById('input-img-cover').src;
244+
}
240245
var input_title = document.getElementById('input-title').value;
241246
var input_year = document.getElementById('input-year').value;
242247
var input_text = document.getElementById('input-text').value;
243248

249+
if(input_img == undefined || input_title.length == 0 || input_year.length == 0 || input_text.length == 0){
250+
251+
alert('Preencha todos os dados para adicionar o filme corretamente');
252+
return null;
253+
}
254+
244255
var n_row = Math.floor(films.length / max_films_row);
245256

246257
var film = {

style.css

+22-6
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ body{
124124
border: 1px solid #F4C708;
125125
}
126126

127-
/*static films*/
128-
/*.static{
129-
width: 100%;
130-
height: 100%;
131-
}*/
132-
133127
/*add films*/
134128
.desc{
135129
display: none;
@@ -230,6 +224,28 @@ body{
230224
right: 30px;
231225
}
232226

227+
footer{
228+
display: flex;
229+
align-items: center;
230+
justify-content: center;
231+
height: 200px;
232+
background-color: #0B2D52;
233+
margin-top: 100px;
234+
position: relative;
235+
}
236+
237+
footer img{
238+
width: 360px;
239+
height: 90px;
240+
}
241+
242+
footer p{
243+
color: #1F4B7A;
244+
position: absolute;
245+
bottom: 10px;
246+
font-size: 15px;
247+
}
248+
233249
@media (max-width: 700px){
234250

235251
#intro-text{

0 commit comments

Comments
 (0)