5 コミット

作成者 SHA1 メッセージ 日付
みてるぞ 3e97e3c4f4 [BC] available の hidden 要らん 2024-05-04 00:39:41 +09:00
みてるぞ b9c990d6b5 [BC] ニジカ落ちの警報表示 2024-05-04 00:24:46 +09:00
みてるぞ 506c29a32d [BC] 詳細画面 改行可能に 2024-05-03 16:35:14 +09:00
みてるぞ 535e44c4e7 ダブル・クヲゥトを escape 2024-05-02 06:43:16 +09:00
miteruzo ba39be8551 落ち確認 2024-05-02 06:33:51 +09:00
6個のファイルの変更81行の追加6行の削除
+44
ファイルの表示
@@ -0,0 +1,44 @@
export default class
CommonModule
{
static
isWide (chr)
{
return chr.match (/[^\x01-\x7f]/) !== null;
}
static
lenByFull (str)
{
return str.split ('').map (c => this.isWide (c) ? 1 : .5)
.reduce ((a, c) => a + c);
}
static
indexByFToC (str, index)
{
let i = 0;
let work = '';
for (let c of str)
{
work += c;
if (this.lenByFull (work) > index)
break;
i += 1;
}
return i;
}
static
midByFull (str, start, length)
{
const trimmedLeft = str.slice (this.indexByFToC (str, start));
return trimmedLeft.slice (0, this.indexByFToC (trimmedLeft, length));
}
}
+6
ファイルの表示
@@ -22,6 +22,12 @@
</head>
<body>
<?php if (!($available)): ?>
<div class="alert alert-danger" role="alert">
<strong>【警報】</strong>AIニジカが落ちてるぬ゛〜゛ん゛(泣)
</div>
<?php endif ?>
<div class="container my-5">
<div class="accordion mb-5" id="accordion-filter">
<div class="accordion-item">
+5
ファイルの表示
@@ -7,6 +7,11 @@ const LOG_PATH = './log.txt';
$log_data = [];
exec ("(ps -Af | grep -e '^miteruzo' | grep 'python3 main.py') && (ps -Af | grep -e '^miteruzo' | grep 'obs')",
$output, $exit_code);
$available = $exit_code === 0;
unset ($output, $exit_code);
$page = (int) ($_GET['p'] ?? 1);
$length = (int) ($_GET['max'] ?? 20);
$asc = ($_GET['asc'] ?? 0) != 0;
+1 -1
ファイルの表示
@@ -17,7 +17,7 @@
<body>
<canvas id="canvas"></canvas>
<script src="./talk.js?<?= filemtime ('./talk.js') ?>" type="text/javascript"></script>
<script src="./talk.js?<?= filemtime ('./talk.js') ?>" type="module"></script>
</body>
</html>
+22 -2
ファイルの表示
@@ -1,3 +1,6 @@
import CommonModule from './common_module.js';
class
Talk
{
@@ -46,10 +49,27 @@ Canvas
this.putText (0, 0, 15, $ ('#dt').val ());
this.putImage (this.nizika, 370, 260, 1.1);
this.putImage (this.talking, 0, 0, 640 / 1024);
this.putText (75, 43.75, 20, '> ' + $ ('#chat').val (),
this.putText (75, 43.75, 20,
('> ' + ((CommonModule.lenByFull ($ ('#chat').val ()) <= 21)
? $ ('#chat').val ()
: (CommonModule.midByFull ($ ('#chat').val (), 0, 19.5)
+ '...'))),
undefined, undefined,
true);
this.putText (62.5, 93.75, 31.25, $ ('#answer').val (), 'Nikumaru', '#c00000');
this.putText (62.5, 93.75, 31.25,
((CommonModule.lenByFull ($ ('#answer').val ()) <= 16)
? $ ('#answer').val ()
: CommonModule.midByFull ($ ('#answer').val (), 0, 16)),
'Nikumaru', '#c00000');
if (CommonModule.lenByFull ($ ('#answer').val ()) > 16)
{
this.putText (62.5, 125, 31.25,
((CommonModule.lenByFull ($ ('#answer').val ()) <= 32)
? CommonModule.midByFull ($ ('#answer').val (), 16, 16)
: (CommonModule.midByFull ($ ('#answer').val (), 16, 14.5)
+ '...')),
'Nikumaru', '#c00000');
}
}
putBG ()
+3 -3
ファイルの表示
@@ -3,9 +3,9 @@
if ($_SERVER['HTTP_HOST'] === 'nizika.monster')
header ('location: //nizika.tv/talk.php');
$dt = $_GET['dt'];
$chat = $_GET['chat'];
$answer = $_GET['answer'];
$dt = htmlspecialchars ($_GET['dt']);
$chat = htmlspecialchars ($_GET['chat']);
$answer = htmlspecialchars ($_GET['answer']);
require_once './talk.frm.php';