Greasy Fork is available in English.
arcalive 게시글의 이미지를 미리보여줍니다.
当前为
// ==UserScript==
// @name arcalive 이미지 미리보기
// @namespace http://tampermonkey.net/
// @version 0.23
// @description arcalive 게시글의 이미지를 미리보여줍니다.
// @author You
// @match https://arca.live/b/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=arca.live
// @grant none
// @license MIT
// @require https://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==
//'use strict';
const pose = '제목';
function moveImageWithMark(title, mark, image){
let dest;
const brTag=document.createElement('br');
switch (pose)
{
case '제목':
dest = title.children[1];
dest.append(brTag, image);
dest.prepend(mark);
break;
case '날짜':
dest = title.parentElement.parentElement.children[1].children[1];
dest.prepend(image);
break;
}
}
(function() {
const vrowPrevs=document.querySelectorAll('.vrow-preview');
for (const vrowPrev of vrowPrevs)
{
const image = vrowPrev.children[0];
image.style.width ='100px'; // 혹시나 이미지크기가 이상할경우대비 100px로.
const vrowInner = vrowPrev.parentElement.children[0];
const vrowTop = vrowInner.children[0];
const title = vrowTop.children[1];
const mark=title.children[0];
let dest;
moveImageWithMark(title, mark, image);
vrowPrev.style.display = 'none';
}
vrowPrevs.forEach(vrowPrev=>{vrowPrev.display='none'}); //원래프리뷰 가리기.
const articleList = document.querySelector('.article-list');
const articles=articleList.querySelectorAll('a.vrow.column');
articles.forEach(article=>{article.style='height: auto !important'});
const vrowBottoms = document.querySelectorAll('.vrow-bottom');
for (const vrowBottom of vrowBottoms)
{
for (const v of vrowBottom.children)
{
v.style.display='flex';
v.style['align-items']='center';
v.style['flex-direction']='column';
v.style['justify-content']='center';
v.style['align-content']='center';
}
}
}
)();