コミットを比較
31 コミット
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
| 3e97e3c4f4 | |||
| b9c990d6b5 | |||
| 506c29a32d | |||
| 535e44c4e7 | |||
| ba39be8551 | |||
| d50e23172b | |||
| 0a1e46dd37 | |||
| 2fba77b89f | |||
| b447c96d2e | |||
| 4cae005dfe | |||
| 101ca991a8 | |||
| 82d366de79 | |||
| 4c7a0dbe59 | |||
| 12af789385 | |||
| b0823f7766 | |||
| 96a3ff125b | |||
| 46b231c6ac | |||
| 2df0e1d9f5 | |||
| cbb64ddcf1 | |||
| d55800ec71 | |||
| 19227ca93c | |||
| c420858e9a | |||
| 57b261a751 | |||
| 036656469e | |||
| 2a33a74153 | |||
| 1cc8ffe594 | |||
| 7de05c2af5 | |||
| a99b730397 | |||
| 396ad28cdf | |||
| 88bba81cd6 | |||
| e64d0eb790 |
@@ -1,2 +1,3 @@
|
|||||||
/log.txt
|
/log.txt
|
||||||
|
/log2.txt
|
||||||
|
|
||||||
|
|||||||
実行可能ファイル
バイナリ
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 450 KiB |
バイナリファイルは表示されません.
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 40 KiB |
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 1.0 KiB |
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 3.1 KiB |
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 9.3 KiB |
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 42 KiB |
@@ -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 |
+57
-24
@@ -1,3 +1,5 @@
|
|||||||
|
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ja">
|
<html lang="ja">
|
||||||
<head>
|
<head>
|
||||||
@@ -5,19 +7,32 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<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/jquery-3.3.1.min.js"></script>
|
||||||
<script src="//code.jquery.com/ui/1.12.0/jquery-ui.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>
|
<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 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 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>
|
<title>伊地知ニジカ放送局 - ニジカ返答ログ</title>
|
||||||
|
<?php endif ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<?php if (!($available)): ?>
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<strong>【警報】</strong>AIニジカが落ちてるぬ゛〜゛ん゛(泣)
|
||||||
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<div class="container my-5">
|
<div class="container my-5">
|
||||||
<div class="accordion mb-5" id="accordion-filter">
|
<div class="accordion mb-5" id="accordion-filter">
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header">
|
<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>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
@@ -26,11 +41,13 @@
|
|||||||
<div class="accordion-body mx-5">
|
<div class="accordion-body mx-5">
|
||||||
<div>
|
<div>
|
||||||
<div class="row d-flex align-items-center my-2">
|
<div class="row d-flex align-items-center my-2">
|
||||||
<div class="col-4 fw-bold">
|
<div class="col-sm-4 fw-bold">
|
||||||
順序
|
順序
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-3 form-check">
|
<div class="col-sm">
|
||||||
|
<div class="row align-items-center">
|
||||||
|
<div class="col form-check">
|
||||||
<input class="form-check-input" type="radio" name="order" id="order-desc"<?= $asc ? '' : ' checked="checked"' ?> />
|
<input class="form-check-input" type="radio" name="order" id="order-desc"<?= $asc ? '' : ' checked="checked"' ?> />
|
||||||
|
|
||||||
<label class="form-check-label" for="order-desc">
|
<label class="form-check-label" for="order-desc">
|
||||||
@@ -38,7 +55,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-3 form-check">
|
<div class="col form-check">
|
||||||
<input class="form-check-input" type="radio" name="order" id="order-asc"<?= $asc ? ' checked="checked"' : '' ?> />
|
<input class="form-check-input" type="radio" name="order" id="order-asc"<?= $asc ? ' checked="checked"' : '' ?> />
|
||||||
|
|
||||||
<label class="form-check-label" for="order-asc">
|
<label class="form-check-label" for="order-asc">
|
||||||
@@ -46,39 +63,54 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row d-flex align-items-center my-2">
|
|
||||||
<div class="col-4 fw-bold">
|
|
||||||
日時ニジカ
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col input-group">
|
<div class="row d-flex align-items-center my-2">
|
||||||
<input type="text" class="form-control" placeholder="YYYY-MM-DD" id="filter-date-start"
|
<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"
|
||||||
value="<?= $date_start ?>" />
|
value="<?= $date_start ?>" />
|
||||||
<span class="input-group-text">〜</span>
|
<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 ?>" />
|
value="<?= $date_end ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row d-flex align-items-center my-2">
|
<div class="row d-flex align-items-center my-2">
|
||||||
<div class="col-4 fw-bold">
|
<div class="col-sm-4 fw-bold">
|
||||||
フリーワード
|
フリーワード
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col">
|
<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 ?>"/>
|
value="<?= $keyword ?>"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-3 row">
|
<div class="mt-3 row">
|
||||||
<div class="col gap-2 d-grid">
|
<div class="col-sm gap-2 d-grid my-1">
|
||||||
<button type="button" class="btn btn-secondary" id="btn-reset">元に戻す</button>
|
<button type="button" class="btn btn-secondary" id="btn-reset">元に戻す</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col gap-2 d-grid">
|
<div class="col-sm gap-2 d-grid my-1">
|
||||||
<button type="button" class="btn btn-primary" id="btn-filter">絞り込む</button>
|
<button type="button" class="btn btn-primary" id="btn-filter">絞り込む</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,23 +128,24 @@
|
|||||||
<?php foreach (array_slice ($log_data,
|
<?php foreach (array_slice ($log_data,
|
||||||
($page - 1) * $length,
|
($page - 1) * $length,
|
||||||
$length,
|
$length,
|
||||||
true) as $record): ?>
|
true)
|
||||||
<div class="mb-4">
|
as $record): ?>
|
||||||
|
<div class="mb-4 message-block">
|
||||||
<div>
|
<div>
|
||||||
<?= $record['date_time'] ?>
|
<span class="message-block-dt"><?= $record['date_time'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<img src="<?= $record['chat_icon'] ?>" />
|
<img src="<?= $record['chat_icon'] ?>" width="64" height="64" />
|
||||||
<?= $record['chat_name'] ?>
|
<?= $record['chat_name'] ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="color: blue">
|
<div style="color: blue">
|
||||||
> <span style="font-style: italic"><?= $record['chat_message'] ?></span>
|
> <span class="message-block-chat" style="font-style: italic"><?= $record['chat_message'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<?= $record['answer'] ?>
|
<span class="message-block-answer"><?= $record['answer'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
@@ -127,7 +160,7 @@
|
|||||||
</div>
|
</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="//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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -7,10 +7,16 @@ const LOG_PATH = './log.txt';
|
|||||||
|
|
||||||
$log_data = [];
|
$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);
|
$page = (int) ($_GET['p'] ?? 1);
|
||||||
$length = (int) ($_GET['max'] ?? 20);
|
$length = (int) ($_GET['max'] ?? 20);
|
||||||
$asc = ($_GET['asc'] ?? 0) != 0;
|
$asc = ($_GET['asc'] ?? 0) != 0;
|
||||||
$keyword = trim ($_GET['q'] ?? '');
|
$keyword = trim ($_GET['q'] ?? '');
|
||||||
|
$escaped = ($_GET['escaped'] ?? 0) != 0;
|
||||||
|
|
||||||
$date_start = ($_GET['start'] ?? null) ?: null;
|
$date_start = ($_GET['start'] ?? null) ?: null;
|
||||||
$date_end = ($_GET['end'] ?? null) ?: null;
|
$date_end = ($_GET['end'] ?? null) ?: null;
|
||||||
@@ -25,9 +31,9 @@ if ($f !== false)
|
|||||||
|
|
||||||
$log_data[] = ['date_time' => $dt[0],
|
$log_data[] = ['date_time' => $dt[0],
|
||||||
'chat_icon' => $chat_info -> author -> imageUrl,
|
'chat_icon' => $chat_info -> author -> imageUrl,
|
||||||
'chat_name' => $chat_info -> author -> name,
|
'chat_name' => $escaped ? htmlspecialchars ($chat_info -> author -> name) : $chat_info -> author -> name,
|
||||||
'chat_message' => $chat_info -> message,
|
'chat_message' => $escaped ? htmlspecialchars ($chat_info -> message) : $chat_info -> message,
|
||||||
'answer' => $dt[2]];
|
'answer' => $escaped ? htmlspecialchars ($dt[2]) : $dt[2]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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))}});
|
||||||
+39
-16
@@ -1,40 +1,63 @@
|
|||||||
<nav class="d-flex justify-content-center" aria-label="...">
|
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
|
||||||
<ul class="pagination">
|
|
||||||
|
<nav class="d-flex justify-content-center" aria-label="...">
|
||||||
|
<ul class="pagination opacity-0">
|
||||||
<?php if ($page > 1): ?>
|
<?php if ($page > 1): ?>
|
||||||
<li class="page-item">
|
<li class="page-item deerjika-tail">
|
||||||
<a class="page-link no-wrap" href="#" onclick="Script.jumpTo (1)">|<</a>
|
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (1)">
|
||||||
|
<img src="./assets/page-first.png" />
|
||||||
|
<div class="page-link-text">|<</div>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled deerjika-tail">
|
||||||
<span class="page-link">|<</span>
|
<span class="page-link">
|
||||||
|
<img src="./assets/page-first.png" />
|
||||||
|
<div class="page-link-text"></div>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php for ($i = max (min ($page + 2, $pages_max) - 4, 1); $i < $page; ++$i): ?>
|
<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?>
|
||||||
<li class="page-item">
|
<li class="page-item page-<?= $page - $i ?>">
|
||||||
<a class="page-link" href="#" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
|
<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>
|
</li>
|
||||||
<?php endfor ?>
|
<?php endfor ?>
|
||||||
|
|
||||||
<li class="page-item active" aria-current="page">
|
<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>
|
</li>
|
||||||
|
|
||||||
<?php for ($i = $page + 1; $i <= min (max ($page - 2, 1) + 4, $pages_max); ++$i): ?>
|
<?php for ($i = $page + 1; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i): ?>
|
||||||
<li class="page-item">
|
<li class="page-item page-<?= $i - $page ?>">
|
||||||
<a class="page-link" href="#" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
|
<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>
|
</li>
|
||||||
<?php endfor ?>
|
<?php endfor ?>
|
||||||
|
|
||||||
<?php if ($page < $pages_max): ?>
|
<?php if ($page < $pages_max): ?>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link no-wrap" href="#" onclick="Script.jumpTo (<?= $pages_max ?>)">>|</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">>|</div>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<span class="page-link">>|</span>
|
<span class="page-link">
|
||||||
|
<img src="./assets/page-last.png" />
|
||||||
|
<div class="page-link-text"></div>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,35 @@ Script
|
|||||||
|
|
||||||
btnFilter.addEventListener ('click', filter);
|
btnFilter.addEventListener ('click', filter);
|
||||||
$ ('#btn-reset').on ('click', resetFilter);
|
$ ('#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
|
static
|
||||||
@@ -75,6 +104,22 @@ Script
|
|||||||
|
|
||||||
window.location.href = url;
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* vim:set tabstop=2 softtabstop=2 expandtab :*/
|
||||||
|
|
||||||
.container-max-width
|
.container-max-width
|
||||||
{
|
{
|
||||||
max-width: 1600px;
|
max-width: 1600px;
|
||||||
@@ -22,5 +24,52 @@
|
|||||||
{
|
{
|
||||||
width: 3.5em;
|
width: 3.5em;
|
||||||
text-align: center;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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 ());
|
||||||
|
|
||||||
@@ -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';
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
exec ('git pull');
|
||||||
|
|
||||||
新しい課題から参照
ユーザをブロックする