1
0
Fork 0

Began adding 'try easejs' block

website
Mike Gerwitz 2011-03-24 22:22:31 -04:00
parent 8eba44ea3e
commit 8820dc24b3
2 changed files with 101 additions and 29 deletions

View File

@ -19,6 +19,9 @@
$( '<div>' ) $( '<div>' )
.attr( 'id', 'try' ) .attr( 'id', 'try' )
.text( 'Try It!' ) .text( 'Try It!' )
.addClass( 'btn' )
.addClass( 'large' )
.addClass( 'glow' )
.mousedown( function( event ) .mousedown( function( event )
{ {
// prevent dragging from highlighting the text (so it looks more // prevent dragging from highlighting the text (so it looks more
@ -43,11 +46,32 @@
function getTry() function getTry()
{ {
var $txt;
return $trybox || ( function createTryBox() return $trybox || ( function createTryBox()
{ {
return $trybox = $( '<div>' ) return $trybox = $( '<div>' )
.attr( 'id', 'trybox' ) .attr( 'id', 'trybox' )
.hide() .hide()
.append( $( '<h2>' ).text( 'Try ease.js' ) )
.append( $txt = $( '<textarea>' ).text (
"Test"
) )
.append( $( '<div>' )
.attr( 'id', 'trybtns' )
.append( $( '<div>' )
.attr( 'id', 'run' )
.text( 'Run' )
.addClass( 'btn' )
.addClass( 'med' )
.addClass( 'green' )
.click( function()
{
var Class = easejs.Class;
eval( $txt.val() );
} )
)
)
.prependTo( '#content' ); .prependTo( '#content' );
} )(); } )();
} }

106
style.css
View File

@ -102,32 +102,24 @@ p.copyright a, p.copyright a:link {
0% { 0% {
-webkit-box-shadow: 0 0 0px #ffffff; -webkit-box-shadow: 0 0 0px #ffffff;
} }
70% {
-webkit-box-shadow: 0 0 0px #ffffff;
}
100% { 100% {
-webkit-box-shadow: 0 0 5px #ffffff; -webkit-box-shadow: 0 0 5px #ffffff;
} }
} }
#try { .btn {
position: relative; display: inline-block;
width: 100px;
margin: 0px auto;
top: -2em;
background-color: #f57900; background-color: #f57900;
color: white; color: white;
font-size: 2em; font-weight: bold;
font-weight: bold; cursor: pointer;
text-shadow: black 2px 2px 5px; text-align: center;
cursor: pointer;
text-align: center;
padding: 0.25em 0.5em; padding: 0.25em 0.5em;
border: 1px solid #ce5c00; border: 1px solid #ce5c00;
border-radius: 0.25em; border-radius: 0.25em;
-moz-border-radius: 0.25em; -moz-border-radius: 0.25em;
background-image: -webkit-gradient( background-image: -webkit-gradient(
@ -142,31 +134,74 @@ p.copyright a, p.copyright a:link {
rgb(245,123,0) 0%, rgb(245,123,0) 0%,
rgb(206,93,0) 100% rgb(206,93,0) 100%
); );
}
.btn.green {
border: 1px solid #4e9a06;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(116,210,22)),
color-stop(1, rgb(139,226,52))
);
background-image: -moz-linear-gradient(
center bottom,
rgb(116,210,22) 0%,
rgb(139,226,52) 100%
);
}
.btn.med {
width: 75px;
font-size: 1.5em;
text-shadow: black 2px 2px 4px;
}
.btn.large {
width: 100px;
font-size: 2em;
text-shadow: black 2px 2px 5px;
}
.glow {
-webkit-box-shadow: 0 0 5px #ffffff; -webkit-box-shadow: 0 0 5px #ffffff;
-moz-box-shadow: 0 0 5px #ffffff; -moz-box-shadow: 0 0 5px #ffffff;
box-shadow:0 0 5px #ffffff; box-shadow: 0 0 5px #ffffff;
-webkit-transition: -webkit-box-shadow 0.25s linear; -webkit-transition: -webkit-box-shadow 0.25s linear;
-moz-transition-property: -moz-box-shadow; -moz-transition-property: -moz-box-shadow;
-moz-transition-duration: 0.25s; -moz-transition-duration: 0.25s;
-webkit-animation-name: pulse; -webkit-animation-name: pulse;
-webkit-animation-duration: 2s; -webkit-animation-duration: 1s;
-webkit-animation-direction: alternate; -webkit-animation-direction: alternate;
-webkit-animation-timing-function: ease-in-out; -webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: 1; -webkit-animation-iteration-count: 1;
} }
#try:hover { .glow:hover {
-webkit-box-shadow:0 0 10px #ffffff; -webkit-box-shadow: 0 0 10px #ffffff;
-moz-box-shadow: 0 0 10px #ffffff; -moz-box-shadow: 0 0 10px #ffffff;
box-shadow:0 0 10px #ffffff; box-shadow: 0 0 10px #ffffff;
}
#try {
display: block;
position: relative;
margin: 0px auto;
top: -2em;
} }
#trybox { #trybox {
border: 1px solid #eeeeec; position: relative;
border-radius: 0.5em;
border: 1px solid #eeeeec;
border-radius: 0.5em;
-moz-border-radius: 0.5em; -moz-border-radius: 0.5em;
background-image: -webkit-gradient( background-image: -webkit-gradient(
@ -182,6 +217,19 @@ p.copyright a, p.copyright a:link {
rgb(238,238,236) 100% rgb(238,238,236) 100%
); );
height: 350px; padding: 1em;
}
#trybox h2 {
margin: 0px 0px 1em 0px;
}
#trybox textarea {
width: 100%;
height: 20em;
}
#trybox #trybtns {
text-align: right;
} }