diff options
author | Baron Schwartz <xaprb@users.noreply.github.com> | 2019-02-10 05:31:11 +0300 |
---|---|---|
committer | Baron Schwartz <xaprb@users.noreply.github.com> | 2019-02-10 05:31:11 +0300 |
commit | beb21a230278dc9649a2183242a8ced819243a31 (patch) | |
tree | 2f99268805e4bdcf949ea0f8f0297057d7a1ab8b /static | |
parent | 6b3a62794b6f9732b6d7a91ff5b71f6927d29ec3 (diff) |
add feature-tweetquote flag and twitter-like blockquote styling
Diffstat (limited to 'static')
-rw-r--r-- | static/css/story.css | 8 | ||||
-rw-r--r-- | static/css/story.less | 9 | ||||
-rw-r--r-- | static/js/story.js | 12 |
3 files changed, 29 insertions, 0 deletions
diff --git a/static/css/story.css b/static/css/story.css index f56fe9d..ca486e4 100644 --- a/static/css/story.css +++ b/static/css/story.css @@ -217,6 +217,14 @@ body.feature-fignum table caption::before { border-radius: 100%; margin: 0 1rem 1rem 0; } +blockquote.tweet { + border: 1px solid #e1e8ed; + border-radius: 5px; + padding: 4px 20px; +} +blockquote.tweet p:last-child { + text-align: right !important; +} .pagination li { display: inline-block; } diff --git a/static/css/story.less b/static/css/story.less index 1336d9a..6f0febc 100644 --- a/static/css/story.less +++ b/static/css/story.less @@ -248,6 +248,15 @@ body { margin: 0 1rem 1rem 0; } +blockquote.tweet { + border: 1px solid #e1e8ed; + border-radius: 5px; + padding: 4px 20px; + p:last-child { + text-align: right !important; + } +} + .pagination li { display: inline-block; a { diff --git a/static/js/story.js b/static/js/story.js index 5f5432b..ff247f5 100644 --- a/static/js/story.js +++ b/static/js/story.js @@ -38,6 +38,18 @@ $( function() { } }); +// Render tweet-styled blockquotes, if <body> has the class feature-tweetquote and the blockquote ends +// with a twitter permalink URL. +$( function() { + if ( $( "body.feature-tweetquote:not(.feature-notweetquote)" ).length ) { + $("blockquote p:last-child a[href*='twitter.com']").each(function(i, e){ + $(this.parentElement.parentElement).addClass("tweet sans-serif mw6"); + $(this).addClass("no-underline link dim"); + $(this).append(' <i class="fab fa-twitter fa-lg">'); + }); + } +}); + // Render perspective book images, if <body> has the class // feature-3dbook-covers $( function() { |