Skip to content

Commit

Permalink
Added a quick and dirty 'you are now leaving a gov't site' dialogue box
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfrommann committed May 23, 2016
1 parent bb081e2 commit fb0b937
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 19 deletions.
125 changes: 125 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
colorator (0.1)
ethon (0.9.0)
ffi (>= 1.3.0)
execjs (2.6.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
gemoji (2.1.0)
github-pages (78)
github-pages-health-check (= 1.1.0)
jekyll (= 3.0.5)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.5.1)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 1.11.1)
jekyll-mentions (= 1.1.2)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.10.0)
jekyll-sass-converter (= 1.3.0)
jekyll-seo-tag (= 1.4.0)
jekyll-sitemap (= 0.10.0)
jemoji (= 0.6.2)
kramdown (= 1.10.0)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
rouge (= 1.10.1)
terminal-table (~> 1.4)
github-pages-health-check (1.1.0)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 1.4)
typhoeus (~> 0.7)
html-pipeline (2.4.1)
activesupport (>= 2, < 5)
nokogiri (>= 1.4)
i18n (0.7.0)
jekyll (3.0.5)
colorator (~> 0.1)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.5.1)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (1.11.1)
octokit (~> 4.0)
jekyll-mentions (1.1.2)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.10.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-seo-tag (1.4.0)
jekyll (~> 3.0)
jekyll-sitemap (0.10.0)
jekyll-watch (1.4.0)
listen (~> 3.0, < 3.1)
jemoji (0.6.2)
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
json (1.8.3)
kramdown (1.10.0)
liquid (3.0.6)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.0.0)
minitest (5.9.0)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
public_suffix (1.5.3)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
terminal-table (1.5.2)
thread_safe (0.3.5)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
github-pages

BUNDLED WITH
1.12.4
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ email: [email protected]
description: > # this means to ignore newlines until "baseurl:"
The United States Digital Service is transforming how the federal government
works for the American people. And we need you.
baseurl: "./" # the subpath of your site, e.g. /blog
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://www.usds.gov" # the base hostname & protocol for your site
twitter_username: usds
github_username: usds

# Build settings
markdown: kramdown
markdown: kramdown
13 changes: 13 additions & 0 deletions _includes/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script language="javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-76470670-2', 'auto');
ga('send', 'pageview');

jQuery(function() {
jQuery.scrollDepth();
});
</script>
9 changes: 9 additions & 0 deletions _includes/site_alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="site-alert-overlay"></div>
<div id="site-alert">
<a href="javascript:void(0);" class="close"><i class="fa fa-times"></i><span class="sr-only">Close this dialogue</span></a>
<h3>You are now leaving usds.gov</h3>
<h4>Yeah, the government could really use some additional UX help</h4>
<p>Click below to continue:<br />
<a href="javascript:void(0);" class="target-link" target="_blank"></a>
</p>
</div>
15 changes: 2 additions & 13 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<body class="usds-site {{ page.url | replace:'index','home' | replace: '404','notfound' | replace:'.html','' | slugify }}-page">
{% include header.html %}
{% include site_alert.html %}
<main>
{{ content }}
</main>
Expand All @@ -14,17 +15,5 @@
{% include footer.html %}

</body>
<script language="javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-76470670-2', 'auto');
ga('send', 'pageview');

jQuery(function() {
jQuery.scrollDepth();
});
</script>
{% include analytics.html %}
</html>
4 changes: 3 additions & 1 deletion _layouts/minimal.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<html>
{% include head.html %}
<body class="usds-site {{ page.url | replace:'index','home' | replace: '404','notfound' | replace:'.html','' | slugify }}-page">
{% include site_alert.html %}
<main>
{{ content }}
</main>
</body>
</html>
{% include analytics.html %}
</html>
43 changes: 40 additions & 3 deletions _sass/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ body {
}

.usds-site {

a, a:visited {
color: $link-color;
}
Expand Down Expand Up @@ -38,7 +37,7 @@ body {
position: fixed;
height: $fixed-header-height-desktop;
width: 100%;
z-index: 1000;
z-index: 1;

background-color: #ffffff;
border-bottom: 1px solid #f1f1f1;
Expand Down Expand Up @@ -220,7 +219,45 @@ body {
display: none;
}
}
} // </footer>
} // </header>

#site-alert-overlay, #site-alert {
position: fixed;
background-color: #ffffff;
display: none;
}
#site-alert-overlay {
top: 0; left: 0;
height: 100%;
width: 100%;
@include opacity(0.9);
z-index: 1;
}
#site-alert {
top: 50%;
left: 50%;
padding: 10px;
width: 600px;
height: 300px;
@include css3-prefix('transform', 'translate(-300px, -150px)');
@include css3-prefix('box-shadow', '0 6px 12px 0px rgba(0, 0, 0, 0.2)');
//border: 1px solid #efefef;
border-top: 7px solid $background-color-secondary;
z-index: 10;
.fa {
float: right;
}
}
@media (max-width: $screen-xs-max) {
#site-alert {
top: 5%;
left: 5%;
padding: 10px;
width: 90%;
height: 90%;
@include css3-prefix('transform', 'translate(0, 0)');
}
}

main {
margin-top: $fixed-header-height-desktop;
Expand Down
18 changes: 18 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ $( document ).ready(function() {
$( ".join-page .faqs li" ).has( "a[href$='#" + hash + "']" ).addClass('active');
});

$( 'a[href^="http"]:not(.target-link)' ).on( "click", function() {
var domain = this.href.split('/')[2];
var tld = domain.substring(domain.length - 3);
if (tld != 'gov' && tld != 'mil') {
$( '#site-alert-overlay' ).show();
$( '#site-alert' ).show();
var targetLink = $( '#site-alert .target-link')
targetLink.text(this.href);
targetLink.attr("href", this.href);
return false;
}
});
$( '#site-alert .close, #site-alert .target-link' ).on( "click", function() {
$( '#site-alert-overlay' ).hide();
$( '#site-alert' ).hide();
});


$('#everything-is-awesome').on( "click", function() {
// Yes, there were more important things to get done, but everyone needs a mental break sometimes
if (awesomeCounter >= 10) {
Expand Down

0 comments on commit fb0b937

Please sign in to comment.