This commit is contained in:
jr-k 2024-08-26 15:30:00 +02:00
parent ccf29b1117
commit 1f7bd30ddf
7 changed files with 56 additions and 44 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,10 @@ jQuery(function () {
function adjustValue(inputElement, delta) {
const currentValue = parseInt(inputElement.value) || 0;
const newValue = currentValue + delta;
inputElement.value = newValue >= 0 ? newValue : 0;
$(inputElement).trigger('input');
if (("" + newValue).length <= inputElement.maxLength) {
inputElement.value = newValue >= 0 ? newValue : 0;
$(inputElement).trigger('input');
}
}
$('.numeric-input').on('input', function () {

View File

@ -21,15 +21,21 @@ jQuery(document).ready(function ($) {
const draw = function() {
const $screen = $('#screen');
const $text = $('<div class="text">');
let inside = $('#elem-text').val();
let insideText = $('#elem-text').val();
if ($('#elem-scroll-enable').is(':checked')) {
const $wrapper = $('<marquee>');
inside = $wrapper;
$wrapper.html(inside);
$wrapper.attr({
scrollamount: $('#elem-scroll-speed').val(),
direction: $('[name=elem-scroll-direction]:checked').val(),
behavior: 'scroll',
loop: -1
});
$wrapper.append(insideText);
insideText = $wrapper;
}
$text.html(inside);
$text.append(insideText);
let justifyContent = 'center';
switch($('[name=elem-text-align]:checked').val()) {
@ -39,7 +45,6 @@ jQuery(document).ready(function ($) {
$text.css({
padding: $('#elem-container-margin').val() + 'px',
backgroundColor: $('#elem-bg-color').val(),
color: $('#elem-fg-color').val(),
textAlign: $('[name=elem-text-align]:checked').val(),
textDecoration: $('#elem-text-underline').is(':checked') ? 'underline' : 'normal',
@ -51,6 +56,10 @@ jQuery(document).ready(function ($) {
justifyContent: justifyContent
});
$screen.css({
backgroundColor: $('#elem-bg-color').val(),
});
$screen.html($text);
};

View File

@ -18,8 +18,7 @@
@import 'components/modals';
@import 'components/toast';
@import 'components/dragdrop';
// Legacy
@import 'components/animation';
@import 'components/panes';
@import 'components/tiles';
@import 'components/empty';

View File

@ -45,6 +45,7 @@
overflow: hidden;
border-radius: $baseRadius;
outline: 4px solid rgba($gscaleF, .1);
background: repeating-conic-gradient(#EEE 0% 25%, white 0% 50%) 50% / 20px 20px;
.screen {
position: absolute;
@ -54,7 +55,6 @@
height: 100%;
border: none;
display: flex;
background: repeating-conic-gradient(#EEE 0% 25%, white 0% 50%) 50% / 20px 20px;
.text {
display: flex;
@ -65,6 +65,16 @@
align-self: stretch;
text-align: center;
max-width: 100%;
marquee {
display: flex;
align-items: center;
justify-content: flex-start;
flex-direction: row;
flex: 1;
height: 100%;
width: 100%;
}
}
}
}
@ -93,7 +103,6 @@
margin-bottom: 10px;
}
.bar {
width: 100%;
height: 1px;

View File

@ -239,46 +239,38 @@
</h3>
<div class="form-group">
<label for="elem-scroll-enable">Enable</label>
<div class="widget">
<div class="toggle">
<input type="checkbox" name="elem-scroll-enable" id="elem-scroll-enable" />
<label for="elem-scroll-enable"></label>
</div>
</div>
</div>
<div class="horizontal">
<div class="form-group">
<label for="elem-scroll-speed">Speed</label>
<div class="widget widget-unit">
<input type="text" id="elem-scroll-speed" name="elem-scroll-speed" maxlength="3" class="numeric-input chars-3" value="10">
<label for="elem-scroll-enable">Enable</label>
<div class="widget">
<div class="toggle">
<input type="checkbox" name="elem-scroll-enable" id="elem-scroll-enable" />
<label for="elem-scroll-enable"></label>
</div>
</div>
</div>
<div class="form-group">
<label for="elem-scroll-direction">Direction</label>
<div class="widget">
<div class="radio-group">
<input type="radio" id="elem-scroll-direction-left" name="elem-scroll-direction-left" value="left">
<input type="radio" id="elem-scroll-direction-left" name="elem-scroll-direction" value="left" checked>
<label for="elem-scroll-direction-left" class="btn btn-neutral">
<i class="fa fa-arrow-left"></i>
</label>
<input type="radio" id="elem-scroll-direction-right" name="elem-scroll-direction-right" value="right">
<input type="radio" id="elem-scroll-direction-right" name="elem-scroll-direction" value="right">
<label for="elem-scroll-direction-right" class="btn btn-neutral">
<i class="fa fa-arrow-right"></i>
</label>
<input type="radio" id="elem-scroll-direction-down" name="elem-scroll-direction-down" value="down">
<label for="elem-scroll-direction-down" class="btn btn-neutral">
<i class="fa fa-arrow-down"></i>
</label>
<input type="radio" id="elem-scroll-direction-up" name="elem-scroll-direction-up" value="up">
<label for="elem-scroll-direction-up" class="btn btn-neutral">
<i class="fa fa-arrow-up"></i>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="elem-scroll-speed">Speed</label>
<div class="widget widget-unit">
<input type="text" id="elem-scroll-speed" name="elem-scroll-speed" maxlength="3" class="numeric-input chars-3" value="10">
</div>
</div>
</div>
@ -288,15 +280,6 @@
</h3>
<div class="horizontal">
<div class="form-group">
<label for="elem-container-margin">Container Margin</label>
<div class="widget widget-unit">
<input type="text" id="elem-container-margin" name="elem-container-margin" maxlength="3"
class="numeric-input chars-3" value="0">
<span>pt</span>
</div>
</div>
<div class="form-group">
<label for="elem-single-line">Single Line Only</label>
<div class="widget">
@ -307,6 +290,16 @@
</div>
</div>
<div class="form-group">
<label for="elem-container-margin">Container Margin</label>
<div class="widget widget-unit">
<input type="text" id="elem-container-margin" name="elem-container-margin" maxlength="3"
class="numeric-input chars-3" value="0">
<span>pt</span>
</div>
</div>
</div>