added fancy »

hash-command-arbitrary
Avril 4 years ago
parent fad14d0a30
commit 21a8fc583d
Signed by untrusted user: flanchan
GPG Key ID: 284488987C31F630

@ -40,6 +40,7 @@ DEFINES.WORD_LENGTH_LIMIT = 120;
DEFINES.S_BOL = 1;
DEFINES.S_QUOTE = 2;
DEFINES.S_BIG = 4;
DEFINES.S_FQUOTE = 8;
function initial_state() {
// state[0] = output mode
@ -308,7 +309,12 @@ OS.iku = function (token, to) {
state[0] |= DEFINES.S_BIG;
}
if (to & DEFINES.S_QUOTE && !(state[0] & DEFINES.S_QUOTE)) {
if (to & DEFINES.S_FQUOTE) {
this.callback(safe('<em class="fancy">'));
state[0] |= DEFINES.S_FQUOTE;
} else {
this.callback(safe('<em>'));
}
state[0] |= DEFINES.S_QUOTE;
}
@ -340,7 +346,7 @@ OS.fragment = function (frag) {
if (i % 2) {
var to = 'SPOIL';
if (chunk[1] == '/' && state[1] < 1)
to = state[0] & DEFINES.S_QUOTE;
to = state[0] & (DEFINES.S_QUOTE | DEFINES.S_FQUOTE);
this.iku(chunk, to);
continue;
}
@ -354,12 +360,16 @@ OS.fragment = function (frag) {
var to = DEFINES.S_BIG;
if (/[>]/.test(line[2]))
to |= DEFINES.S_QUOTE;
else if (/»/.test(line[2]))
to |= DEFINES.S_QUOTE | DEFINES.S_FQUOTE;
this.iku(line.slice(2), to);
}
else if (is_bol && /^[>]/.test(line))
this.iku(line, DEFINES.S_QUOTE);
else if (is_bol && /^»/.test(line))
this.iku(line, DEFINES.S_QUOTE | DEFINES.S_FQUOTE);
else if (line)
this.iku(line, state[0] & (DEFINES.S_QUOTE | DEFINES.S_BIG));
this.iku(line, state[0] & (DEFINES.S_QUOTE | DEFINES.S_BIG | DEFINES.S_FQUOTE));
}
}
};
@ -368,6 +378,8 @@ OS.close_out = function () {
if (this.state[0] & DEFINES.S_QUOTE) {
this.callback(safe('</em>'));
this.state[0] -= DEFINES.S_QUOTE;
if(this.state[0] & DEFINES.S_FQUOTE)
this.state[0] -= DEFINES.S_FQUOTE;
}
if (this.state[0] & DEFINES.S_BIG) {

@ -19,9 +19,9 @@ this.hot = {
},
/* Bump this version whenever you change base.css */
BASE_CSS_VERSION: 49,
BASE_CSS_VERSION: 50,
/* Bump this version whenever you modify any existing theme CSS */
THEME_CSS_VERSION: 11,
THEME_CSS_VERSION: 18,
INTER_BOARD_NAVIGATION: true,

@ -448,3 +448,39 @@ blockquote.twitter-tweet > a {
font-size: 14px;
text-decoration: none;
}
em.fancy {
background-image: repeating-linear-gradient(to left, violet, indigo, blue, green, yellow, orange,red);
background-clip: text;
background-size: 200px;
-webkit-background-clip: text;
color: transparent;
animation: rainbow 4s steps(36) infinite !important;
-webkit-animation: rainbow 4s steps(36) infinite !important;
}
@-webkit-keyframes rainbow {
from {
backgroud-position-x: 0;
-webkit-filter: hue-rotate(10deg);
-webkit-filter:hue-rotate(10deg);
}
to {
background-position-x: 100;
-webkit-filter: hue-rotate(360deg);
-webkit-filter:hue-rotate(360deg);
}
}
@keyframes rainbow {
from {
backgroud-position-x: 0;
-webkit-filter: hue-rotate(10deg);
filter:hue-rotate(10deg);
}
to {
background-position-x: 100;
-webkit-filter: hue-rotate(360deg);
filter:hue-rotate(360deg);
}
}

Loading…
Cancel
Save