Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve visuals of 'check-in-notice' #35

Merged
merged 2 commits into from
Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion static/css/chiscore.css
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,23 @@ select.select2.sign-up-input {
margin-right: .75%;
}

#check-in-reminder-container { height: 1.5em; }

#check-in-reminder {
margin-left: 0.25em;
color: #d22027;
display: none;
background-color: #d22027;
}

#check-in-reminder.visible {
background-color: white;
transition: background-color 0.25s;
opacity: 1;
}

#check-in-reminder.hidden {
opacity: 0;
transition: opacity 0.25s linear;
}

input[type="tel"],
Expand Down
17 changes: 13 additions & 4 deletions templates/checkpoint.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<form id="checkin" type="post">
<h2>Check-In at <%= checkpoint.name %></h2>

<div id="check-in-reminder">
<strong>Important:&nbsp;</strong>Click "Check In" to complete the check in for this team.
<div id="check-in-reminder-container">
<div id="check-in-reminder" class="hidden">
<strong>Important:&nbsp;</strong>Click "Check In" to complete the check in for this team.
</div>
</div>

<select id="team_checkin" name="team-number" placeholder="Enter a team name or number" class='select2 sign-up-input'>
Expand All @@ -28,7 +30,14 @@
var form = $('form#checkin');

input.select2({ placeholder: "Select a team", allowClear: true });
input.on('select2:select', function() { reminder.show() });
form.on('submit', function() { reminder.hide() });
input.on('select2:select', function() {
reminder.removeClass('hidden').addClass('visible')
});

form.on('submit', function() {
reminder.fadeOut(250, function() {
reminder.show().removeClass('visible').addClass('hidden')
});
});
});
</script>