Skip to content

Commit

Permalink
Merge pull request #4 from TiagoDGomes/version-2.2
Browse files Browse the repository at this point in the history
Version 2.2
  • Loading branch information
TiagoDGomes authored Oct 9, 2024
2 parents ff3c451 + e455163 commit 40fdaa3
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 161 deletions.
2 changes: 1 addition & 1 deletion core/core.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$APP_VERSION = "2.0";
$APP_VERSION = "2.2";
$APP_TITLE = "Painel";

define('PCORE', true);
Expand Down
12 changes: 11 additions & 1 deletion core/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@
require_once 'core/info.php';
}

$flag_access = AccessCheck::isValidAdminPage() ? 'admin' : 'user';
$flag_access = AccessCheck::isValidAdminPage() ? 'admin' : 'user';

if (AccessCheck::isValidAdminPage()) {
$flag_access = 'admin';
$full_screen_url = '?i=' . $_GET['i'];
$target_full_screen = '';
} else {
$flag_access = 'user';
$full_screen_url = 'javascript:fullScreen();';
$target_full_screen = '';
}
65 changes: 23 additions & 42 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
<script src="scripts/classes.js?v=<?= @$APP_VERSION ?>"></script>
<link rel="stylesheet" href="media/<?= $flag_access ?>.css?v=<?= @$APP_VERSION ?>">
<meta name="theme-color" content="var(--timer-default-color)">

<?php if (AccessCheck::hasQRCode()): ?>
<script src="scripts/qrcode.js?v=<?= @$APP_VERSION ?>"></script>
<?php endif; ?>
</head>
<body class="<?= $flag_access ?>">
<div id="main">
Expand All @@ -30,19 +27,28 @@
<div class="container-timer">
<div id="timer"></div>
</div>
<div class="container-toolbar">
<div class="item">
<a title="Acessar versão em tela inteira" target="<?= $target_full_screen ?>" href="<?= $full_screen_url ?>"><i class="icon full-screen"></i></a>
</div>
<div class="item">
<a id="qcode" href="#" title="Mostrar QRCode" onclick="alternarQRCode()"><i class="icon qrcode"></i></a>
</div>
</div>
<?php if (AccessCheck::isSystemMessageActive()): ?>

<div class="container-title">
<h1 id="title"><?= $body_admin_class ?></h1>
<h1 id="title"></h1>
</div>
<div class="container-message">
<p id="message"><?= $body_admin_class ?></p>
<p id="message"></p>
</div>
<?php endif; ?>

<?php if (AccessCheck::isValidAdminPage()): ?>

<!--<admin>-->

<div class="container-admin">
<p>
<div class="timer-buttons command-buttons">
Expand Down Expand Up @@ -103,59 +109,34 @@
<span class="edge"></span>
<span class="front text">15:00</span>
</button>
</div>
</div>
<div class="timer-buttons">
<button onclick="window.open('?i=<?= $_GET['i'] ?>')" class="big blue">
<button style="display: none" onclick="window.open('?i=<?= $_GET['i'] ?>')" class="big blue">
<span class="shadow"></span>
<span class="edge"></span>
<span class="front text">Tela inteira</span>
</button>
</div>
</div>


</div>
</div>
<!--</admin>-->

<?php else: ?>

<!--<user>-->

<!--</user>-->

<?php endif; ?>
</div>
<div id="qrcode"></div>
<div id="qrcode" style="display: none"></div>
<div class="container-status">
<div id="status"></div>
<div id="status-basic"></div>
<div id="status-error"><noscript>O Javascript está desativado.</noscript></div>
</div>
<div class="container-debug">
<pre id="debug"><?php // var_dump($_SERVER); ?></pre>
</div>

</div>
</div>
<?php if (AccessCheck::hasQRCode()): ?>

<script type="text/javascript">

var qrcode = new QRCode(document.getElementById("qrcode"), {
text: CURRENT_URL,
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
document.getElementById("qrcode").title="";

<?php if (AccessCheck::isValidAdminPage()): ?>

document.getElementById("qrcode").addEventListener('mouseover', function(event){
this.style.filter = 'blur(0)';
});
document.getElementById("qrcode").addEventListener('mouseout', function(event){
this.style.filter = 'blur(4px)';
});
<?php endif; // (AccessCheck::isValidAdminPage()): ?>

</script>

<?php endif; // (AccessCheck::hasQRCode())?>

</body>
</html>
4 changes: 0 additions & 4 deletions media/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ body.admin.timer-sync .timer-buttons,
body.admin.timer-zero button.pause,
body.admin.timer-ready button.pause {
visibility: hidden;
}

body.admin #qrcode {
filter: blur(4px);
}
43 changes: 37 additions & 6 deletions media/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ body {
body.user,
body .container-timer {
background-color: var(--timer-default-color);
width: 100%;
}

body {
overflow-x: hidden;
}

body .container-timer {
Expand Down Expand Up @@ -109,15 +114,12 @@ body .container-title h1 {
padding: 0 5px 0 15px;
}

body.admin #qrcode {
bottom: 4em;
}

#qrcode {
position: fixed;
margin: 2px;
right: 2px;

right: 40px;
top: 1px;
}

body.user #qrcode {
Expand All @@ -133,11 +135,40 @@ body.user #qrcode {

.container-debug {
position: fixed;
top: 0.02em;
top: .5em;
left: .5em;
}

#debug {
color: #ffffff1a;
text-shadow: 1px 1px #00000021;
margin: 0;
}

.container-toolbar {
position: fixed;
top: .5em;
right: .5em;
}

i.icon {
background-repeat: no-repeat;
background-size: contain;
width: 24px;
height: 24px;
display: inline-block;
filter: invert();
opacity: .5;
}

i.icon:hover {
opacity: 1;
}

i.icon.full-screen {
background-image: url(fullscreen.png);
}

i.icon.qrcode {
background-image: url(qrcode.png);
}
Binary file added media/fullscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions media/obs.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

body.obs{
body.obs {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-color: black;
color:white;
color: white;
}
.obs button{

.obs button {
background-color: rgb(49, 49, 49);
color:white;
color: white;
border-radius: 6px;
padding: 6px;
padding: 6px;
}
.obs button:hover{

.obs button:hover {
background-color: rgb(100, 99, 99);
}

Expand Down
Binary file added media/qrcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 40fdaa3

Please sign in to comment.