From 78719112d0116114e4664ccc1328d7f0b20000f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Thu, 16 Dec 2021 16:16:20 +0900 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E7=94=9F=E3=83=AA=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Peertube/Channel.php | 6 +- public/css/peertube/channel.css | 100 ++++++++++++++++++ .../techsuwa/component/peertube/c.blade.php | 2 +- .../peertube/parts/c/links.blade.php | 4 +- .../peertube/parts/c/playlists.blade.php | 30 ++++++ 5 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 resources/views/theme/techsuwa/component/peertube/parts/c/playlists.blade.php diff --git a/app/Http/Controllers/Peertube/Channel.php b/app/Http/Controllers/Peertube/Channel.php index bd2f2fd..aef507f 100644 --- a/app/Http/Controllers/Peertube/Channel.php +++ b/app/Http/Controllers/Peertube/Channel.php @@ -24,7 +24,7 @@ class Channel extends Common { 'userinfo' => $this->common->user, ]; $res['channel'] = $this->getChannel($id); - $res['video'] = $this->getVideo($id, ($page*$this->count), $this->count); + $res['video'] = $cat == 'video-playlists' ? $this->getPlaylist($id, ($page*$this->count), $this->count) : $this->getVideo($id, ($page*$this->count), $this->count); $res['pagetotal'] = $res['video']->total; return view('pages.peertube.c', ['res' => $res]); } @@ -36,4 +36,8 @@ class Channel extends Common { function getVideo ($id, $start, $count) { return $this->ptapi_get('/api/v1/video-channels/'.$id.'/videos?start='.$start.'&count='.$count.'&sort=-publishedAt&skipCount=false&nsfw=both'); } + + function getPlaylist ($id, $start, $count) { + return $this->ptapi_get('/api/v1/video-channels/'.$id.'/video-playlists?start='.$start.'&count='.$count); + } } diff --git a/public/css/peertube/channel.css b/public/css/peertube/channel.css index 29ae497..036392a 100644 --- a/public/css/peertube/channel.css +++ b/public/css/peertube/channel.css @@ -632,4 +632,104 @@ my-actor-avatar { .video-info-privacy, .video-info-blocked .blocked-label, .video-info-nsfw { font-weight: 600; +} + +.miniature:not(.display-as-row) .miniature-thumbnail { + position: relative; + height: 0; + width: 100%; + padding-top: 56.25%; + margin-top: 10px; + margin-bottom: 5px; +} + +.miniature-thumbnail { + display: flex; + flex-direction: column; + position: relative; + border-radius: 3px; + width: 100%; + height: 100%; + overflow: hidden; + background-color: #ececec; + transition: filter .2s ease; +} + +.miniature:not(.display-as-row) .miniature-thumbnail a { + position: absolute; + width: 100%; + height: 100%; + top: 0; +} + +.miniature-thumbnail img { + width: inherit; + height: inherit; +} + +.miniature-thumbnail .miniature-playlist-info-overlay { + display: inline-block; + background-color: #000000b3; + color: #fff; + position: absolute; + right: 0; + bottom: 0; + height: 100%; + padding: 0 10px; + display: flex; + align-items: center; + font-size: 14px; + font-weight: 600; +} + +.miniature-thumbnail .play-overlay, .miniature-thumbnail .play-overlay .icon { + transition: all .2s ease; +} + +.miniature-thumbnail .play-overlay { + position: absolute; + right: 0; + bottom: 0; + width: inherit; + height: inherit; + opacity: 0; + background-color: #0000004d; +} + +.miniature-thumbnail .play-overlay .icon { + width: 0; + height: 0; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%) scale(.5); + border-top: 13px solid transparent; + border-bottom: 13px solid transparent; + border-left: 18px solid rgba(255,255,255,.95); +} + +.miniature-thumbnail .play-overlay, .miniature-thumbnail .play-overlay .icon { + transition: all .2s ease; +} + +.miniature:not(.display-as-row) .miniature-name { + margin-top: 10px; + margin-bottom: 5px; +} + +.miniature-info .miniature-name { + display: block; + display: -webkit-box; + -webkit-line-clamp: 2; + font-size: 1.1em; + line-height: 1.1em; + overflow: hidden; + text-overflow: ellipsis; + max-height: 2.2em; + word-break: break-word; + word-wrap: break-word; + overflow-wrap: break-word; + transition: color .2s; + font-weight: 600; + color: var(--mainForegroundColor); } \ No newline at end of file diff --git a/resources/views/theme/techsuwa/component/peertube/c.blade.php b/resources/views/theme/techsuwa/component/peertube/c.blade.php index 3f49848..9d320be 100644 --- a/resources/views/theme/techsuwa/component/peertube/c.blade.php +++ b/resources/views/theme/techsuwa/component/peertube/c.blade.php @@ -1,5 +1,5 @@
@include('theme.'.env('THEME').'.component.peertube.parts.c.head') @include('theme.'.env('THEME').'.component.peertube.parts.c.links') - @include('theme.'.env('THEME').'.component.peertube.parts.c.videos') + @include('theme.'.env('THEME').'.component.peertube.parts.c.'.($res['cat'] == 'video-playlists' ? 'playlists' : 'videos'))
\ No newline at end of file diff --git a/resources/views/theme/techsuwa/component/peertube/parts/c/links.blade.php b/resources/views/theme/techsuwa/component/peertube/parts/c/links.blade.php index 98d07d6..ef4e108 100644 --- a/resources/views/theme/techsuwa/component/peertube/parts/c/links.blade.php +++ b/resources/views/theme/techsuwa/component/peertube/parts/c/links.blade.php @@ -2,10 +2,10 @@ diff --git a/resources/views/theme/techsuwa/component/peertube/parts/c/playlists.blade.php b/resources/views/theme/techsuwa/component/peertube/parts/c/playlists.blade.php new file mode 100644 index 0000000..3b6361d --- /dev/null +++ b/resources/views/theme/techsuwa/component/peertube/parts/c/playlists.blade.php @@ -0,0 +1,30 @@ +
+
再生リスト数:{{ $res['video']->total }}
+
+ @foreach ($res['video']->data as $v) +
+ +
+ + + +
動画数:{{ $v->videosLength }}
+
+
+
+
+
+
+ + {{ $v->displayName }} + +
+ 最新更新: {{ date('Y年m月d日', strtotime($v->updatedAt)) }} +
+
+
+
+
+ @endforeach +
+
\ No newline at end of file