A Pen by Bruno Rafael on CodePen.
Last active
May 13, 2016 13:12
-
-
Save brunorafaeI/5c53a980398f01f7bd1dd459632142bf to your computer and use it in GitHub Desktop.
ZWZLzK
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Com'on - Association de Saint-Nazaire</title> | |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<header> | |
<div class="logo"><img src="http://www.com-on.be/templates/comon_2015/images/logo.png" alt="Com'on st-nazaire" width="60%" height="60%" /></div> | |
</header> | |
<nav class="navigation"> | |
<ul> | |
<li><a href="#">Accueil</a></li> | |
<li><a href="#">Nos Services</a></li> | |
<li><a href="#">Commander</a></li> | |
<li><a href="#">Contact</a></li> | |
<li><a href="#">À propos</a></li> | |
</ul> | |
</nav> | |
<section> | |
<article></article> | |
<article></article> | |
</section> | |
<aside> | |
</aside> | |
<footer> | |
<p>Com'on Association de pano boutique - Saint-Nazaire Corpyright 2016 <br/>115, Avenue de la République - 44600 Saint-Nazaire France</p> | |
<p></p> | |
</footer> | |
</body> | |
</html> |
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(){ $(window).scroll(function () { | |
//Au scroll dans la fenetre on déclenche la fonction | |
if ($(this).scrollTop() > 150) { | |
//si on a défilé de plus de 150px du haut vers le bas | |
$('#navigation').addClass("fixNavigation"); //on ajoute la classe "fixNavigation" à <div id="navigation"> | |
} else { $('.navigation').removeClass("fixNavigation"); | |
//sinon on retire la classe "fixNavigation" à <div id="navigation"> | |
} }); }); | |
window.onscroll = changePos; | |
function changePos() { | |
var header = document.getElementById("header"); | |
if (window.pageYOffset > 70) { | |
header.style.position = "absolute"; | |
header.style.top = pageYOffset + "px"; | |
} else { | |
header.style.position = ""; | |
header.style.top = ""; | |
} | |
} |
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
* {margin:0px; padding:0px; overflow-x:none; font-family: Verdana,sans-serif;} | |
html, body { | |
height:100%; | |
background: url(http://www.communide.fr/medias/files/blue-yellow-bokeh-circles-desktop-wallpaper.jpg) no-repeat center center fixed; | |
background-size: cover; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
} | |
main{ | |
position:relative; | |
min-height:100%; | |
} | |
header { | |
height:4em; | |
background:rgba(255,255,255, 0.9); | |
padding:20px; | |
box-shadow: 0px 0px 20px 1px rgba(0,0,0, 0.8) inset; | |
} | |
header .logo{ | |
float:left; | |
left: 1.5em; | |
} | |
nav{ | |
position:fixed; | |
height:60px; | |
width:600px; | |
top:0; | |
right:0; | |
} | |
nav ul { | |
list-style:none; | |
display:block; | |
} | |
nav ul li { | |
display:inline; | |
} | |
nav ul li a { | |
float:left; | |
text-decoration:none; | |
font-size:0.9em; | |
line-height:1.5; | |
font-weight:bold; | |
color: rgba(0,0,0, 0.7); | |
border-bottom: 0px solid rgba(0,0,0, 0); | |
transition: border 0.6s; | |
padding:18px 12px 0px 12px; | |
} | |
nav ul li a:hover{ | |
color:rgba(0,0,0, 0.9); | |
border-bottom:4px solid rgba(255,128,25, 1); | |
transition: border 0.4s; | |
} | |
section{ | |
position:absolute; | |
background-color: rgba(153,0,52, 0.9); | |
margin:5em 2em; | |
width:60%; | |
height:45%; | |
border-radius: 0px 10px 10px 0px; | |
} | |
aside { | |
position:absolute; | |
margin:5em 2em; | |
width: 30%; | |
height:45%; | |
right:0; | |
background-color: rgba(204,165,20, 0.8); | |
border-radius: 10px 0px 0px 10px; | |
} | |
footer { | |
position:absolute; | |
width:99%; | |
height:2em; | |
bottom:0; | |
text-align:center; | |
color: rgb(50,50,50); | |
font-size:0.8em; | |
background-color: rgba(255,255,255, 0.8); | |
padding:0.6em; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment