Skip to content

Commit

Permalink
Add twitter sharing link to stripes pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cemacrr committed Aug 9, 2024
1 parent 6021e6e commit b743450
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,21 @@ body {
}
}

/** sharing links: **/

.content_plot_share {
margin-left: 1em;
}

.content_plot_share_links {
margin-left: 5em;
margin-bottom: 1em;
}

.share_logo {
width: 2em;
}

/** text: **/

.content_text_container {
Expand Down
Binary file added img/stripes/x_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions js/stripes.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ function update_location() {
og_url.name = 'og:url';
og_url.content = meta_url_val;
page_head.appendChild(og_url);
/* update sharing links: */
var twit_share = document.getElementById('twit_share');
twit_share.href = 'https://twitter.com/intent/tweet?text=' +
meta_desc_val +
'&url=' + encodeURIComponent(meta_url_val);
};

/* function to load site data: */
Expand Down
11 changes: 11 additions & 0 deletions stripes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@
class="content_plot_img flex_no_grow"
src="">
</div>
<!-- sharing links: _____________________________________________ -->
<div id="content_plot_share"
class="content_plot_share column flex_start">
<h3>Share</h3>
<div id="content_plot_share_links"
class="content_plot_share_links row_wrap flex_start">
<a id="twit_share"
href="https://twitter.com/intent/tweet?text=Air Quality Stripes&url=https%3A%2F%2Fairqualitystripes.info%2Fstripes%2F"
target="_new"><img class="share_logo" src="../img/stripes/x_logo.png"></a>
</div>
</div>
</div>
</div>
<!-- footer: ________________________________________________________ -->
Expand Down

0 comments on commit b743450

Please sign in to comment.