Skip to content

Commit 5b55e8a

Browse files
committed
Added theme support for dynamic contrast
1 parent 08e12ff commit 5b55e8a

File tree

3 files changed

+42
-24
lines changed

3 files changed

+42
-24
lines changed

resources/views/linkstack/modules/assets.blade.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
<style>{!! file_get_contents(base_path("assets/linkstack/css/animate.css")) !!}</style>
88

99
<script>{!! file_get_contents(base_path("assets/js/dynamic-contrast.min.js")) !!}</script>
10-
@include('linkstack.modules.dynamic-contrast')
Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
1-
@push('linkstack-body-end')
2-
<script>
3-
BackgroundCheck.init({
4-
targets: '.dynamic-contrast',
5-
images: 'body'
6-
});
7-
</script>
8-
@endpush
1+
@if($customBackgroundExists == true)
2+
@if(($info->theme == '' || $info->theme == 'default') || theme('enable_dynamic_contrast') == 'true')
3+
@push('linkstack-body-end')
4+
<script>
5+
BackgroundCheck.init({
6+
targets: '.dynamic-contrast',
7+
images: 'body'
8+
});
9+
BackgroundCheck.refresh();
10+
BackgroundCheck.init({
11+
targets: '.dynamic-contrast-footer',
12+
images: 'body'
13+
});
14+
BackgroundCheck.refresh();
15+
</script>
16+
@endpush
917

10-
@push('linkstack-head-end')
11-
<style>
12-
.background--light {
13-
color: black !important;
14-
}
18+
@push('linkstack-head-end')
19+
<style>
20+
.background--light {
21+
color: black !important;
22+
}
23+
.background--dark {
24+
color: white !important;
25+
}
26+
.background--complex {
27+
color: gray !important;
28+
}
1529
16-
.background--dark {
17-
color: white !important;
18-
}
19-
20-
.background--complex {
21-
color: gray !important;
22-
}
23-
</style>
24-
@endpush
30+
.dynamic-contrast-footer.background--light {
31+
color: #0085FF !important;
32+
}
33+
.dynamic-contrast-footer.background--dark {
34+
color: white !important;
35+
}
36+
.dynamic-contrast-footer.background--complex {
37+
color: gray !important;
38+
}
39+
</style>
40+
@endpush
41+
@endif
42+
@endif

resources/views/linkstack/modules/theme.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ function themeAsset($path){
105105

106106
@push('linkstack-body-end')
107107
@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
108-
@endpush
108+
@endpush
109+
@include('linkstack.modules.dynamic-contrast')

0 commit comments

Comments
 (0)