Added theme support for dynamic contrast

This commit is contained in:
Julian Prieber 2023-12-07 18:59:54 +01:00
parent 08e12fffc5
commit 5b55e8ad35
3 changed files with 42 additions and 24 deletions

View File

@ -7,4 +7,3 @@
<style>{!! file_get_contents(base_path("assets/linkstack/css/animate.css")) !!}</style>
<script>{!! file_get_contents(base_path("assets/js/dynamic-contrast.min.js")) !!}</script>
@include('linkstack.modules.dynamic-contrast')

View File

@ -1,24 +1,42 @@
@push('linkstack-body-end')
<script>
BackgroundCheck.init({
targets: '.dynamic-contrast',
images: 'body'
});
</script>
@endpush
@if($customBackgroundExists == true)
@if(($info->theme == '' || $info->theme == 'default') || theme('enable_dynamic_contrast') == 'true')
@push('linkstack-body-end')
<script>
BackgroundCheck.init({
targets: '.dynamic-contrast',
images: 'body'
});
BackgroundCheck.refresh();
BackgroundCheck.init({
targets: '.dynamic-contrast-footer',
images: 'body'
});
BackgroundCheck.refresh();
</script>
@endpush
@push('linkstack-head-end')
<style>
.background--light {
color: black !important;
}
@push('linkstack-head-end')
<style>
.background--light {
color: black !important;
}
.background--dark {
color: white !important;
}
.background--complex {
color: gray !important;
}
.background--dark {
color: white !important;
}
.background--complex {
color: gray !important;
}
</style>
@endpush
.dynamic-contrast-footer.background--light {
color: #0085FF !important;
}
.dynamic-contrast-footer.background--dark {
color: white !important;
}
.dynamic-contrast-footer.background--complex {
color: gray !important;
}
</style>
@endpush
@endif
@endif

View File

@ -105,4 +105,5 @@ if($customBackgroundExists == true){
@push('linkstack-body-end')
@if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body-end')@endif
@endpush
@endpush
@include('linkstack.modules.dynamic-contrast')