<style>
div[data-record-type="418"]{display:none}
.table_form .t-radio__wrapper {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.table_form .t-img-select__control {width: calc(20% - 10px)}
.table_form .t-radio__control:first-child { margin-top: 0}
.table_form label.t-radio__control {flex-basis: 33.3%}
.main_image:after {
content: "Такой позиции нет";
position: absolute;
text-align: center;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 26px;
font-family: 'Montserrat',Arial,sans-serif;
font-weight: 400;
opacity:0;
}
.table_form input[name="type_table_text"] {display: none}
.productout .tn-atom {filter: opacity(0.1)}
.productout:after {opacity:1}
@media screen and (max-width:480px){
.table_form .t-img-select__control {width: calc(25% - 10px)}
.table_form label.t-radio__control {flex-basis: 50%}
}
</style>
<script>
$( document ).ready(function() {
let glID = $('#rec260381068, #rec260584014');
let material = 'input[name="material"]';
let colorTabletop = 'input[name="color_tabletop"]';
let colorFrame = 'input[name="color_frame"]';
let imgObj = {};
glID.find('li').each(function(index) {
let urlImg = $(this).find('div').attr('data-original');
let imgCode = $(this).find('meta:last').attr('content');
if (urlImg && imgCode){imgObj[imgCode]=urlImg};
});
function changePhoto(){
let mPlace = String($(material).index($(material+':checked')));
let ctPlace = String($(colorTabletop).index($(colorTabletop+':checked')));
let cfPlace = String($(colorFrame).index($(colorFrame+':checked')));
let joinCode = mPlace+ctPlace+cfPlace;
if(imgObj[joinCode]){
$('.table_form .tn-form__submit').show();
$('.main_image').removeClass('productout');
$('.main_image img').attr({"src":imgObj[joinCode], "data-original":imgObj[joinCode]});
}else{
$('.table_form .tn-form__submit').hide();
$('.main_image').addClass('productout');
};
};
$('.table_form').on('change', 'input[type="radio"]', function() {
changePhoto();
let typeable = $('input[name="type_table"]:checked').val();
if( typeable == 'Свой ответ' ){
$('input[name="type_table_text"]').addClass('js-tilda-rule').slideDown(300);
}else{
$('input[name="type_table_text"]').val('').removeClass('js-tilda-rule').slideUp(300);
};
});
$( window ).resize(function() {setTimeout(function(){changePhoto()},1500)});
$(document).on("keydown", ".t-form", function(event) {return event.key != "Enter"});
});
</script>