Bonjour,
J'essaye de réaliser deux menu circulaires qui s'ouvrent au clic du bouton et qui sont cote a cote.
Au clic, pas d'ouverture du menu et je me demande d'ou vient le probleme.
Voici le code hmtl :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0"/>-->
<title></title>
<link href='http://fonts.googleapis.com/css?family=Text+Me+One' rel='stylesheet' type='text/css'/>
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/component2.css" />
<script src="modernizr-2.6.2.min.js"></script>
</head>
<body>
<div class="container">
<!-- Top Navigation -->
<div class="component">
<!-- Start Nav Structure -->
<button class="cn-button" id="Button1" >Menu</button>
<div class="cn-wrapper" >
<ul>
<li><a href="#"><span>B.A.S.E</span></a></li>
<li><a href="#"><span>IMPACT</span></a></li>
<li><a href="#"><span>HORS-SERIE</span></a></li>
<li><a href="#"><span>BARBEUK'</span></a></li>
<li><a href="#"><span>HOOD</span></a></li>
<li><a href="#"><span>Contact</span></a></li>
<li><a href="#"><span>Follow</span></a></li>
</ul>
</div>
<!-- Top Navigation -->
<div class="component">
<!-- Start Nav Structure -->
<button class="cn-button" id="Button2" >CREW</button>
<div class="cn-wrapper" >
<ul>
<li><a href="#"><span>About</span></a></li>
<li><a href="#"><span>Danseurs</span></a></li>
<li><a href="#"><span>Articles</span></a></li>
<li><a href="#"><span>Snippets</span></a></li>
<li><a href="#"><span>Plugins</span></a></li>
<li><a href="#"><span>Contact</span></a></li>
<li><a href="#"><span>Follow</span></a></li>
</ul>
</div>
</div>
</div></div>
<script src="polyfills.js"></script>
<script src="demo2.js"></script>
</body>
</html> |
Le CSS :
* Demo.CSS:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
| @import url(<a href="http://fonts.googleapis.com/css?family=Text+Me+One);" target="_blank">http://fonts.googleapis.com/css?family=Text+Me+One);</a>
@font-face {
font-family: 'Text Me One', sans-serif;
font-weight: normal;
font-style: normal;
}
.container > header,
.codrops-top,
.container > section {
font-family: 'Text Me One', sans-serif;
}
.container > header {
margin: 0 auto;
padding: 2em;
text-align: center;
background: rgba(0,0,0,0.01);
}
.container > header h1 {
font-size: 2.625em;
line-height: 1.3;
margin: 0;
font-weight: 300;
}
.container > header span {
display: block;
font-size: 60%;
opacity: 0.7;
padding: 0 0 0.6em 0.1em;
}
/* To Navigation Style */
.codrops-top {
background: #f06060;
background: rgba(255, 255, 255, 0.1);
text-transform: uppercase;
width: 100%;
font-size: 0.69em;
line-height: 2.2;
}
.codrops-top a {
text-decoration: none;
padding: 0 1em;
letter-spacing: 0.1em;
color: #fff;
display: inline-block;
}
.codrops-top a:hover {
background: rgba(255,255,255,0.95);
color: #777;
}
.codrops-top span.right {
float: right;
}
.codrops-top span.right a {
float: left;
display: block;
}
.codrops-icon:before {
font-family: 'codropsicons';
margin: 0 4px;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.codrops-icon-drop:before {
content: "\e001";
}
.codrops-icon-prev:before {
content: "\e004";
}
/* Demo Buttons Style */
.codrops-demos {
padding-top: 1em;
font-size: 0.9em;
}
.codrops-demos a {
text-decoration: none;
outline: none;
display: inline-block;
margin: 0.5em;
padding: 0.7em 1.1em;
border: 3px solid #fff;
color: #fff;
font-weight: 700;
}
.codrops-demos a:hover,
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover {
opacity: 0.6;
}
.container > section {
padding: 2em;
font-size: 1.4em;
max-width: 50em;
margin: 0 auto;
}
.container > section p {
padding: 0.8em 0;
text-align: justify;
opacity: 0.5;
font-weight: 300;
line-height: 1.4;
}
@media screen and (max-width: 25em) {
.codrops-icon span {
display: none;
}
} |
*normalize.CSS
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}
* COmponent2.CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
| @import url(<a href="http://fonts.googleapis.com/css?family=Text+Me+One);" target="_blank">http://fonts.googleapis.com/css?family=Text+Me+One);</a>
* {
position: relative;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
}
html,
body {
height: 100%;
}
body {
background-color: black;
color: #fff;
}
.component {
position: relative;
margin-bottom: 3em;
height: 15em;
background-color: black;
font-family: 'Text Me One', sans-serif;
color: white;
}
.component > h2 {
position: absolute;
overflow: hidden;
width: 100%;
text-align: center;
text-transform: uppercase;
white-space: nowrap;
font-weight: 300;
font-style: italic;
font-size: 12em;
opacity: 0.1;
cursor: default;
}
#Button1 {
margin-left:30%;
}
#Button2 {
margin-left:60%
}
.cn-button {
border-style: none;
border-color: inherit;
border-width: medium;
position:absolute;
top: 120%;
z-index: 11;
margin-top: -2.25em;
margin-left: -2.25em;
padding-top: 0em;
width: 4.5em;
height: 4.5em;
border-radius: 50%;
background: white;
color: black;
text-align: center;
font-weight: 700;
font-size: 1.5em;
text-transform: uppercase;
cursor: pointer;
-webkit-backface-visibility: hidden;
}
.csstransforms .cn-wrapper {
position: absolute;
top: 100%;
left: 50%;
z-index: 10;
margin-top: -13em;
margin-left: -13.5em;
width: 27em;
height: 27em;
border-radius: 50%;
background: transparent;
opacity: 0;
-webkit-transition: all .3s ease 0.3s;
-moz-transition: all .3s ease 0.3s;
transition: all .3s ease 0.3s;
-webkit-transform: scale(0.1);
-ms-transform: scale(0.1);
-moz-transform: scale(0.1);
transform: scale(0.1);
pointer-events: none;
overflow: hidden;
}
/*cover to prevent extra space of anchors from being clickable*/
.csstransforms .cn-wrapper::after {
content:",";
display:block;
font-size:2em;
width:6.2em;
height:6.2em;
position: absolute;
left: 50%;
margin-left: -3.1em;
top:50%;
margin-top: -3.1em;
border-radius: 50%;
z-index:10;
color: transparent;
}
.csstransforms .opened-nav {
border-radius: 50%;
opacity: 1;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
pointer-events: visible;
}
.csstransforms .cn-wrapper li {
position: absolute;
top: 50%;
left: 50%;
overflow: hidden;
margin-top: -1.3em;
margin-left: -10em;
width: 10em;
height: 10em;
font-size: 1.5em;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
-webkit-transform: rotate(76deg) skew(60deg);
-moz-transform: rotate(76deg) skew(60deg);
-ms-transform: rotate(76deg) skew(60deg);
transform: rotate(76deg) skew(60deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
transform-origin: 100% 100%;
pointer-events: none;
}
.csstransforms .cn-wrapper li a {
position: absolute;
position: fixed; /* fix the displacement bug in webkit browsers when using tab key */
right: -7.25em;
bottom: -7.25em;
display: block;
width: 14.5em;
height: 14.5em;
border-radius: 50%;
background: #429a67;
background: -webkit-radial-gradient(transparent 35%, #429a67 35%);
background: -moz-radial-gradient(transparent 35%, #429a67 35%);
background: radial-gradient(transparent 35%, #429a67 35%);
color: #fff;
text-align: center;
text-decoration: none;
font-size: 1.2em;
line-height: 2;
-webkit-transform: skew(-60deg) rotate(-75deg) scale(1);
-moz-transform: skew(-60deg) rotate(-75deg) scale(1);
-ms-transform: skew(-60deg) rotate(-75deg) scale(1);
transform: skew(-60deg) rotate(-75deg) scale(1);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
pointer-events: auto;
}
.csstransforms .cn-wrapper li a span {
position: relative;
top: 1.8em;
display: block;
font-size: .5em;
font-weight: 700;
text-transform: uppercase;
}
.csstransforms .cn-wrapper li a:hover,
.csstransforms .cn-wrapper li a:active,
.csstransforms .cn-wrapper li a:focus {
background: -webkit-radial-gradient(transparent 35%, #449e6a 35%);
background: -moz-radial-gradient(transparent 35%, #449e6a 35%);
background: radial-gradient(transparent 35%, #449e6a 35%);
}
.csstransforms .opened-nav li {
-webkit-transition: all .3s ease .3s;
-moz-transition: all .3s ease .3s;
transition: all .3s ease .3s;
}
.csstransforms .opened-nav li:first-child {
-webkit-transform: rotate(-20deg) skew(60deg);
-moz-transform: rotate(-20deg) skew(60deg);
-ms-transform: rotate(-20deg) skew(60deg);
transform: rotate(-20deg) skew(60deg);
}
.csstransforms .opened-nav li:nth-child(2) {
-webkit-transform: rotate(12deg) skew(60deg);
-moz-transform: rotate(12deg) skew(60deg);
-ms-transform: rotate(12deg) skew(60deg);
transform: rotate(12deg) skew(60deg);
}
.csstransforms .opened-nav li:nth-child(3) {
-webkit-transform: rotate(44deg) skew(60deg);
-moz-transform: rotate(44deg) skew(60deg);
-ms-transform: rotate(44deg) skew(60deg);
transform: rotate(44deg) skew(60deg);
}
.csstransforms .opened-nav li:nth-child(4) {
-webkit-transform: rotate(76deg) skew(60deg);
-moz-transform: rotate(76deg) skew(60deg);
-ms-transform: rotate(76deg) skew(60deg);
transform: rotate(76deg) skew(60deg);
}
.csstransforms .opened-nav li:nth-child(5) {
-webkit-transform: rotate(108deg) skew(60deg);
-moz-transform: rotate(108deg) skew(60deg);
-ms-transform: rotate(108deg) skew(60deg);
transform: rotate(108deg) skew(60deg);
}
.csstransforms .opened-nav li:nth-child(6) {
-webkit-transform: rotate(140deg) skew(60deg);
-moz-transform: rotate(140deg) skew(60deg);
-ms-transform: rotate(140deg) skew(60deg);
transform: rotate(140deg) skew(60deg);
}
.csstransforms .opened-nav li:nth-child(7) {
-webkit-transform: rotate(172deg) skew(60deg);
-moz-transform: rotate(172deg) skew(60deg);
-ms-transform: rotate(172deg) skew(60deg);
transform: rotate(172deg) skew(60deg);
}
.no-csstransforms .cn-wrapper {
overflow: hidden;
margin: 10em auto;
padding: .5em;
text-align: center;
}
.no-csstransforms .cn-wrapper ul {
display: inline-block;
}
.no-csstransforms .cn-wrapper li {
float: left;
width: 5em;
height: 5em;
background-color: #fff;
text-align: center;
font-size: 1em;
line-height: 5em;
}
.no-csstransforms .cn-wrapper li a {
display: block;
width: 100%;
height: 100%;
color: inherit;
text-decoration: none;
}
.no-csstransforms .cn-wrapper li a:hover,
.no-csstransforms .cn-wrapper li a:active,
.no-csstransforms .cn-wrapper li a:focus {
background-color: #f8f8f8;
}
.no-csstransforms .cn-wrapper li.active a{
background-color: #6F325C;
color: #fff;
}
.no-csstransforms .cn-button {
display: none;
}
@media only screen and (max-width: 620px) {
.no-csstransforms li {
width: 4em;
height: 4em;
line-height: 4em;
}
}
@media only screen and (max-width: 500px) {
.no-ccstransforms .cn-wrapper {
padding: .5em;
}
.no-csstransforms .cn-wrapper li {
width: 4em;
height: 4em;
font-size: .9em;
line-height: 4em;
}
}
@media only screen and (max-width: 480px) {
.csstransforms .cn-wrapper {
font-size: .68em;
}
.cn-button {
font-size: 1em;
}
}
@media only screen and (max-width:420px) {
.no-csstransforms .cn-wrapper li {
width: 100%;
height: 3em;
line-height: 3em;
}
} |
Et le tutoriel original se trouve ici :
http://tympanus.net/codrops/2013/08/...ss-transforms/
JE cherche a reproduire le Deuxieme Menu.
SVP Pouvez vous me dire où est-ce que je foire ? Ca fait 2 jours que je suis dessus ...
Partager