- Your Name Here
+
+ Russell Buck
diff --git a/animations.js b/animations.js new file mode 100644 index 00000000..bf019be4 --- /dev/null +++ b/animations.js @@ -0,0 +1,93 @@ +$(document).ready(function(){ +$('#tweet-controls').hide(); + +$('.tweet-compose').on('click', function(){ + $('#tweet-controls').show(); + $(this).height(40); +}); + + + +$(".tweet-compose").on("keydown", function() { var count = 140-$(this).val().length; + $('#char-count').text(count) + if(count <= 10){ + $('#char-count').css("color" , "red"); + } + if(count > 10){ + $("#char-count").css("color", "#999"); + } + if(count < 0){ + $("#tweet-submit").attr('disabled', "disabled"); + } + if(count >= 0 ){ + $("#tweet-submit").removeAttr("disabled"); + } + }); + + + $("#tweet-submit").on("click", function() { + + + var tweetText = $("textarea.tweet-compose").val(); + $("textarea.tweet-compose").val(""); + var date = new Date(); + var newTweet = $(".tweet:first-of-type").clone(); + + + + newTweet.find("p.tweet-text").text(tweetText); + newTweet.find("img.avatar").attr("src", "https://orig15.deviantart.net/5470/f/2010/105/4/5/random_person_by_vurtov.jpg"); + newTweet.find(".username").text("@russellwright"); + newTweet.find(".fullname").text("Buckks"); + newTweet.find(".time").text(date); + newTweet.find(".num-retweets, .num-favorites").text("0"); + newTweet.fadeIn(); + + + + $("#stream").prepend(newTweet); + $("#char-count").text("140"); + $("#char-count").css("color", "#999"); + +}); + + + + + +$('#stream').on('mouseenter','.tweet', function(){ + +$(this).find('.tweet-actions').css('display','block'); + +}); + + + + +// Tweet Actions, hide on mouseleave +$('#stream').on('mouseleave','.tweet', function(){ + +$(this).find('.tweet-actions').css('display','none'); + +}); + + + + + + + +$('#stream').on('click','.tweet', function(){ + + $(this).find('.stats').fadeIn(); + +}); + + + + + + + + +}); \ No newline at end of file diff --git a/css/styles.css b/css/styles.css index 5697e4bf..d845b1be 100644 --- a/css/styles.css +++ b/css/styles.css @@ -48,6 +48,7 @@ body { border: 1px solid #019ad2; cursor: pointer; border-radius: 4px; + } .button:disabled { color: #777; @@ -126,9 +127,11 @@ body { border-radius: 3px; margin-bottom: 1em; box-sizing: border-box; + } #tweet-controls { text-align: right; + } #tweet-controls div { display: inline-block; @@ -137,6 +140,7 @@ body { font-size: 14px; color: #999; text-shadow: 0 1px 1px rgba(255,255,255,.75); + } /* TWEET */ diff --git a/index.html b/index.html index bb4a2698..66f843a3 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,8 @@
- Your Name Here
+
+ Russell Buck