LuizH.M
Members-
Total de itens
12 -
Registro em
-
Última visita
Tudo que LuizH.M postou
-
from urllib.request import urlopen response = urlopen("http://vimeo.com/api/v2/video/57733101.json").read().decode('utf8') dados = json.loads(response)[0] print(dados) print('Titulo: ',dados['title']) print('URL: ',dados['url']) print('Duração',dados['duration']) a parte do json fala que não está definida me ajudem pls estou usando o visual studio
-
Estou tentando criar um scroll suave mais por algum motivo não esta indo Quem puder ajudar eu agradeço MENU <div class="navigation"> <nav class="menu"> <div class="logo"> <span>Gamer Lovers</span> </div> <ul> <li><a href="index.html">Inicio</a></li> <li><a href="#quem-somos">Quem Somos</a></li> <li><a href="https://web.whatsapp.com/send?phone=*************" target="_blank">Contato</a></li> <li><a href="#">Entrar</a></li> </ul> </nav> </div> JAVASCRIPT const menuLinks = document.querySelectorAll('.menu a[href^="#"]'); function getDistanceFromTheTop(element) { const id = element.getAttribute("href"); return document.querySelector(id).offsetTop; } function scrollToSection(event) { event.preventDefault(); const distanceFromTheTop = getDistanceFromTheTop(event.target) - 90; smoothScrollTo(0, distanceFromTheTop); } menuLinks.forEach((link) => { link.addEventListener("click", scrollToSection); }); function smoothScrollTo(endX, endY, duration) { const startX = window.scrollX || window.pageXOffset; const startY = window.scrollY || window.pageYOffset; const distanceX = endX - startX; const distanceY = endY - startY; const startTime = new Date().getTime(); duration = typeof duration !== "undefined" ? duration : 400; const easeInOutQuart = (time, from, distance, duration) => { if ((time /= duration / 2) < 1) return (distance / 2) * time * time * time * time + from; return (-distance / 2) * ((time -= 2) * time * time * time - 2) + from; }; const timer = setInterval(() => { const time = new Date().getTime() - startTime; const newX = easeInOutQuart(time, startX, distanceX, duration); const newY = easeInOutQuart(time, startY, distanceY, duration); if (time >= duration) { clearInterval(timer); } window.scroll(newX, newY); }, 1000 / 60); }
-
Muito obrigado man
- 2 respostas
-
Estou tentando alterar um css via javascript mas por algum motivo da erro se puder ajudar agradeço html <!DOCTYPE html> <html lang="pt-br"> <head> <!--Titulo--> <title>Projeto</title> <!--Cadeia de caracteres--> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-compatible" content="ei=edge"> <link rel="stylesheet" type="text/css" href="css/estilo.css"> </head> <body> <header></header> <input type="checkbox" id="chk" onclick="chk()"> <label for="chk" class="menu-chk">☰</label> <div class="bg"></div> <nav class="menu" id="principal"> <ul> <li><a href="#" class="home">Home</a></li> <li><a href="#">Contato</a></li> <li><a href="#">Forum</a></li> <li><a href="#">Sobre</a></li> </ul> </nav> <footer> <script type="text/javascript" src="js/javascript.js"></script> </footer> </body> </html> css *{ padding: 0; margin: 0; } header{ position: fixed; top: 0; left: 0; height: 50px; width: 100%; background-color: #5b859a; } .menu-chk{ position: fixed; font-size: 25px; font-weight: bold; padding: 5px; width: 40px; height: 40px; text-align: center; background-color: #5b859a; color: #fff; cursor: pointer; transition: all.4s; left: 301px; top: 0; } .menu-chk:hover{ background-color: #fff; color: #5b859a; } .menu{ height: 100%; position: fixed; background-color: #222; top: 0; overflow: hidden; transition: all .4s; } #principal{ width: 300px; left: -300px; } ul{ list-style: none; } ul li a{ display: block; font-size: 18px; font-family: 'Arial'; padding: 10px; border-bottom: solid 1px #000; color: #ccc; text-decoration: none; transition: all.4s; } ul li span{ float: right; padding-right: 10px; } ul li a:hover{ background-color: #5b859a; } .home{ margin-top: 60px; background-color: #111; border-left: solid 5px #444; } js function chk() { var chk = document.getElementById('chk'); var menu = document.getElementById('principal'); chk.is(':checked'){ menu.style.left = "300px"; } }
- 2 respostas