This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { DivProfile } from "./styles/styles"; | |
import "./styles/styles.css"; | |
//import "./styles.css"; | |
export function CarlosAbreu() { | |
const [textCarlos, setTextCarlos] = useState({ | |
pt: "Eu sou um desenvolvedor de frontend e moro no Rio de Janeiro, Brasil. Eu sou um usuário da distribuição linux Ubuntu e sou apaixonado por ela.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*CÓDIGO MELHORADO CHATGPT*/ | |
import React, { useState, useEffect, useRef } from "react"; | |
import Calendar from "../../images/calendar.png"; | |
const CronometroDecrescente = () => { | |
const dataFinal = new Date("2023-12-28T23:59:59"); | |
const [tempoRestante, setTempoRestante] = useState(calcularTempoRestante()); | |
const intervaloRef = useRef(null); | |
function calcularTempoRestante() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Verifica se o formulário foi submetido | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// Pega os dados do formulário POST | |
$nome = $_POST["nome"]; | |
$email = $_POST["email"]; | |
$telefone = $_POST["telefone"]; | |
// Cria um array associativo com os dados | |
$dados = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Javascript cronômetro LP | |
//Funcionando | |
function updateCountdown() { | |
/*Array diasDaSemana = [ | |
"Domingo", = 0 | |
"Segunda-feira", 1 | |
"Terça-feira", = 2 | |
"Quarta-feira", = 3 | |
"Quinta-feira", = 4 | |
"Sexta-feira", = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod("cpf", function(value, element) { | |
value = jQuery.trim(value); | |
value = value.replace('.',''); | |
value = value.replace('.',''); | |
cpf = value.replace('-',''); | |
while(cpf.length < 11) cpf = "0"+ cpf; | |
var expReg = /^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/; | |
var a = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scrollSmooth() { | |
// href^=''#' a que termive com # | |
const linksInternos = document.querySelectorAll('.nav-main a[href^="#"'); | |
console.log(linksInternos); | |
function scrollToSecion(event) { | |
event.preventDefault(); | |
const href = event.currentTarget.getAttribute("href"); | |
const section = document.querySelector(href); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.boxs { | |
display: grid; | |
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | |
gap: 20px; | |
} | |
#box-1 { | |
background: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const result2 = document.querySelector("#result2"); | |
async function fetchPposts(url) { | |
const productsResponse = await fetch(url); | |
const jsonBody = await productsResponse.json(); | |
return jsonBody; | |
} | |
const requisicaoProd = fetchPposts( | |
"https://meusite.com.br/wp-json/wc/store/products" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CÓDIGO REFATORADO PELO CHATGPT | |
const result = document.querySelector("#result"); | |
async function fetchPosts(url) { | |
try { | |
const response = await fetch(url); | |
const jsonData = await response.json(); | |
return jsonData; | |
} catch (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//async / await | |
const result = document.querySelector("#result"); | |
async function fetchPposts(url) { | |
const response = await fetch(url); | |
const jsonBody = await response.json(); | |
return jsonBody; | |
} |
NewerOlder