diff --git a/css/style.css b/css/style.css
index 2d137cf..9f1b421 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1,7 +1,7 @@
body {
/*background-image: url(../images/bg01.jpg);*/
background-color: #0576dc;
- text-shadow: 0px 1px 1px #111;
+ /*text-shadow: 0px 1px 1px #111;*/
color: #fff;
font-family: "Lucida Grande";
overflow: hidden;
@@ -14,7 +14,7 @@ a {
#container {
margin: 0 auto;
- width: 70%;
+ width: 80%;
margin-top: 6%;
position: relative;
}
@@ -28,7 +28,24 @@ article {
}
article img {
- float: left;
+ display: block;
+ width: 50%;
+ margin: 0 auto;
+ padding-bottom: 20px;
+ border: none;
+ z-index: -1;
+ -webkit-box-reflect: below 1px
+ -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.8, transparent), to(white));
+}
+
+.content {
+ text-shadow: 0px 1px 1px #111;
+ z-index: 100;
+}
+
+article .from {
+ position: absolute;
+ margin-bottom: -100px;
}
.hide {
diff --git a/index.html b/index.html
index a928ae9..052bb6b 100644
--- a/index.html
+++ b/index.html
@@ -13,9 +13,9 @@
-
-
-
+ SS
+ YYY
+ ZZZ
diff --git a/js/main.js b/js/main.js
index f46373a..728c071 100644
--- a/js/main.js
+++ b/js/main.js
@@ -28,7 +28,7 @@ function Feeds() {
this.fetch = function(feedUrl, callback) {
var _this = this;
var feed = new google.feeds.Feed(feedUrl);
- feed.setNumEntries(50);
+ feed.setNumEntries(1);
feed.includeHistoricalEntries();
feed.load(function(result) {
if (!result.error) {
@@ -73,6 +73,7 @@ function RSSVisualizer() {
this.playRSS = function() {
if (this.entries.length == 0) return;
+ if (this._lastIndex == this.entries.length) this._lastIndex = 0;
var e = this.entries[this._lastIndex++];
$(this.lastShow).addClass("hide");
var thisShow = (this.lastShow == "#a1" ? "#a2" : "#a1");
@@ -83,15 +84,21 @@ function RSSVisualizer() {
this.showSingle = function(container, entry) {
$(container).children(".from").text(entry.feed_title);
$(container).children("h2").text(entry.title);
- $(container).children(".content").html(entry);
+ $(container).children(".content").html(this.renderContent(entry));
$(container).removeClass("hide");
};
this.renderContent = function(entry) {
if (entry.feed_title == "Hacker News") {
return "";
+ }
+ var regexp_img = /
]+>/ig;
+ var matched = entry.content.match(regexp_img);
+ var img = "";
+ if (matched) {
+ img = matched[0];
}
- return entry.content.substring(0, 250) + "...";
+ return img + entry.content.replace(/<[^>]+>/img, '');
}
diff --git a/test/unittest.html b/test/unittest.html
index 627b505..8fd037d 100644
--- a/test/unittest.html
+++ b/test/unittest.html
@@ -49,6 +49,7 @@ test("should fetch feeds", function() {
});
});
+
});