mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
139 lines
3.6 KiB
HTML
139 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Overlay</title>
|
|
<script src="../../polyfills/Components/components-polyfill.js" shadow="shim"></script>
|
|
<link rel="components" href="../../toolkit/src/g-overlay.html">
|
|
<style>
|
|
body {
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
margin: 20px;
|
|
-webkit-user-select: none;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.dialog {
|
|
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
|
|
background: white;
|
|
left: 50%;
|
|
outline: 1px solid rgba(0,0,0,0.2);
|
|
padding:30px 42px;
|
|
position: fixed;
|
|
right: auto;
|
|
width: 512px;
|
|
height: auto;
|
|
overflow: hidden;
|
|
z-index: 100;
|
|
top: 72px;
|
|
margin-left: -256px;
|
|
|
|
/*display: none;*/
|
|
opacity: 0.0;
|
|
-webkit-transform: scale(1.05);
|
|
-webkit-transition: all 0.218s;
|
|
}
|
|
|
|
#dialog[opening] {
|
|
opacity: 1.0;
|
|
-webkit-transform: scale(1.0);
|
|
}
|
|
|
|
#dialog[closing] {
|
|
opacity: 0;
|
|
-webkit-transform: translateY(-100%);
|
|
-webkit-transition: all 1s;
|
|
}
|
|
|
|
@-webkit-keyframes shakeFadeIn {
|
|
0% {
|
|
display: block;
|
|
opacity: 0;
|
|
-webkit-transform: translateX(0);
|
|
}
|
|
10% {
|
|
display: block;
|
|
-webkit-transform: translateX(-50px);
|
|
}
|
|
30% {
|
|
display: block;
|
|
-webkit-transform: translateX(50px);
|
|
}
|
|
50% {
|
|
display: block;
|
|
-webkit-transform: translateX(-25px);
|
|
}
|
|
70% {
|
|
display: block;
|
|
-webkit-transform: translateX(25px);
|
|
}
|
|
90% {
|
|
display: block;
|
|
-webkit-transform: translateX(-13px);
|
|
}
|
|
100% {
|
|
display: block;
|
|
-webkit-transform: translateX(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
@-webkit-keyframes shakeFadeOut {
|
|
0% {
|
|
opacity: 1;
|
|
-webkit-transform: translateX(0);
|
|
}
|
|
10% {
|
|
-webkit-transform: translateX(-50px);
|
|
}
|
|
30% {
|
|
-webkit-transform: translateX(50px);
|
|
}
|
|
100% {
|
|
-webkit-transform: translateX(-100%);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
#dialog2[opening] {
|
|
-webkit-animation-duration: 0.5s;
|
|
-webkit-animation-fill-mode: both;
|
|
-webkit-animation-name: shakeFadeIn;
|
|
}
|
|
|
|
#dialog2[closing] {
|
|
-webkit-animation-duration: 0.3s;
|
|
-webkit-animation-fill-mode: both;
|
|
-webkit-animation-name: shakeFadeOut;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<button onclick="toggleDialog('#dialog')">Toggle Dialog</button>
|
|
<g-overlay id="dialog" class="dialog">
|
|
<h2>Dialog</h2>
|
|
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fringilla sapien sed enim sollicitudin laoreet. Suspendisse suscipit, metus ac volutpat sodales, libero magna semper lacus, molestie fringilla massa orci ut arcu. Nullam sodales urna sit amet odio vehicula mattis.</div><br><br>
|
|
<div>Ut aliquam vulputate congue. Vestibulum pretium pretium nulla quis sollicitudin. Praesent lacinia congue erat nec mattis. Fusce commodo lacus est. Duis turpis eros, ultrices sed aliquet non, blandit egestas velit. Integer a augue nec lorem tristique hendrerit. Curabitur imperdiet risus id enim bibendum vestibulum. Integer id magna at arcu faucibus fermentum vel a augue. Sed fringilla venenatis dolor, in blandit magna molestie luctus. Vestibulum dignissim posuere ultrices. Aenean urna nisl, tincidunt vitae iaculis ut, pharetra nec eros.</div><br><br>
|
|
<div>
|
|
<g-checkbox></g-checkbox>
|
|
I agree with this wholeheartedly.
|
|
</div><br><br>
|
|
<button onclick="toggleDialog('#dialog')">OK</button>
|
|
</g-overlay>
|
|
<br><br>
|
|
<button onclick="toggleDialog('#dialog2')">Toggle Dialog 2</button>
|
|
<g-overlay id="dialog2" class="dialog" showing="true">
|
|
<h2>Dialog 2</h2>
|
|
I'm dizzy.
|
|
</div><br><br>
|
|
<button onclick="toggleDialog('#dialog2')">OK</button>
|
|
</g-overlay>
|
|
<script>
|
|
toggleDialog = function(inSlctr) {
|
|
var d = document.querySelector(inSlctr);
|
|
d.showing = !d.showing;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|