mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-26 18:02:18 +00:00
Remove animation on prefers-reduced-motion/low referesh rate devices
Also normalises handling of asset list cable table & improves its use of space on large devices
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -2,6 +2,16 @@
|
||||
@import "custom-variables";
|
||||
@import "node_modules/bootstrap/scss/bootstrap";
|
||||
|
||||
@media screen and
|
||||
(prefers-reduced-motion: reduce),
|
||||
(update: slow) {
|
||||
* {
|
||||
animation-duration: 0.001ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.001ms !important;
|
||||
}
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 40px 15px;
|
||||
}
|
||||
|
||||
@@ -29,17 +29,19 @@
|
||||
{% include 'partials/datetime-fix.html' %}
|
||||
|
||||
<script>
|
||||
const matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches || window.matchMedia("(update: slow)").matches;
|
||||
$(document).ready(function () {
|
||||
dur = matches ? 0 : 500;
|
||||
{% if not object.pk %}
|
||||
$('.form-hide').slideUp();
|
||||
$('.form-hide').slideUp(dur);
|
||||
{% else %}
|
||||
$('#size-selector button[data-event-size={{object.event_size}}]').addClass('active');
|
||||
for(i = 0; i < 3; i++) {
|
||||
if(i == {{object.event_size}}) {
|
||||
$('#size-{{object.event_size}}').slideDown();
|
||||
$('#size-{{object.event_size}}').slideDown(dur);
|
||||
}
|
||||
else {
|
||||
$('#size-' + i).slideUp();
|
||||
$('#size-' + i).slideUp(dur);
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
@@ -47,13 +49,13 @@
|
||||
$('#{{form.event_size.auto_id}}').val($(this).data('event-size'))
|
||||
$(this).toggleClass('active');
|
||||
$('#size-selector button').not(this).removeClass('active');
|
||||
$('#size-' + $(this).data('event-size')).slideDown();
|
||||
$('#size-' + $(this).data('event-size')).slideDown(dur);
|
||||
for(i = 0; i < 3; i++) {
|
||||
if(i == $(this).data('event-size')) {
|
||||
$('#size-' + $(this).data('event-size')).slideDown();
|
||||
$('#size-' + $(this).data('event-size')).slideDown(dur);
|
||||
}
|
||||
else {
|
||||
$('#size-' + i).slideUp();
|
||||
$('#size-' + i).slideUp(dur);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,10 +45,12 @@
|
||||
}
|
||||
$('#'+id_end_time).val('02:00');
|
||||
}
|
||||
const matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches || window.matchMedia("(update: slow)").matches;
|
||||
$(document).ready(function () {
|
||||
dur = matches ? 0 : 500;
|
||||
{% if not object.pk and not form.errors %}
|
||||
$('.form-hws').slideUp(function () {
|
||||
$('.form-is_rig').slideUp();
|
||||
$('.form-hws').slideUp(dur, function () {
|
||||
$('.form-is_rig').slideUp(dur);
|
||||
});
|
||||
{% elif not object.pk and form.errors %}
|
||||
if ($('#{{form.is_rig.auto_id}}').attr('checked') != 'checked') {
|
||||
@@ -57,19 +59,19 @@
|
||||
{% endif %}
|
||||
{% if not object.pk %}
|
||||
$('#is_rig-selector button').on('click', function () {
|
||||
$('.form-hws').removeAttr('style');
|
||||
$('.form-non_rig').slideDown();
|
||||
$('.form-non_rig').slideDown(dur);
|
||||
if ($(this).data('is_rig') == 1) {
|
||||
$('#{{form.is_rig.auto_id}}').prop('checked', true);
|
||||
if ($('.form-non_rig').is(':hidden')) {
|
||||
$('.form-is_rig').show();
|
||||
} else {
|
||||
$('.form-is_rig').slideDown();
|
||||
$('.form-is_rig').slideDown(dur);
|
||||
}
|
||||
$('.form-hws, .form-hws .form-is_rig').css('overflow', 'visible');
|
||||
} else {
|
||||
|
||||
$('#{{form.is_rig.auto_id}}').prop('checked', false);
|
||||
$('.form-is_rig').slideUp();
|
||||
$('.form-is_rig').slideUp(dur);
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user