Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit 7678913

Browse files
jacques42andi34
authored andcommitted
remotebuzzer: enable rotary for live-chromakeying
Change-Id: I6980af1293fbdd9e0d076eeb00ac6085a97c3999
1 parent 724756e commit 7678913

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

livechroma.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@
6363
</head>
6464
<body>
6565
<div class="chromawrapper">
66+
<div class="rotarygroup" id="start">
6667
<div class="top-bar">
6768
<?php if (!$config['live_keying']['enabled']): ?>
68-
<a href="index.php" class="<?php echo $btnClass1; ?> closebtn"><i class="fa fa-times"></i></a>
69+
<a href="index.php" class="<?php echo $btnClass1; ?> closebtn rotaryfocus"><i class="fa fa-times"></i></a>
6970
<?php endif; ?>
7071

7172
<?php if ($config['gallery']['enabled']): ?>
72-
<a href="#" class="<?php echo $btnClass1 ?> gallerybtn"><i class="fa fa-th"></i> <span data-i18n="gallery"></span></a>
73+
<a href="#" class="<?php echo $btnClass1 ?> gallerybtn rotaryfocus"><i class="fa fa-th"></i> <span data-i18n="gallery"></span></a>
7374
<?php endif; ?>
7475

7576
</div>
@@ -109,20 +110,21 @@
109110
$cdir = scandir($dir);
110111
foreach ($cdir as $key => $value) {
111112
if (!in_array($value, array(".","..")) && !is_dir($dir.$value)) {
112-
echo '<img src="'.$dir.$value.'" class="backgroundPreview" onclick="setBackgroundImage(this.src)">';
113+
echo '<img src="'.$dir.$value.'" class="backgroundPreview rotaryfocus" onclick="setBackgroundImage(this.src)">';
113114
}
114115
}
115116
?>
116117
</div>
117118

118119
<div class="chroma-control-bar">
119-
<a href="#" class="<?php echo $btnClass2; ?> takeChroma"><i class="fa fa-camera"></i> <span data-i18n="takePhoto"></span></a>
120+
<a href="#" class="<?php echo $btnClass2; ?> takeChroma rotaryfocus"><i class="fa fa-camera"></i> <span data-i18n="takePhoto"></span></a>
120121
<?php if ($config['picture']['allow_delete']): ?>
121-
<a href="#" class="deletebtn <?php echo $btnClass2; ?> "><i class="fa fa-trash"></i> <span data-i18n="delete"></span></a>
122+
<a href="#" class="<?php echo $btnClass2; ?> deletebtn"><i class="fa fa-trash"></i> <span data-i18n="delete"></span></a>
122123
<?php endif; ?>
123-
<a href="#" class="reloadPage <?php echo $btnClass2; ?> "><i class="fa fa-refresh"></i> <span data-i18n="reload"></span></a>
124+
<a href="#" class="reloadPage <?php echo $btnClass2; ?> rotaryfocus"><i class="fa fa-refresh"></i> <span data-i18n="reload"></span></a>
124125
</div>
125-
<div>
126+
</div>
127+
<div class="rotarygroup">
126128

127129
<div id="wrapper">
128130
<?php include('template/gallery.template.php'); ?>
@@ -165,8 +167,11 @@
165167
<script type="text/javascript" src="vendor/Seriously/effects/seriously.chroma.js"></script>
166168
<?php endif; ?>
167169
<script type="text/javascript" src="resources/js/livechroma.js"></script>
170+
<script type="text/javascript" src="resources/js/remotebuzzer_client.js"></script>
168171
<script type="text/javascript" src="resources/js/theme.js"></script>
169172
<script src="node_modules/@andreasremdt/simple-translator/dist/umd/translator.min.js"></script>
170173
<script type="text/javascript" src="resources/js/i18n.js"></script>
174+
175+
<?php require_once('lib/services_start.php'); ?>
171176
</body>
172177
</html>

src/js/livechroma.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* globals photoBooth MarvinColorModelConverter AlphaBoundary MarvinImage Seriously */
1+
/* globals photoBooth MarvinColorModelConverter AlphaBoundary MarvinImage Seriously rotaryController */
22
/* exported setBackgroundImage setMainImage */
33
let mainImage;
44
let mainImageWidth;
@@ -266,13 +266,18 @@ $('.takeChroma, .newchroma').on('click', function (e) {
266266
const chromaInfo = photoBooth.getTranslation('chromaInfoAfter');
267267

268268
photoBooth.thrill('chroma');
269+
269270
if ($('.chroma-control-bar').is(':visible')) {
270271
$('.chroma-control-bar').hide();
271272
$('.backgrounds').hide();
272273

273274
setTimeout(() => {
274275
$('.chromaNote').show();
275276
$('.chromaNote').text(chromaInfo);
277+
$('.chroma-control-bar > .takeChroma').hide();
278+
$('.chroma-control-bar > .deleteBtn').hide();
279+
$('.chroma-control-bar > .reloadPage').show();
280+
$('.chroma-control-bar').show();
276281
}, config.picture.cntdwn_time * 1000);
277282
}
278283
});
@@ -321,3 +326,13 @@ $('.gallerybtn').on('click', function (e) {
321326

322327
photoBooth.openGallery($(this));
323328
});
329+
330+
// Close Button
331+
$('.closebtn').on('click', function () {
332+
location.assign('./index.php');
333+
});
334+
335+
$(document).ready(function () {
336+
console.log('DOM ready');
337+
rotaryController.focusSet('#start');
338+
});

src/js/remotebuzzer_client.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function initRemoteBuzzerFromDOM() {
164164
.find('i.fa')
165165
.css('z-index', '1');
166166
} else {
167-
const buttonList = $('.focused').parents('.rotarygroup').find('.rotaryfocus');
167+
const buttonList = $('.focused').parents('.rotarygroup').find('.rotaryfocus:visible');
168168
let focusIndex = buttonList.index($('.focused'));
169169

170170
if (buttonList.eq(focusIndex + 1).exists()) {
@@ -176,10 +176,12 @@ function initRemoteBuzzerFromDOM() {
176176
$('.focused')
177177
.removeClass('focused')
178178
.parents('.rotarygroup')
179-
.find('.rotaryfocus')
179+
.find('.rotaryfocus:visible')
180180
.eq(focusIndex)
181181
.addClass('focused')
182182
.focus();
183+
184+
console.log('set focus to', $('.focused'));
183185
}
184186
};
185187

@@ -206,7 +208,7 @@ function initRemoteBuzzerFromDOM() {
206208
.css('z-index', '1');
207209
}
208210
} else {
209-
const buttonList = $('.focused').parents('.rotarygroup').find('.rotaryfocus');
211+
const buttonList = $('.focused').parents('.rotarygroup').find('.rotaryfocus:visible');
210212
const focusIndex = buttonList.index($('.focused'));
211213

212214
if (buttonList.eq(focusIndex - 1).exists()) {

src/sass/modern_live_chromakeying.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@
5050
}
5151
}
5252
}
53+
54+
.pswp-rotary-focus {
55+
background: radial-gradient(grey, $mainColor, $hoverColor) !important;
56+
}

0 commit comments

Comments
 (0)