Browse Source

Hackily fade inserted images in

pull/126/head
Lal'C Mellk Mal 2 years ago
parent
commit
d36f91fcb7
3 changed files with 17 additions and 2 deletions
  1. +7
    -1
      client/client.js
  2. +1
    -1
      hot.js.example
  3. +9
    -0
      www/css/base.css

+ 7
- 1
client/client.js View File

@@ -433,11 +433,17 @@ dispatcher[SPOILER_IMAGES] = function (msg, op) {
};

function insert_image(info, header, toppu) {
var fig = $(flatten(oneeSama.gazou(info, toppu)).join(''));
var html = flatten(oneeSama.gazou(info, toppu)).join('');
// HACK ought to add `class="new"` in common?
html = html.replace(/<img src/, '<img class="new" src');
var fig = $(html);
if (toppu)
header.before(fig);
else
header.after(fig);

// fade in
setTimeout(function () { fig.find('img').removeClass('new'); }, 10);
}

function set_highlighted_post(num) {


+ 1
- 1
hot.js.example View File

@@ -19,7 +19,7 @@ this.hot = {
},

/* Bump this version whenever you change base.css */
BASE_CSS_VERSION: 48,
BASE_CSS_VERSION: 49,
/* Bump this version whenever you modify any existing theme CSS */
THEME_CSS_VERSION: 11,



+ 9
- 0
www/css/base.css View File

@@ -73,6 +73,15 @@ figure img {
float: left;
margin: 3px 20px 20px 0;
vertical-align: top;

opacity: 1;
transition: opacity 1s, transform 1s;
-webkit-transition: opacity 1s, -webkit-transform 1s;
}
figure img.new {
opacity: 0;
transform: scale(0.8);
-webkit-transform: scale(0.8);
}
h1, h2 {
text-align: center;


Loading…
Cancel
Save