Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

pedro123

Como colocar um vídeo responsivo em uma SECTION

Recommended Posts

Ola pessoal.

 

Eu to com um problema não estou conseguindo colocar um vídeo que fique em tela cheia e responsivo em uma section, eu queria que o vídeo fica-se na tela toda e na segunda  section iria ter o conteúdo normal .

Exemplo : http://westelmhotels.com/

 

meu código

<!DOCTYPE html>
<html lang="pt-br">
<head>

   <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/estilo.css"> 
    <title>..</title>
</head>
<body>




<input type="checkbox" name="menu" id="menu">
<label for="menu"><span></span></label>




<nav id="conteudo-do-menu">
    <h1>asdfg0</h1>
    <p>sdlfjkhuisdfh</p>
</nav>


    <section id="primeira-secao"> 
    <video id="background-video" >
        <source src="images/background-video.mp4" type="video/mp4"></source>
    </video>

    <div class="bem-vindo">
        <h2>Bem-vindo</h2>
        <h3>ao</h3>
        <h1>....</h1>        
    </div>
        
    </section>
    <section id="call-to-action">
        <p>A terra é insultada e oferece suas flores como resposta</p>

    </section>
   

</body>
</html>
*{margin: 0; padding: 0;}

body{
	font-family: Calibri, sans-serif;

}


#menu{display: none; }

#conteudo-do-menu{
	background: #181818;
	color: #fff;
	position:absolute;
	top:-250px;
	left:0;
	width: 100%;
	height: 250px;
	padding: 20px;
	-webkit-transition: top 300ms cubic-bezier(0.15,0.04,0.03,0.94);
	-moz-transition: top 300ms cubic-bezier(0.15,0.04,0.03,0.94);
	transition: top 300ms cubic-bezier(0.15,0.04,0.03,0.94);
	overflow: hidden;
	box-sizing: border-box;	
	position: fixed;
	z-index: 1000;
		
}

#menu+label{
	position:absolute;
	cursor: pointer;
	padding: 10px;
	/*background: rgba(0,0,0,0.5);*/
	width: 50px;
	height: 50px;
	margin: 5px 5px;
	transition: all 500ms ease;
	position: fixed;
	z-index:1000;
	
	
}



span {
	position:absolute ;
	width: 50px;
	height: 6px;
	background-color: #fff;
	top: 45%;
	left: 20%;
	transition: : all 0.5s linear;
	z-index: 1000;

		
}

span:before{
	content:'';
	width: 50px;
	height: 6px;
	bottom: -15px;
	background-color: #fff;
	position:absolute;	
	transition: all 0.5s linear;
		
}


span:after{
	content:'';
	width: 50px;
	height: 6px;
	top: -15px;
	background-color: #fff;
	position:absolute;	
	transition: all 0.5s linear;
		
}

#menu:checked~label span{
	background-color: transparent;
}

#menu:checked~label span:before{
	transform: translate(0px, -15px) rotate(-45deg);
}

#menu:checked~label span:after{
	transform: translate(0px, 15px) rotate(45deg);
}

/*#menu:checked~label{
	border-radius: 50%;
}
*/
#menu:checked~#conteudo-do-menu{top:0;}

#primeira-secao { transition: margin 300ms cubic-bezier(0.15,0.04,0.03,0.94); }

#menu:checked~#primeira-secao{ margin-top: 250px;}




#primeira-secao{
	position: relative;
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	overflow: hidden;
	
}

#background-video{
	min-width: 100%;
	left: 50%;
	
}


 
.bem-vindo {
 	position: absolute;
 	top: 0;
 	left: 0;
 	bottom: 0;
 	right: 0;
 	background-color: rgba(0, 0, 0, 0.5);
 }

.bem-vindo h2{margin-top: 10%;}

.bem-vindo h1, h2, h3 {
	text-align: center;
	color: white;
	padding: 3px;
	

}

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Você precisa envolver o vídeo e o conteúdo que vai ficar em cima do vídeo tudo em uma div.

Por exemplo:

 

<div class="banner">
  <!--Aqui você coloca o seu vídeo rodando normal-->
  <video></video>
  
  <!--Aqui você coloca todo conteudo que vai ficar em cima do banner-->
  <div class="conteudo">
  	<!--Conteudo-->
  </div>
</div>
.banner{
	position: relative;
	width: 100%;
	height: 500px; //Coloque a altura que quiser
}

.banner video{
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.banner .conteudo{
	position: absolute;
	top: 50%;
	left: 50%;
  	-webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

 

Não cheguei a testar o código, mas veja se da certo. Qualquer coisa vá postando os bugs ai.

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por ILR master
      Fala pessoal, tudo bem?
       
      Eu tenho o seguinte código:
       
      <script>
         $(function(){
      var jElement = $('.fixar_banner');
      $(window).scroll(function(){
          if ( $(this).scrollTop() > 120 ){
              jElement.css({
                  'position':'fixed',
                  'top':'10px'
              });
          }else{
              jElement.css({
                  'position':'relative',
                  'top':'auto'
              });
          }
      });
      });
      </script>
       
      Porém, eu quero que a div fique fixa até que outro elemento apareça na tela, tipo o rodapé da página por exemplo. É mais ou menos como a página de notícia do uol.
      https://noticias.uol.com.br/internacional/ultimas-noticias/2025/01/19/sonho-americano-brasileiros-moram-em-carro-e-buscam-comida-no-lixo-nos-eua.htm
       
      Espero ter sido claro.
       
      Obrigado :)
       
    • Por violin101
      Caros amigos, saudações.

      Estou com uma dúvida, referente cálculo de valores em tempo real.

      Tenho uma rotina, que faz o cálculo, o problema é mostrar o resultado.

      Quero mostrar o RESULTADO assim: 0,00  ou  0.00

      Abaixo posto o código.
      jQuery('input').on('keyup',function(){ //Remover ponto e trocar a virgula por ponto var m = document.getElementById("pgRest").value; while (m.indexOf(".") >= 0) { m = m.replace(".", ""); } m = m.replace(",","."); //Remover ponto e trocar a virgula por ponto var j = document.getElementById("pgDsct").value; while (j.indexOf(".") >= 0) { j = j.replace(".", ""); } j = j.replace(",","."); m = parseFloat(jQuery('#pgRest').val() != '' ? jQuery('#pgRest').val() : 0); j = parseFloat(jQuery('#pgDsct').val() != '' ? jQuery('#pgDsct').val() : 0); //Mostra o Resultado em Tempo Real jQuery('#pgTroco').val(m - j); <<=== aqui estou errando })  
       
      Grato,
       
      Cesar
       
       
    • Por violin101
      Caro amigos, saudações.

      Tenho uma tabela escrita em JS que funciona corretamente.
       
      Minha dúvida:
      - como devo fazer para quando a Tabela HTML estiver vazia, exibir o LOGO da Empresa ?

      Abaixo posto o script:
      document.addEventListener( 'keydown', evt => { if (!evt.ctrlKey || evt.key !== 'i' ) return;// Não é Ctrl+A, portanto interrompemos o script evt.preventDefault(); //Chama a Função Calcular Qtde X Valor Venda calcvda(); var idProdutos = document.getElementById("idProdutos").value; var descricao = document.getElementById("descricao").value; var prd_unid = document.getElementById("prd_unid").value; var estoque_atual = document.getElementById("estoque_atual").value; var qtde = document.getElementById("qtde").value; var vlrunit = document.getElementById("vlrunit").value; var vlrtotals = document.getElementById("vlrtotal").value; var vlrtotal = vlrtotals.toLocaleString('pt-br', {minimumFractionDigits: 2}); if(validarConsumo(estoque_atual)){ //Chama a Modal com Alerta. $("#modal_qtdemaior").modal(); } else { if(qtde == "" || vlrunit == "" || vlrtotal == ""){ //Chama a Modal com Alerta. $("#modal_quantidade").modal(); } else { //Monta a Tabela com os Itens html = "<tr style='font-size:13px;'>"; html += "<td width='10%' height='10' style='text-align:center;'>"+ "<input type='hidden' name='id_prds[]' value='"+idProdutos+"'>"+idProdutos+"</td>"; html += "<td width='47%' height='10'>"+ "<input type='hidden' name='descricao[]' value='"+descricao+"'>"+descricao+ "<input type='hidden' name='esp[]' value='"+prd_unid+"'> - ESP:"+prd_unid+ "<input type='hidden' name='estoq[]' value='"+estoque_atual+"'></td>"; html += "<td width='10%' height='10' style='text-align:center;'>"+ "<input type='hidden' name='qtde[]' value='"+qtde+"'>"+qtde+"</td>"; html += "<td width='12%' height='10' style='text-align:right;'>"+ "<input type='hidden' name='vlrunit[]' value='"+vlrunit+"'>"+vlrunit+"</td>"; html += "<td width='14%' height='10' style='text-align:right;'>"+ "<input type='hidden' name='vlrtotal[]' value='"+vlrtotal+"'>"+vlrtotal+"</td>"; html += "<td width='12%' height='10' style='text-align:center;'>"+ "<button type='button' class='btn btn-uvas btn-remove-produto' style='margin-right:1%; padding:1px 3px; font-size:12px;' title='Remover Item da Lista'>"+ "<span class='fa fa-minus' style='font-size:12px;'></span></button></td>"; html += "</tr>"; $("#tbventas tbody").append(html); //Função para Somar os Itens do Lançamento somar(); $("#idProdutos").val(null); $("#descricao").val(null); $("#prd_unid").val(null); $("#qtde").val(null); $("#vlrunit").val(null); $("#vlrtotal").val(null); $("#idProdutos").focus(); //Se INCLUIR NOVO produto - Limpa a Forma de Pagamento $("#pgSoma").val(null); $("#pgRest").val(null); $("#pgDsct").val(null); $("#pgTroco").val(null); $("#tbpagar tbody").empty(); }//Fim do IF-qtde }//Fim do Validar Consumo });//Fim da Função btn-agregar  
      Grato,

      Cesar
       
    • Por violin101
      Caros amigos, saudações.

      Estou com uma pequena dúvida se é possível ser realizado.

      Preciso passar 2 IDs para o Sistema executar a função, estou utilizando desta forma e gostaria de saber como faço via JS para passar os parâmetro que preciso.

      Observação:
      Dentro da TABELA utilizei 2 Forms, para passar os IDS que preciso, funcionou conforme código abaixo.
      <div class="card-body"> <table id="tab_clie" class="table table-bordered table-hover"> <thead> <tr> <th style="text-align:center; width:10%;">Pedido Nº</th> <th style="text-align:center; width:10%;">Data Pedido</th> <th style="text-align:center; width:32%;">Fornecedor</th> <th style="text-align:center; width:10%;">Status</th> <th style="text-align:center; width:5%;">Ação</th> </tr> </thead> <tbody> <?php foreach ($results as $r) { $dta_ped = date(('d/m/Y'), strtotime($r->dataPedido)); switch ($r->pd_status) { case '1': $status = '&nbsp;&nbsp;Aberto&nbsp;&nbsp;'; $txt = '#FFFFFF'; //Cor: Branco $cor = '#000000'; //Cor: Preta break; case '2': $status = 'Atendido Total'; $txt = '#FFFFFF'; //Cor: Branco $cor = '#086108'; //Cor: Verde break; case '3': $status = 'Atendido Parcial'; $txt = '#000000'; //Cor: Branco $cor = '#FEA118'; //Cor: Amarelo break; default: $status = 'Cancelado'; $txt = '#FFFFFF'; //Cor: Branco $cor = '#D20101'; //Cor: Vermelho break; } echo '<tr>'; echo '<td width="10%" height="10" style="text-align:center;">'.$r->pd_numero.'</td>'; echo '<td width="10%" height="10" style="text-align:center;">'.$dta_ped.'</td>'; echo '<td width="32%" height="10" style="text-align:left;">'.$r->nome.'</td>'; echo '<td width="10%" height="10" style="text-align:left;"><span class="badge" style="color:'.$txt.'; background-color:'.$cor.'; border-color:'.$cor.'">'.$status.'</span></td>'; echo '<td width="5%" style="text-align:center;">'; ?> <div class="row"> <?php if($this->permission->checkPermission($this->session->userdata('permissao'), 'vPedido')){ ?> <form action="<?= base_url() ?>compras/pedidos/visualizar" method="POST" > <input type="hidden" name="idPedido" value="<?php echo $r->idPedidos; ?>"> <input type="hidden" name="nrPedido" value="<?php echo $r->pd_numero; ?>"> <button class="btn btn-warning" title="Visualizar" style="margin-left:50%; padding: 1px 3px;"><i class="fa fa-search icon-white"></i></button> </form> <?php } if($this->permission->checkPermission($this->session->userdata('permissao'), 'ePedido')){ ?> <form action="<?= base_url() ?>compras/pedidos/editar" method="POST" > <input type="hidden" name="idPedido" value="<?php echo $r->idPedidos; ?>"> <input type="hidden" name="nrPedido" value="<?php echo $r->pd_numero; ?>"> <button class="btn btn-primary" title="Editar" style="margin-left:50%; padding: 1px 3px;"><i class="fa fa-edit icon-white"></i></button> </form> <?php } ?> </div> <?php echo '</td>'; echo '</tr>'; } ?> </tbody> </table> </div>
      Grato,

      Cesar.
    • Por belann
      Olá!
       
      Estou usando o editor quill em uma página html, sem fazer a instalação com npm, mas usando as api´s via internet com http, no entanto não consigo fazer a tecla enter funcionar para mudança de linha, tentei essa configuração abaixo, mas não funcionou.
       
      modules: {       syntax: true,       toolbar: '#toolbar-container',       keyboard: {         bindings: {           enter: {             key: 13,             handler: function(range, context) {                       quill.formatLine(range.index, range.length, { 'align': '' });             }           }  
       
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.