コミットを比較
18 コミット
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
| 3e97e3c4f4 | |||
| b9c990d6b5 | |||
| 506c29a32d | |||
| 535e44c4e7 | |||
| ba39be8551 | |||
| d50e23172b | |||
| 0a1e46dd37 | |||
| 2fba77b89f | |||
| b447c96d2e | |||
| 4cae005dfe | |||
| 101ca991a8 | |||
| 82d366de79 | |||
| 4c7a0dbe59 | |||
| 12af789385 | |||
| b0823f7766 | |||
| 96a3ff125b | |||
| 46b231c6ac | |||
| 2df0e1d9f5 |
実行可能ファイル
バイナリ
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 450 KiB |
バイナリファイルは表示されません.
バイナリファイルは表示されません.
|
変更後 幅: | 高さ: | サイズ: 40 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+26
-9
@@ -1,3 +1,5 @@
|
|||||||
|
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ja">
|
<html lang="ja">
|
||||||
<head>
|
<head>
|
||||||
@@ -9,7 +11,7 @@
|
|||||||
<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 $april_fool = ((int) date ('n') === 4) && ((int) date ('j') === 1) ?>
|
||||||
<?php if ($april_fool): ?>
|
<?php if ($april_fool): ?>
|
||||||
<link rel="icon" href="favicon-goatoh.ico" />
|
<link rel="icon" href="favicon-goatoh.ico" />
|
||||||
@@ -20,6 +22,12 @@
|
|||||||
</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">
|
||||||
@@ -68,10 +76,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm input-group">
|
<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 ?>" />
|
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>
|
||||||
@@ -82,7 +96,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<input type="text" class="form-control" placeholder="<?= $april_fool ? 'ムムムム!! クサタベテル!!!!!' : 'ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛' ?>" id="filter-keyword"
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="<?= $april_fool ? 'ムムムム!! クサタベテル!!!!!' : 'ぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛' ?>"
|
||||||
|
id="filter-keyword"
|
||||||
value="<?= $keyword ?>"/>
|
value="<?= $keyword ?>"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -113,9 +130,9 @@
|
|||||||
$length,
|
$length,
|
||||||
true)
|
true)
|
||||||
as $record): ?>
|
as $record): ?>
|
||||||
<div class="mb-4">
|
<div class="mb-4 message-block">
|
||||||
<div>
|
<div>
|
||||||
<?= $record['date_time'] ?>
|
<span class="message-block-dt"><?= $record['date_time'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -124,11 +141,11 @@
|
|||||||
</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 ?>
|
||||||
@@ -143,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>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ 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;
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
|
<!-- vim:set tabstop=4 softtabstop=4 expandtab :-->
|
||||||
|
|
||||||
<nav class="d-flex justify-content-center" aria-label="...">
|
<nav class="d-flex justify-content-center" aria-label="...">
|
||||||
<ul class="pagination opacity-0">
|
<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" href="javascript: void (0)" onclick="Script.jumpTo (1)">
|
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (1)">
|
||||||
<img src="./assets/page-first.png" />|<
|
<img src="./assets/page-first.png" />
|
||||||
|
<div class="page-link-text">|<</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled deerjika-tail">
|
||||||
<span class="page-link">
|
<span class="page-link">
|
||||||
<img src="./assets/page-first.png" />|<
|
<img src="./assets/page-first.png" />
|
||||||
|
<div class="page-link-text"></div>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
@@ -17,19 +21,24 @@
|
|||||||
<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?>
|
<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?>
|
||||||
<li class="page-item page-<?= $page - $i ?>">
|
<li class="page-item page-<?= $page - $i ?>">
|
||||||
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
|
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
|
||||||
<img src="./assets/page-body.png" /><?= $i ?>
|
<img src="./assets/page-body.png" />
|
||||||
|
<div class="page-link-text"><?= $i ?></div>
|
||||||
</a>
|
</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"><img src="./assets/page-body.png" /><?= $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 - 10, 1) + 20, $pages_max); ++$i): ?>
|
<?php for ($i = $page + 1; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i): ?>
|
||||||
<li class="page-item page-<?= $i - $page ?>">
|
<li class="page-item page-<?= $i - $page ?>">
|
||||||
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
|
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)">
|
||||||
<img src="./assets/page-body.png" /><?= $i ?>
|
<img src="./assets/page-body.png" />
|
||||||
|
<div class="page-link-text"><?= $i ?></div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endfor ?>
|
<?php endfor ?>
|
||||||
@@ -37,12 +46,16 @@
|
|||||||
<?php if ($page < $pages_max): ?>
|
<?php if ($page < $pages_max): ?>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $pages_max ?>)">
|
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $pages_max ?>)">
|
||||||
<img src="./assets/page-last.png" />>|
|
<img src="./assets/page-last.png" />
|
||||||
|
<div class="page-link-text">>|</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<span class="page-link"><img src="./assets/page-last.png" />>|</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>
|
||||||
|
|||||||
@@ -78,6 +78,15 @@ Script
|
|||||||
$.cookie ('expand-filter', '0');
|
$.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')
|
if ($.cookie ('expand-filter') === '0')
|
||||||
{
|
{
|
||||||
$ ('#collapse-filter').removeClass ('show');
|
$ ('#collapse-filter').removeClass ('show');
|
||||||
|
|||||||
+47
-9
@@ -1,3 +1,5 @@
|
|||||||
|
/* vim:set tabstop=2 softtabstop=2 expandtab :*/
|
||||||
|
|
||||||
.container-max-width
|
.container-max-width
|
||||||
{
|
{
|
||||||
max-width: 1600px;
|
max-width: 1600px;
|
||||||
@@ -18,20 +20,56 @@
|
|||||||
max-width: 6px;
|
max-width: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-item
|
.page-item
|
||||||
{
|
{
|
||||||
width: 3.5em;
|
width: 3.5em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-item:not(:not(.disabled, .active)) img
|
.page-link
|
||||||
{
|
{
|
||||||
filter: invert(100%);
|
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');
|
||||||
|
|
||||||
新しい課題から参照
ユーザをブロックする