Skip to content

Commit

Permalink
New time added
Browse files Browse the repository at this point in the history
  • Loading branch information
Sung-99 committed Mar 6, 2024
1 parent 20874b7 commit 8377bf4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
Binary file added Imagens/IndexSite1/logoDictionary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,21 +440,23 @@ <h1 id="Resume">Porque a criação desse site?</h1>
</div>
<div class="Contact_info">
<h1 id="Resume">Nos aconselhe</h1>
<form id="formCritic" action="http://localhost:3000/myaction" method="post">
<form id="formCritic" action="http://localhost:3000" method="get">
<input type="text" id="Name" name="Nome" placeholder="Seu nome.." >
<textarea class="text_area_submit" id="Questio" name="Questio" placeholder="Nos informe qualquer duvida ou problema.." ></textarea>

<input id="submit_text_are" type="submit" value="Submit">
<span class="error" aria-live="polite"></span>

</form>
</div>
</div>
<footer>
<p>Author: Vitor Hugo</p>
<p class="date--year"></p>

<p id="warning">O site ainda está em desenvolvimento, mas achei necessário já coloca-lo na rede
como forma de primeiro passo para um grande objetivo...
</p>
<p id="time"></p>
</footer>
</body>
</html>
13 changes: 12 additions & 1 deletion Js/Base_JavaScritp.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,21 @@ function myFunction() {


/*date year at end page */

document.querySelector('.date--year').textContent = "@" + date__yearEndPage.getFullYear();


/* TIME */

let day = ['Segunda','Terça','Quarta','Quinta','Sexta','Sabado','Domingo'];

setInterval(function (){
let date = new Date();
let x = date.getDay()
document.getElementById('time').textContent = day[x-1] + ' ' + date.getHours() +':'+('0'+ date.getMinutes()).slice(-2) +':'+ ('0' + date.getSeconds()).slice(-2);

}, 1000);


const form1 = document.querySelector("#formCritic");
const textInput = document.getElementById("Name");

Expand Down
13 changes: 7 additions & 6 deletions Js/ServerSide.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ var express = require('express');
var bodyParser = require('body-parser');
var app = express();

const path = require('path');

app.use(bodyParser.json());

//Note that in version 4 of express, express.bodyParser() was
//deprecated in favor of a separate 'body-parser' module.
app.use(bodyParser.urlencoded({ extended: true }));

//app.use(express.bodyParser());

app.post('/myaction', function(req, res) {

var lName = req.body.Nome;
var messg = req.body.Questio;

app.get('/', function(req, res) {

res.send('You sent the name "' + lName + ' and the message ' + messg + '".');
const htmlFilePath = path.join(__dirname, '..', 'index.html');
res.sendFile(htmlFilePath)
});

app.listen(3000, function() {
Expand Down

0 comments on commit 8377bf4

Please sign in to comment.