Browse Source

+ anchors

gh-pages
RubaXa 11 years ago
parent
commit
94235ee0d7
  1. 56
      index.html
  2. 21
      st/app.css

56
index.html

@ -27,10 +27,9 @@
<h1 title="Try demo!"><u>Ply</u></h1> <h1 title="Try demo!"><u>Ply</u></h1>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<h2>Alert</h2> <h2><a href="#Alert" name="Alert">Alert</a></h2>
<div class="col-left"> <div class="col-left">
<div class="ply-layer alert example"> <div class="ply-layer alert example">
@ -49,7 +48,7 @@
</div> </div>
<div class="row"> <div class="row">
<h2>Confirm</h2> <h2><a href="#Confirm" name="Confirm">Confirm</a></h2>
<div class="col-left"> <div class="col-left">
<div class="ply-layer confirm example"> <div class="ply-layer confirm example">
@ -72,7 +71,7 @@
</div> </div>
<div class="row"> <div class="row">
<h2>Prompt</h2> <h2><a href="#Prompt" name="Prompt">Prompt</a></h2>
<div class="col-left"> <div class="col-left">
<div class="ply-layer prompt example"> <div class="ply-layer prompt example">
@ -99,7 +98,7 @@
<br/> <br/>
<div class="row"> <div class="row">
<h2>Dialogs / Multistep</h2> <h2><a href="#Dialogs" name="Dialogs">Dialogs / Multistep</a></h2>
<div class="col-left"> <div class="col-left">
<div class="ply-layer confirm example"> <div class="ply-layer confirm example">
@ -120,8 +119,10 @@
ok: "Yes", ok: "Yes",
cancel: "No" cancel: "No"
}, },
next: "congratulations", next: "congratulations", // OK button
nextEffect: "3d-flip[180,-180]" nextEffect: "3d-flip[180,-180]",
back: "exit", // Cancel button
backEffect: "scale"
}, },
"congratulations": { "congratulations": {
data: { data: {
@ -131,6 +132,9 @@
}], }],
ok: "Okay" ok: "Okay"
} }
},
"exit": {
data: "Very vain!"
} }
}); });
</code></pre> </code></pre>
@ -151,26 +155,30 @@
<div style="height: 100px"></div> <div style="height: 100px"></div>
<script> <script>
// Polyfills // Boot
![].forEach && document.writeln('<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-shim.min.js"><' + '/script>') (function () {
</script> var files = [];
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> ![].forEach && files.push('//cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-shim.min');
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.0/highlight.min.js"></script> files.push('//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.0/highlight.min');
<script>
if (/local/.test(location)) { if (/local/.test(location)) {
document.write('<script src="./Ply.js"><'+'/script>'); files.push('/js/jquery.dev', './Ply' );
document.write('<script src="./Ply.ui.js"><'+'/script>');
} else { } else {
document.write('<script src="./Ply.min.js"><'+'/script>'); files.push('//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min', './Ply.min');
}
for (var i = 0; i < files.length; i++) {
document.write('<script src="' + files[i] + '.js"></' + 'script>');
} }
})();
</script> </script>
<script> <script>
(function ($) { (function ($) {
hljs.configure({ classPrefix: '' }); window.hljs && hljs.configure({ classPrefix: '' });
$('.example') $('.example')
.each(function () { .each(function () {
@ -296,6 +304,20 @@
} }
}); });
}); });
// Select active example
(function _change() {
$('body')
.find('.selected')
.removeClass('selected')
.end()
.find('[name="' + location.toString().split('#')[1] + '"]')
.addClass('selected')
;
$(window).on('hashchange', _change);
})();
})(jQuery); })(jQuery);
</script> </script>

21
st/app.css

@ -38,10 +38,31 @@ h1 {
text-decoration: none; text-decoration: none;
} }
h2 { h2 {
position: relative;
font-size: 30px; font-size: 30px;
margin-bottom: 10px; margin-bottom: 10px;
} }
/* anchors */
h2 a {
color: #fff;
outline: 0;
text-decoration: none;
}
h2 a:before {
right: 100%;
padding-right: 10px;
display: block;
content: '→';
position: absolute;
visibility: hidden;
}
h2 a:hover:before,
h2 a.selected:before {
visibility: visible;
}
.row { .row {

Loading…
Cancel
Save