diff --git a/app/assets/javascripts/loginAlert.js b/app/assets/javascripts/loginAlert.js new file mode 100644 index 000000000..84c2ee6a8 --- /dev/null +++ b/app/assets/javascripts/loginAlert.js @@ -0,0 +1,35 @@ +(function (window) { + +// Set the target date (10 days before March 15th, 2024) + const targetDate = new Date("April 16, 2024 00:00:00").getTime(); + + // Function to update the countdown display + function updateCountdown() { + const now = new Date().getTime(); + const difference = targetDate - now; + + // Time calculations for days only + const days = Math.floor(difference / (1000 * 60 * 60 * 24)); + + // Visibility logic + if (days < 0 || days > 10) { + // Hide if more than 10 days away OR if already past the date + document.getElementById("countdown-container").style.display = "none"; + } else { + // Show if 10 days or less remaining + document.getElementById("countdown-container").style.display = "block"; + document.getElementById("countdown").innerHTML = days + " days "; + } + + } + + // Expose the updateCountdown function to the outside world + window.updateCountdown = updateCountdown; + + // Initial display update + updateCountdown(); + + // Update the countdown every second (inside the IIFE) + setInterval(updateCountdown, 1000); + +})(window); diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index 55f17a795..4a032a946 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -568,3 +568,9 @@ details form { .edit-textbox-error-mt { margin-top: 1.5rem; } + +// Login page + +#countdown-container { + display: none; // Hide the countdown timer +} diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index a19376d7c..6b4952b0c 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -12,9 +12,20 @@ {% block maincolumn_content %} +{% if login_gov_enabled %}
+ You have left to use Login.gov to sign in +
+You can access your account by signing in with one of the options below:
+ Sign in with Login.gov +Or:
{% endif %} {% endif %} @@ -41,6 +52,24 @@ {{ page_footer("Continue", secondary_link=password_reset_url, secondary_link_text="Forgot your password?") }} {% endcall %}Why are we doing this?
+What do I need to do?
++ You have left to use Login.gov to sign in +
+