27 コミット

作成者 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
みてるぞ d50e23172b [BC] 詳細画面 とりま動くものにはなった 2024-04-25 04:07:32 +09:00
みてるぞ 0a1e46dd37 BC詳細画面 2024-04-24 04:51:42 +09:00
みてるぞ 2fba77b89f 'broadcast/index.frm.php' を更新 2024-04-23 04:08:00 +09:00
miteruzo b447c96d2e てすと 2024-04-23 04:07:18 +09:00
みてるぞ 4cae005dfe 'broadcast/index.frm.php' を更新 2024-04-23 03:59:35 +09:00
みてるぞ 101ca991a8 'broadcast/webhook.php' を更新 2024-04-23 03:58:46 +09:00
みてるぞ 82d366de79 'broadcast/index.frm.php' を更新 2024-04-23 03:57:34 +09:00
miteruzo 4c7a0dbe59 自動 Pull に対応(Jenkins 入れんでよかったやん……時間返せ) 2024-04-23 03:55:17 +09:00
みてるぞ 12af789385 ニジカのしっぽ手前に 2024-04-08 20:55:24 +09:00
みてるぞ b0823f7766 'broadcast/index.frm.php' を更新 2024-04-08 00:15:50 +09:00
みてるぞ 96a3ff125b キャッシュ・クリア 2024-04-08 00:12:53 +09:00
みてるぞ 46b231c6ac ちょっと修正 2024-04-08 00:03:07 +09:00
みてるぞ 2df0e1d9f5 ニジカ Pagination 完成 2024-04-07 23:54:34 +09:00
みてるぞ cbb64ddcf1 Merge branch 'main' into bc-page-body 2024-04-07 20:36:19 +09:00
みてるぞ d55800ec71 アイコン・サイズ統一教会 2024-04-06 13:28:51 +09:00
みてるぞ 19227ca93c ゴートうひとり放送局 2024-03-31 20:44:01 +09:00
みてるぞ c420858e9a ゴートう放送局 2024-03-31 20:32:57 +09:00
みてるぞ 57b261a751 ニジカ Pagination 2024-03-31 19:29:40 +09:00
みてるぞ 036656469e 絞り込みの表示状況保持 2024-03-10 19:08:48 +09:00
みてるぞ 2a33a74153 Pagination 奇数固定 2024-02-29 01:27:27 +09:00
miteruzo 1cc8ffe594 細部の修正 2024-02-28 02:58:10 +09:00
みてるぞ 7de05c2af5 ペィジ選択の個数を幅によって変更 2024-02-28 02:44:25 +09:00
21個のファイルの変更454行の追加51行の削除
+1
ファイルの表示
@@ -1,2 +1,3 @@
/log.txt
/log2.txt
実行可能ファイル
バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 450 KiB

バイナリ
ファイルの表示
バイナリファイルは表示されません.
バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 40 KiB

バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 1.0 KiB

バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 3.1 KiB

バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 9.3 KiB

バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 42 KiB

+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));
}
}
バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 138 KiB

+41 -12
ファイルの表示
@@ -1,3 +1,5 @@
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
<!DOCTYPE html>
<html lang="ja">
<head>
@@ -5,19 +7,32 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="//code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script>
<script src="/modules/jquery.cookie-1.4.1.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-ja.min.js"></script>
<link href="//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.min.css" />
<link href="./style.css" rel="stylesheet" />
<link href="./style.css?<?= filemtime ('./style.css') ?>" rel="stylesheet" />
<?php $april_fool = ((int) date ('n') === 4) && ((int) date ('j') === 1) ?>
<?php if ($april_fool): ?>
<link rel="icon" href="favicon-goatoh.ico" />
<title>ゴートうひとり放送局 - ゴートう返答ログ</title>
<?php else: ?>
<title>伊地知ニジカ放送局 - ニジカ返答ログ</title>
<?php endif ?>
</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">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-filter" aria-expanded="true" aria-controls="collapse-filter">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-filter" aria-controls="collapse-filter">
絞り込み
</button>
</h2>
@@ -53,14 +68,24 @@
<div class="row d-flex align-items-center my-2">
<div class="col-sm-4 fw-bold">
<?php if ($april_fool): ?>
ゴートう日とり
<?php else: ?>
日時ニジカ
<?php endif ?>
</div>
<div class="col-sm input-group">
<input type="text" class="form-control" placeholder="YYYY-MM-DD" id="filter-date-start"
<input type="text"
class="form-control"
placeholder="YYYY-MM-DD"
id="filter-date-start"
value="<?= $date_start ?>" />
<span class="input-group-text">〜</span>
<input type="text" class="form-control" placeholder="YYYY-MM-DD" id="filter-date-end"
<input type="text"
class="form-control"
placeholder="YYYY-MM-DD"
id="filter-date-end"
value="<?= $date_end ?>" />
</div>
</div>
@@ -71,7 +96,10 @@
</div>
<div class="col-sm">
<input type="text" class="form-control" placeholder="ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛" id="filter-keyword"
<input type="text"
class="form-control"
placeholder="<?= $april_fool ? 'ムムムム!! クサタベテル!!!!!' : 'ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛' ?>"
id="filter-keyword"
value="<?= $keyword ?>"/>
</div>
</div>
@@ -100,23 +128,24 @@
<?php foreach (array_slice ($log_data,
($page - 1) * $length,
$length,
true) as $record): ?>
<div class="mb-4">
true)
as $record): ?>
<div class="mb-4 message-block">
<div>
<?= $record['date_time'] ?>
<span class="message-block-dt"><?= $record['date_time'] ?></span>
</div>
<div>
<img src="<?= $record['chat_icon'] ?>" />
<img src="<?= $record['chat_icon'] ?>" width="64" height="64" />
<?= $record['chat_name'] ?>
</div>
<div style="color: blue">
&gt; <span style="font-style: italic"><?= $record['chat_message'] ?></span>
&gt; <span class="message-block-chat" style="font-style: italic"><?= $record['chat_message'] ?></span>
</div>
<div>
<?= $record['answer'] ?>
<span class="message-block-answer"><?= $record['answer'] ?></span>
</div>
</div>
<?php endforeach ?>
@@ -131,7 +160,7 @@
</div>
<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="./script.js" type="text/javascript"></script>
<script src="./script.js?<?= filemtime ('./script.js') ?>" type="text/javascript"></script>
</body>
</html>
+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;
+2
ファイルの表示
@@ -0,0 +1,2 @@
/*! jquery.cookie v1.4.1 | MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
+37 -14
ファイルの表示
@@ -1,38 +1,61 @@
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
<nav class="d-flex justify-content-center" aria-label="...">
<ul class="pagination">
<ul class="pagination opacity-0">
<?php if ($page > 1): ?>
<li class="page-item">
<a class="page-link no-wrap" href="#" onclick="Script.jumpTo (1)">|&lt;</a>
<li class="page-item deerjika-tail">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (1)">
<img src="./assets/page-first.png" />
<div class="page-link-text">|&lt;</div>
</a>
</li>
<?php else: ?>
<li class="page-item disabled">
<span class="page-link">|&lt;</span>
<li class="page-item disabled deerjika-tail">
<span class="page-link">
<img src="./assets/page-first.png" />
<div class="page-link-text"></div>
</span>
</li>
<?php endif ?>
<?php for ($i = max (min ($page + 2, $pages_max) - 4, 1); $i < $page; ++$i): ?>
<li class="page-item">
<a class="page-link" href="#" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?>
<li class="page-item page-<?= $page - $i ?>">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
<img src="./assets/page-body.png" />
<div class="page-link-text"><?= $i ?></div>
</a>
</li>
<?php endfor ?>
<li class="page-item active" aria-current="page">
<span class="page-link"><?= $page ?></span>
<span class="page-link">
<img src="./assets/page-body.png" />
<div class="page-link-text"><?= $page ?></div>
</span>
</li>
<?php for ($i = $page + 1; $i <= min (max ($page - 2, 1) + 4, $pages_max); ++$i): ?>
<li class="page-item">
<a class="page-link" href="#" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
<?php for ($i = $page + 1; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i): ?>
<li class="page-item page-<?= $i - $page ?>">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
<img src="./assets/page-body.png" />
<div class="page-link-text"><?= $i ?></div>
</a>
</li>
<?php endfor ?>
<?php if ($page < $pages_max): ?>
<li class="page-item">
<a class="page-link no-wrap" href="#" onclick="Script.jumpTo (<?= $pages_max ?>)">&gt;|</a>
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $pages_max ?>)">
<img src="./assets/page-last.png" />
<div class="page-link-text">&gt;|</div>
</a>
</li>
<?php else: ?>
<li class="page-item disabled">
<span class="page-link">&gt;|</span>
<span class="page-link">
<img src="./assets/page-last.png" />
<div class="page-link-text"></div>
</span>
</li>
<?php endif ?>
</ul>
+45
ファイルの表示
@@ -63,6 +63,35 @@ Script
btnFilter.addEventListener ('click', filter);
$ ('#btn-reset').on ('click', resetFilter);
$ (window).resize (this.setPagination);
this.setPagination ();
$ ('.pagination').removeClass ('opacity-0');
$ ('#accordion-filter').on ('shown.bs.collapse', function ()
{
$.cookie ('expand-filter', '1');
});
$ ('#accordion-filter').on ('hidden.bs.collapse', function ()
{
$.cookie ('expand-filter', '0');
});
$ ('.message-block').on ('click', function ()
{
const dt = $ (this).find ('.message-block-dt').text ();
const chat = $ (this).find ('.message-block-chat').text ();
const answer = $ (this).find ('.message-block-answer').text ();
window.open (`./talk.php?dt=${dt}&chat=${chat}&answer=${answer}`);
});
if ($.cookie ('expand-filter') === '0')
{
$ ('#collapse-filter').removeClass ('show');
$ ('#accordion-filter .accordion-button').addClass ('collapsed');
}
}
static
@@ -75,6 +104,22 @@ Script
window.location.href = url;
}
static
setPagination ()
{
for (let i = 1; i <= 20; ++i)
$ (`.page-${i}`).removeClass ('d-none');
for (let i = 20; i > 1; --i)
{
if (($ ('.pagination').width () < $ ('body').width () * .8)
&& ($ ('.page-item:not(.d-none)').length / 2 % 2 != 0))
break;
$ (`.page-${i}`).addClass ('d-none');
}
}
}
+49
ファイルの表示
@@ -1,3 +1,5 @@
/* vim:set tabstop=2 softtabstop=2 expandtab :*/
.container-max-width
{
max-width: 1600px;
@@ -22,5 +24,52 @@
{
width: 3.5em;
text-align: center;
vertical-align: middle;
margin: 0;
padding: 0;
}
.page-link
{
color: black;
padding: 0;
margin: 0;
border: none;
margin-right: -3px;
}
.page-item.active > .page-link
{
font-weight: bold;
font-size: 150%;
}
.page-item.disabled > .page-link
{
color: lightgray;
}
.page-link-text
{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -48%);
padding: 0;
margin: 0;
}
.pagination
{
--bs-pagination-bg: none;
--bs-pagination-disabled-bg: none;
--bs-pagination-hover-bg: none;
--bs-pagination-active-color: none;
--bs-pagination-active-bg: none;
}
.deerjika-tail
{
z-index: 1024;
}
+32
ファイルの表示
@@ -0,0 +1,32 @@
/* vim:set tabstop=2 softtabstop=2 expandtab :*/
@font-face
{
font-family: 'Nikumaru';
src: url(./assets/nikumaru.otf);
}
html, body
{
overflow: hidden;
}
body
{
background-color: black;
}
#canvas
{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: unset;
border: none
!important;
outline: none
!important;
display: block;
}
+23
ファイルの表示
@@ -0,0 +1,23 @@
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="./talk.css?<?= filemtime ('./talk.css') ?>" />
<link rel="preconnect" href="./assets/nikumaru.otf" />
<title>あほ</title>
<input type="hidden" id="dt" value="<?= $dt ?>" />
<input type="hidden" id="chat" value="<?= $chat ?>" />
<input type="hidden" id="answer" value="<?= $answer ?>" />
</head>
<body>
<canvas id="canvas"></canvas>
<script src="./talk.js?<?= filemtime ('./talk.js') ?>" type="module"></script>
</body>
</html>
+136
ファイルの表示
@@ -0,0 +1,136 @@
import CommonModule from './common_module.js';
class
Talk
{
static
main ()
{
const canvas = new Canvas;
window.onresize = () => canvas.resize ();
}
}
class
Canvas
{
constructor ()
{
this.canvas = $ ('#canvas');
this.ctx = this.canvas[0].getContext ('2d');
(this.bg = new Image ()).src = './assets/bg.jpg';
this.bg.onload = () => this.resize ();
(this.nizika = new Image ()).src = './assets/nizika.png';
this.nizika.onload = () => this.resize ();
(this.talking = new Image ()).src = './assets/talking.png';
this.talking.onload = () => this.resize ();
(new FontFace ('Nikumaru', 'url(./assets/nikumaru.otf)')).load ().then (
() => this.resize ());
}
resize ()
{
this.canvas[0].width = $ (window).width ();
this.canvas[0].height = $ (window).height ();
this.redraw ();
}
redraw ()
{
this.putBG ();
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,
('> ' + ((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,
((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 ()
{
const [x, y, zoom] = this.convertPosition (0, 0);
const width = this.bg.height * 4 / 3;
const height = this.bg.height;
this.ctx.drawImage (this.bg,
(852 - 640) / 2, 0, width, height,
x, y, width * zoom, height * zoom);
}
putImage (image, x, y, zoom = 1)
{
let zoom2
[x, y, zoom2] = this.convertPosition (x, y);
zoom *= zoom2
this.ctx.drawImage (image,
0, 0, image.width, image.height,
x, y, image.width * zoom, image.height * zoom);
}
putText (x, y, size, text, style = 'sans-serif', colour = 'black',
italic = false)
{
let zoom;
[x, y, zoom] = this.convertPosition (x, y);
size *= zoom;
this.ctx.font = `${italic ? 'italic ' : ''}${Math.trunc (size)}px ${style}`;
this.ctx.fillStyle = colour;
this.ctx.textBaseline = 'top';
this.ctx.fillText (text, x, y);
}
convertPosition (x, y)
{
const sizeX = this.canvas.width ();
const sizeY = this.canvas.height ();
const width = this.bg.height * 4 / 3;
const height = this.bg.height;
const vertical = sizeY / sizeX > height / width;
const zoom = vertical ? (sizeX / width) : (sizeY / height);
const baseX = vertical ? 0 : ((sizeX - width * zoom) / 2);
const baseY = vertical ? ((sizeY - height * zoom) / 2) : 0;
return [baseX + x * zoom, baseY + y * zoom, zoom];
}
}
$ (() => Talk.main ());
+11
ファイルの表示
@@ -0,0 +1,11 @@
<?php
if ($_SERVER['HTTP_HOST'] === 'nizika.monster')
header ('location: //nizika.tv/talk.php');
$dt = htmlspecialchars ($_GET['dt']);
$chat = htmlspecialchars ($_GET['chat']);
$answer = htmlspecialchars ($_GET['answer']);
require_once './talk.frm.php';
+3
ファイルの表示
@@ -0,0 +1,3 @@
<?php
exec ('git pull');