| ... | ... |
@@ -138,18 +138,123 @@ html {
|
| 138 | 138 |
} |
| 139 | 139 |
} |
| 140 | 140 |
|
| 141 |
+#player-audio-controls {
|
|
| 142 |
+ position: absolute; |
|
| 143 |
+ right: 40px; |
|
| 144 |
+ bottom: 120px; |
|
| 145 |
+ height: 32px; |
|
| 146 |
+ width: 39px; |
|
| 147 |
+ |
|
| 148 |
+ a {
|
|
| 149 |
+ opacity: 0; |
|
| 150 |
+ visibility: hidden; |
|
| 151 |
+ @include transition(opacity 0.25s ease-in-out); |
|
| 152 |
+ |
|
| 153 |
+ &:before {
|
|
| 154 |
+ display: block; |
|
| 155 |
+ visibility: hidden; |
|
| 156 |
+ opacity: 0; |
|
| 157 |
+ font-family: $font-family-alternate; |
|
| 158 |
+ font-size: font-size(10px); |
|
| 159 |
+ white-space: nowrap; |
|
| 160 |
+ position: absolute; |
|
| 161 |
+ right: 100%; |
|
| 162 |
+ margin-right: 20px; |
|
| 163 |
+ top: 50%; |
|
| 164 |
+ @include transform(translate3d(0,-50%,0)); |
|
| 165 |
+ content: attr(data-label); |
|
| 166 |
+ background-color: rgba($color-bg-tertiary, 0.8); |
|
| 167 |
+ color: $color-bg-primary; |
|
| 168 |
+ padding: 2px 5px 0; |
|
| 169 |
+ line-height: 2; |
|
| 170 |
+ text-transform: uppercase; |
|
| 171 |
+ @include transition(all 0.25s ease-in-out); |
|
| 172 |
+ |
|
| 173 |
+ } |
|
| 174 |
+ |
|
| 175 |
+ &.-show {
|
|
| 176 |
+ opacity: .8; |
|
| 177 |
+ visibility: visible; |
|
| 178 |
+ } |
|
| 179 |
+ |
|
| 180 |
+ &:hover {
|
|
| 181 |
+ opacity: 1; |
|
| 182 |
+ |
|
| 183 |
+ &:before {
|
|
| 184 |
+ opacity: 1; |
|
| 185 |
+ visibility: visible; |
|
| 186 |
+ } |
|
| 187 |
+ } |
|
| 188 |
+ } |
|
| 189 |
+ |
|
| 190 |
+ svg {
|
|
| 191 |
+ height: 32px; |
|
| 192 |
+ width: auto; |
|
| 193 |
+ position: absolute; |
|
| 194 |
+ fill: $color-bg-tertiary; |
|
| 195 |
+ } |
|
| 196 |
+} |
|
| 197 |
+ |
|
| 141 | 198 |
#scroll-down-indicator {
|
| 142 | 199 |
z-index: 10; |
| 143 | 200 |
position: fixed; |
| 144 | 201 |
right: 40px; |
| 145 | 202 |
bottom: 40px; |
| 146 |
- -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 123 62' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cpath d='M57.548,60.943c2.509,1.409 5.581,1.409 8.09,0l54.92,-36.13c2.31,-1.41 3.18,-5.08 1.74,-7.05l-7,-15c-1.39,-2.22 -5.14,-2.78 -7.46,-1.37l-46.24,30.23l-45.67,-29.95c-2.6,-1.69 -6.36,-0.84 -7.52,0.85l-7.22,15.24c-1.45,2.25 -0.29,5.64 1.73,7.05l54.63,36.13Z' style='fill:%23000000;fill-rule:nonzero;'/%3E%3C/svg%3E");
|
|
| 147 |
- mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 123 62' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cpath d='M57.548,60.943c2.509,1.409 5.581,1.409 8.09,0l54.92,-36.13c2.31,-1.41 3.18,-5.08 1.74,-7.05l-7,-15c-1.39,-2.22 -5.14,-2.78 -7.46,-1.37l-46.24,30.23l-45.67,-29.95c-2.6,-1.69 -6.36,-0.84 -7.52,0.85l-7.22,15.24c-1.45,2.25 -0.29,5.64 1.73,7.05l54.63,36.13Z' style='fill:%23000000;fill-rule:nonzero;'/%3E%3C/svg%3E");
|
|
| 148 |
- -webkit-mask-repeat: no-repeat; |
|
| 149 |
- mask-repeat: no-repeat; |
|
| 150 | 203 |
width: 40px; |
| 151 | 204 |
height: 20px; |
| 152 |
- background-color: rgba($color-bg-tertiary,0.8); |
|
| 205 |
+ |
|
| 206 |
+ span {
|
|
| 207 |
+ display: block; |
|
| 208 |
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 123 62' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cpath d='M57.548,60.943c2.509,1.409 5.581,1.409 8.09,0l54.92,-36.13c2.31,-1.41 3.18,-5.08 1.74,-7.05l-7,-15c-1.39,-2.22 -5.14,-2.78 -7.46,-1.37l-46.24,30.23l-45.67,-29.95c-2.6,-1.69 -6.36,-0.84 -7.52,0.85l-7.22,15.24c-1.45,2.25 -0.29,5.64 1.73,7.05l54.63,36.13Z' style='fill:%23000000;fill-rule:nonzero;'/%3E%3C/svg%3E");
|
|
| 209 |
+ mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 123 62' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cpath d='M57.548,60.943c2.509,1.409 5.581,1.409 8.09,0l54.92,-36.13c2.31,-1.41 3.18,-5.08 1.74,-7.05l-7,-15c-1.39,-2.22 -5.14,-2.78 -7.46,-1.37l-46.24,30.23l-45.67,-29.95c-2.6,-1.69 -6.36,-0.84 -7.52,0.85l-7.22,15.24c-1.45,2.25 -0.29,5.64 1.73,7.05l54.63,36.13Z' style='fill:%23000000;fill-rule:nonzero;'/%3E%3C/svg%3E");
|
|
| 210 |
+ -webkit-mask-repeat: no-repeat; |
|
| 211 |
+ mask-repeat: no-repeat; |
|
| 212 |
+ width: 40px; |
|
| 213 |
+ height: 20px; |
|
| 214 |
+ background-color: rgba($color-bg-tertiary, 0.8); |
|
| 215 |
+ @include transition(all 0.25s ease-in-out); |
|
| 216 |
+ } |
|
| 217 |
+ |
|
| 218 |
+ &:before {
|
|
| 219 |
+ display: block; |
|
| 220 |
+ visibility: hidden; |
|
| 221 |
+ opacity: 0; |
|
| 222 |
+ font-family: $font-family-alternate; |
|
| 223 |
+ font-size: font-size(10px); |
|
| 224 |
+ white-space: nowrap; |
|
| 225 |
+ position: absolute; |
|
| 226 |
+ right: 100%; |
|
| 227 |
+ margin-right: 20px; |
|
| 228 |
+ top: 50%; |
|
| 229 |
+ @include transform(translate3d(0,-50%,0)); |
|
| 230 |
+ content: attr(data-label-down); |
|
| 231 |
+ background-color: rgba($color-bg-tertiary, 0.8); |
|
| 232 |
+ color: $color-bg-primary; |
|
| 233 |
+ padding: 2px 5px 0; |
|
| 234 |
+ line-height: 2; |
|
| 235 |
+ text-transform: uppercase; |
|
| 236 |
+ @include transition(all 0.25s ease-in-out); |
|
| 237 |
+ |
|
| 238 |
+ } |
|
| 239 |
+ |
|
| 240 |
+ &.-at-bottom {
|
|
| 241 |
+ span {
|
|
| 242 |
+ @include transform(rotate(180deg)); |
|
| 243 |
+ } |
|
| 244 |
+ &:before {
|
|
| 245 |
+ content: attr(data-label-top); |
|
| 246 |
+ } |
|
| 247 |
+ } |
|
| 248 |
+ |
|
| 249 |
+ &:hover {
|
|
| 250 |
+ span {
|
|
| 251 |
+ background-color: rgba($color-bg-tertiary, 1); |
|
| 252 |
+ } |
|
| 253 |
+ &:before {
|
|
| 254 |
+ opacity: 1; |
|
| 255 |
+ visibility: visible; |
|
| 256 |
+ } |
|
| 257 |
+ } |
|
| 153 | 258 |
} |
| 154 | 259 |
|
| 155 | 260 |
.widget p.error {
|
| 156 | 261 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1 @@ |
| 1 |
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 39 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M0,11.056c0.096,-0.555 0.511,-1.003 1.058,-1.14c0.299,-0.05 0.603,-0.07 0.907,-0.06l4.237,0c0.073,-0.003 0.141,-0.035 0.188,-0.09c1.14,-1.11 2.25,-2.25 3.397,-3.337l6,-5.843c0.318,-0.33 0.744,-0.535 1.2,-0.577c0.05,-0.006 0.101,-0.009 0.151,-0.009c0.705,-0 1.289,0.571 1.304,1.276c0.056,0.621 0.073,1.245 0.053,1.868l0,26.04c-0.009,0.364 -0.08,0.724 -0.21,1.065c-0.161,0.515 -0.641,0.868 -1.181,0.868c-0.244,-0 -0.483,-0.073 -0.686,-0.208c-0.359,-0.21 -0.691,-0.462 -0.99,-0.75c-2.245,-2.19 -4.483,-4.385 -6.713,-6.585l-2.25,-2.25c-0.069,-0.061 -0.156,-0.097 -0.248,-0.105l-4.717,-0c-0.675,0.013 -1.273,-0.452 -1.425,-1.11c0.003,-0.03 0.003,-0.06 0,-0.09l-0.075,-8.963Z" style="fill-rule:nonzero;"/><path d="M22.5,7.899c-0.321,0.318 -0.502,0.752 -0.502,1.203c0,0.452 0.181,0.886 0.502,1.204l12.923,12.923c0.322,0.361 0.784,0.567 1.268,0.567c0.934,0 1.703,-0.768 1.703,-1.702c-0,-0.486 -0.208,-0.95 -0.572,-1.273l-12.914,-12.922c-0.663,-0.657 -1.746,-0.657 -2.408,-0" style="fill-rule:nonzero;"/><path d="M37.785,7.899c0.321,0.318 0.502,0.752 0.502,1.203c-0,0.452 -0.181,0.886 -0.502,1.204l-12.915,12.923c-0.318,0.309 -0.744,0.483 -1.188,0.483c-0.934,-0 -1.703,-0.769 -1.703,-1.703c0,-0.443 0.174,-0.87 0.483,-1.188l12.923,-12.922c0.66,-0.656 1.74,-0.656 2.4,-0" style="fill-rule:nonzero;"/></g></svg> |
|
| 0 | 2 |
\ No newline at end of file |
| 1 | 3 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1 @@ |
| 1 |
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 37 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M0,11.055c0.096,-0.554 0.511,-1.003 1.058,-1.14c0.299,-0.05 0.603,-0.07 0.907,-0.06l4.237,0c0.072,-0.004 0.14,-0.037 0.188,-0.09l3.398,-3.337l6,-5.843c0.321,-0.329 0.749,-0.533 1.207,-0.577c0.047,-0.005 0.095,-0.008 0.143,-0.008c0.706,0 1.292,0.57 1.312,1.275c0.04,0.637 0.045,1.276 0.015,1.913l0,26.04c-0.002,0.364 -0.071,0.725 -0.202,1.065c-0.164,0.515 -0.646,0.868 -1.187,0.868c-0.245,-0 -0.484,-0.073 -0.688,-0.208c-0.357,-0.21 -0.687,-0.462 -0.983,-0.75l-6.75,-6.585l-2.25,-2.25c-0.069,-0.06 -0.156,-0.097 -0.247,-0.105l-4.695,-0c-0.677,0.017 -1.276,-0.45 -1.425,-1.11c0.002,-0.03 0.002,-0.06 -0,-0.09l-0.038,-9.008Z" style="fill-rule:nonzero;"/><path d="M36.93,15.81c-0.107,5.614 -3.233,10.754 -8.167,13.433c-0.32,0.228 -0.686,0.382 -1.073,0.45c-0.548,0.081 -1.092,-0.185 -1.365,-0.668c-0.302,-0.458 -0.284,-1.06 0.045,-1.5c0.146,-0.204 0.339,-0.371 0.563,-0.487c0.95,-0.464 1.839,-1.043 2.647,-1.725c2.468,-2.087 4.048,-5.039 4.417,-8.25c0.571,-4.782 -1.614,-9.496 -5.632,-12.15c-0.435,-0.285 -0.908,-0.533 -1.373,-0.75c-0.51,-0.252 -0.811,-0.799 -0.75,-1.365c0.017,-0.567 0.391,-1.064 0.931,-1.238c0.369,-0.131 0.778,-0.101 1.125,0.083c2.037,1.023 3.829,2.477 5.25,4.26c1.261,1.566 2.201,3.365 2.767,5.295c0.451,1.518 0.666,3.096 0.637,4.68" style="fill-rule:nonzero;"/><path d="M31.253,15.72c-0.036,3.174 -1.412,6.19 -3.788,8.295c-0.685,0.617 -1.44,1.151 -2.25,1.59c-0.668,0.374 -1.524,0.142 -1.912,-0.517c-0.132,-0.219 -0.202,-0.469 -0.202,-0.724c0,-0.526 0.296,-1.009 0.764,-1.249c2.816,-1.468 4.588,-4.392 4.588,-7.567c-0,-3.176 -1.772,-6.099 -4.588,-7.568c-0.435,-0.252 -0.704,-0.719 -0.704,-1.222c-0,-0.775 0.638,-1.413 1.413,-1.413c0.249,-0 0.493,0.065 0.709,0.19c2.702,1.44 4.715,3.91 5.58,6.848c0.304,1.086 0.455,2.209 0.45,3.337" style="fill-rule:nonzero;"/><path d="M25.575,15.533c-0.014,2.444 -1.59,4.622 -3.907,5.4c-0.407,0.177 -0.867,0.19 -1.283,0.037c-0.534,-0.236 -0.876,-0.773 -0.863,-1.357c0.029,-0.606 0.439,-1.131 1.021,-1.305c1.096,-0.249 1.937,-1.141 2.122,-2.25c0.29,-1.452 -0.61,-2.897 -2.04,-3.278c-0.679,-0.116 -1.18,-0.713 -1.178,-1.402c-0.008,-0.757 0.601,-1.39 1.358,-1.41c0.619,0.029 1.22,0.215 1.747,0.54c1.575,0.83 2.667,2.358 2.94,4.117c0.043,0.294 0.07,0.589 0.083,0.885" style="fill-rule:nonzero;"/></g></svg> |
|
| 0 | 2 |
\ No newline at end of file |
| ... | ... |
@@ -105,27 +105,72 @@ function Onepage(list, options) {
|
| 105 | 105 |
|
| 106 | 106 |
window.scrollToNextSection = function () {
|
| 107 | 107 |
let sections = document.querySelectorAll('#main .inside > .mod_article, #footer');
|
| 108 |
+ var scroller = document.querySelector('#scroll-down-indicator');
|
|
| 108 | 109 |
var section; |
| 109 | 110 |
|
| 110 |
- for (let i = 0; i < sections.length; i++) |
|
| 111 |
+ if ((scroller !== undefined && !scroller.classList.contains('-at-bottom')) || scroller === undefined)
|
|
| 111 | 112 |
{
|
| 112 |
- section = sections[i]; |
|
| 113 |
- let boundingArea = section.getBoundingClientRect(); |
|
| 114 |
- let viewportTrigger = window.innerHeight; |
|
| 115 | 113 |
|
| 116 |
- if (boundingArea.top < viewportTrigger-15) |
|
| 114 |
+ for (var i = 0; i < sections.length; i++) |
|
| 117 | 115 |
{
|
| 118 |
- continue; |
|
| 119 |
- } |
|
| 116 |
+ section = sections[i]; |
|
| 117 |
+ let boundingArea = section.getBoundingClientRect(); |
|
| 118 |
+ let viewportTrigger = window.innerHeight; |
|
| 119 |
+ |
|
| 120 |
+ if (boundingArea.top < viewportTrigger - 15) |
|
| 121 |
+ {
|
|
| 122 |
+ continue; |
|
| 123 |
+ } |
|
| 120 | 124 |
|
| 125 |
+ scrollTo({
|
|
| 126 |
+ top: getOffsetTop(section), |
|
| 127 |
+ behavior: "smooth" |
|
| 128 |
+ }); |
|
| 129 |
+ break; |
|
| 130 |
+ } |
|
| 131 |
+ } else if (i == sections.length || (scroller !== undefined && scroller.classList.contains('-at-bottom'))) {
|
|
| 121 | 132 |
scrollTo({
|
| 122 |
- top: getOffsetTop(section), |
|
| 133 |
+ top: 0, |
|
| 123 | 134 |
behavior: "smooth" |
| 124 | 135 |
}); |
| 125 |
- break; |
|
| 126 | 136 |
} |
| 137 |
+ |
|
| 127 | 138 |
return section; |
| 128 | 139 |
} |
| 129 | 140 |
|
| 141 |
+ var scroller = document.querySelector('#scroll-down-indicator');
|
|
| 142 |
+ |
|
| 143 |
+ if (scroller) |
|
| 144 |
+ {
|
|
| 145 |
+ // let bottomElements = document.querySelectorAll('#main .inside > .mod_article:last-child, #footer');
|
|
| 146 |
+ let bottomElements = document.querySelectorAll('#footer');
|
|
| 147 |
+ const scrollIndicatorObserver = new IntersectionObserver (function (elements) {
|
|
| 148 |
+ let isIntersecting = false; |
|
| 149 |
+ elements.forEach(function(element) {
|
|
| 150 |
+ if (element.isIntersecting) {
|
|
| 151 |
+ isIntersecting = true; |
|
| 152 |
+ } |
|
| 153 |
+ }); |
|
| 154 |
+ if (isIntersecting) |
|
| 155 |
+ {
|
|
| 156 |
+ scroller.classList.add('-at-bottom');
|
|
| 157 |
+ } else {
|
|
| 158 |
+ scroller.classList.remove('-at-bottom');
|
|
| 159 |
+ } |
|
| 160 |
+ },{rootMargin: "0px 0px 33.333% 0px"});
|
|
| 161 |
+ |
|
| 162 |
+ bottomElements.forEach(function(el) {
|
|
| 163 |
+ scrollIndicatorObserver.observe(el); |
|
| 164 |
+ }); |
|
| 165 |
+ |
|
| 166 |
+ scroller.addEventListener("click", function(event) {
|
|
| 167 |
+ if (window.scrollToNextSection) |
|
| 168 |
+ {
|
|
| 169 |
+ event.preventDefault(); |
|
| 170 |
+ window.scrollToNextSection(); |
|
| 171 |
+ } |
|
| 172 |
+ }) |
|
| 173 |
+ } |
|
| 174 |
+ |
|
| 130 | 175 |
}); |
| 131 | 176 |
}; |
| 132 | 177 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,93 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+declare(strict_types=1); |
|
| 4 |
+ |
|
| 5 |
+namespace App\EventListener; |
|
| 6 |
+ |
|
| 7 |
+use Contao\CoreBundle\DependencyInjection\Attribute\AsHook; |
|
| 8 |
+use Contao\FilesModel; |
|
| 9 |
+use Contao\Validator; |
|
| 10 |
+ |
|
| 11 |
+#[AsHook("replaceInsertTags")]
|
|
| 12 |
+class ReplaceInsertTagListener |
|
| 13 |
+{
|
|
| 14 |
+ public function __invoke(string $insertTag, bool $useCache, string $cachedValue, array $flags, array $tags, array $cache, int $_rit, int $_cnt) |
|
| 15 |
+ {
|
|
| 16 |
+ $elements = explode('::', $insertTag,2);
|
|
| 17 |
+ $insertTag = array_shift($elements); |
|
| 18 |
+ |
|
| 19 |
+ if (strtolower($insertTag) === 'svg_inline') {
|
|
| 20 |
+ if (isset($elements[0]) && $elements[0]) |
|
| 21 |
+ {
|
|
| 22 |
+ $fragments = explode(':', $elements[0]);
|
|
| 23 |
+ $strFile = $fragments[0]; |
|
| 24 |
+ $strId = null; |
|
| 25 |
+ $strClass = null; |
|
| 26 |
+ if (isset($fragments[1])) |
|
| 27 |
+ {
|
|
| 28 |
+ $strClass = $fragments[1]; |
|
| 29 |
+ } |
|
| 30 |
+ if (isset($fragments[2])) |
|
| 31 |
+ {
|
|
| 32 |
+ $strId = $fragments[2]; |
|
| 33 |
+ } |
|
| 34 |
+ |
|
| 35 |
+ if (Validator::isUuid($strFile)) |
|
| 36 |
+ {
|
|
| 37 |
+ // Handle UUIDs |
|
| 38 |
+ $objFile = FilesModel::findByUuid($strFile); |
|
| 39 |
+ |
|
| 40 |
+ if ($objFile === null) |
|
| 41 |
+ {
|
|
| 42 |
+ return ''; |
|
| 43 |
+ } |
|
| 44 |
+ |
|
| 45 |
+ $strFile = $objFile->path; |
|
| 46 |
+ } |
|
| 47 |
+ elseif (is_numeric($strFile)) |
|
| 48 |
+ {
|
|
| 49 |
+ // Handle numeric IDs (see #4805) |
|
| 50 |
+ $objFile = FilesModel::findByPk($strFile); |
|
| 51 |
+ |
|
| 52 |
+ if ($objFile === null) |
|
| 53 |
+ {
|
|
| 54 |
+ return ''; |
|
| 55 |
+ } |
|
| 56 |
+ |
|
| 57 |
+ $strFile = $objFile->path; |
|
| 58 |
+ } |
|
| 59 |
+ elseif (Validator::isInsecurePath($strFile)) |
|
| 60 |
+ {
|
|
| 61 |
+ throw new \RuntimeException('Invalid path ' . $strFile);
|
|
| 62 |
+ } |
|
| 63 |
+ elseif (($objFile = FilesModel::findByPath($strFile)) !== null) |
|
| 64 |
+ {
|
|
| 65 |
+ $strFile = $objFile->path; |
|
| 66 |
+ } else {
|
|
| 67 |
+ return ''; |
|
| 68 |
+ } |
|
| 69 |
+ |
|
| 70 |
+ return $this->print_svg($strFile,$strClass,$strId); |
|
| 71 |
+ } |
|
| 72 |
+ } |
|
| 73 |
+ } |
|
| 74 |
+ |
|
| 75 |
+ protected function print_svg($svgPath, ?string $strClass=null, ?string$strId=null){
|
|
| 76 |
+ $iconfile = new \DOMDocument(); |
|
| 77 |
+ $iconfile->load($svgPath); |
|
| 78 |
+ if (($svg = $iconfile->getElementsByTagName('svg')->item(0)))
|
|
| 79 |
+ {
|
|
| 80 |
+ if ($strClass) {
|
|
| 81 |
+ if (($embClass = $svg->getAttribute('class')))
|
|
| 82 |
+ {
|
|
| 83 |
+ $strClass = $embClass. ' ' . $strClass; |
|
| 84 |
+ } |
|
| 85 |
+ $svg->setAttribute('class', $strClass);
|
|
| 86 |
+ } |
|
| 87 |
+ if ($strId){
|
|
| 88 |
+ $svg->setAttribute('id', $strId);
|
|
| 89 |
+ } |
|
| 90 |
+ return $iconfile->saveHTML($svg); |
|
| 91 |
+ } |
|
| 92 |
+ } |
|
| 93 |
+} |
| 0 | 94 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,47 @@ |
| 1 |
+<div id="player-audio-controls" data-source-selector="#image-clip video"> |
|
| 2 |
+ <a href="{{env::request|urlattr}}" class="audio-mute" aria-label="Ton stummschalten" data-label="Ton stummschalten">{{svg_inline::f6824c1a-7d6c-11ed-9054-d8cb8a1a4c4f}}</a>
|
|
| 3 |
+ <a href="{{env::request|urlattr}}" class="audio-unmute" aria-label="Ton einschalten" data-label="Ton einschalten">{{svg_inline::9b19cf0a-7d6d-11ed-9054-d8cb8a1a4c4f}}</a>
|
|
| 4 |
+</div> |
|
| 5 |
+<script> |
|
| 6 |
+ document.addEventListener("DOMContentLoaded", function() {
|
|
| 7 |
+ |
|
| 8 |
+ var controls = document.getElementById('player-audio-controls');
|
|
| 9 |
+ var video = controls !== undefined && controls.dataset.sourceSelector !== undefined ? document.querySelector(controls.dataset.sourceSelector) : undefined; |
|
| 10 |
+ |
|
| 11 |
+ if (video !== undefined) |
|
| 12 |
+ {
|
|
| 13 |
+ let mute = controls.querySelector('.audio-mute'),
|
|
| 14 |
+ unmute = controls.querySelector('.audio-unmute');
|
|
| 15 |
+ |
|
| 16 |
+ if (mute !== undefined && unmute !== undefined) |
|
| 17 |
+ {
|
|
| 18 |
+ if (video.muted) |
|
| 19 |
+ {
|
|
| 20 |
+ unmute.classList.add('-show');
|
|
| 21 |
+ mute.classList.remove('-show');
|
|
| 22 |
+ } else {
|
|
| 23 |
+ mute.classList.add('-show');
|
|
| 24 |
+ unmute.classList.remove('-show');
|
|
| 25 |
+ } |
|
| 26 |
+ |
|
| 27 |
+ unmute.addEventListener('click', (event) => {
|
|
| 28 |
+ event.preventDefault(); |
|
| 29 |
+ if (video.muted) {
|
|
| 30 |
+ video.muted = false; |
|
| 31 |
+ mute.classList.add('-show');
|
|
| 32 |
+ unmute.classList.remove('-show');
|
|
| 33 |
+ } |
|
| 34 |
+ }); |
|
| 35 |
+ mute.addEventListener('click', (event) => {
|
|
| 36 |
+ event.preventDefault(); |
|
| 37 |
+ if (!video.muted) {
|
|
| 38 |
+ video.muted = true; |
|
| 39 |
+ unmute.classList.add('-show');
|
|
| 40 |
+ mute.classList.remove('-show');
|
|
| 41 |
+ } |
|
| 42 |
+ }); |
|
| 43 |
+ } |
|
| 44 |
+ } |
|
| 45 |
+ |
|
| 46 |
+ }); |
|
| 47 |
+</script> |