定型文・コア
by
cutfloss
05/01 [2026/05/01 13:11:50]
6連ボタン対応の完璧版
@@ -1,6 +1,6 @@
/*
- * @title 陣取り司令官コア:左パネル整列版
- * @description 重なりを解消し、左パネルを綺麗に横並びにする
+ * @title 陣取り司令官コア:外枠フィット版
+ * @description 右側の会話タブの外枠が小さくなる問題を修正
* @private
*/
(function(){
@@ -27,20 +27,30 @@
/* 共通設定 */
.j-box { background:rgba(10,20,40,0.92); border:2px solid #3b82f6; border-radius:5px; padding:5px; z-index:99999; pointer-events:auto; color:#fff; box-sizing:border-box; }
- /* 左パネル:サイズと浮き具合を固定 */
+ /* 左パネル:サイズ固定 */
.j-left-box {
- position: relative !important; /* 親(l)の中で並ぶためstaticに近い挙動に */
+ position: relative !important;
width: 200px !important;
height: 180px !important;
overflow-y: auto !important;
font-size: 11px;
}
+ /* 右パネル(会話):中身に合わせて広がるように */
+ .j-right-box {
+ position: fixed !important;
+ right: 100px;
+ bottom: 20px;
+ width: auto !important; /* 幅を自動に */
+ min-width: 270px; /* 最低限の幅を確保 */
+ }
+
.j-btn-side { position:fixed; right:10px; top:50%; transform:translateY(-50%); display:flex; flex-direction:column; gap:12px; z-index:100000; pointer-events:auto; }
.j-btn-round { width:75px; height:75px; background:#2563eb; color:#fff; border:2px solid #93c5fd; border-radius:50%; cursor:pointer; font-size:14px; font-weight:bold; }
+ /* 本家パーツの表示設定 */
#tc-panel-team, #tc-panel-log { display:block !important; width:100% !important; height:auto !important; position:static !important; }
- #tc-panel-chat { display:block !important; width:260px; position:fixed; right:100px; bottom:20px; }
+ #tc-panel-chat { display:block !important; width:100% !important; visibility:visible !important; position:static !important; }
#team-chat-messages { height:220px !important; }
`;
document.head.appendChild(style);
@@ -61,19 +71,17 @@
});
root.appendChild(sBtnArea);
- // --- 右側:会話 ---
- const r = document.createElement('div'); r.className = 'j-box';
- r.id = 'tc-panel-chat'; // スタイル適用のためID付与
- r.appendChild(chat); root.appendChild(r);
+ // --- 右側:会話(クラスを変更) ---
+ const r = document.createElement('div');
+ r.className = 'j-box j-right-box';
+ r.appendChild(chat);
+ root.appendChild(r);
- // --- 左側:状況 + 戦歴(横並びコンテナ) ---
+ // --- 左側:状況 + 戦歴 ---
const l = document.createElement('div');
- // ここで position:fixed を使い、コンテナ全体を浮かせます
l.style.cssText = 'position:fixed; left:20px; bottom:30px; display:flex; gap:10px; pointer-events:auto; z-index:99999;';
-
const p1 = document.createElement('div'); p1.className='j-box j-left-box'; p1.appendChild(team);
const p2 = document.createElement('div'); p2.className='j-box j-left-box'; p2.appendChild(log);
-
l.appendChild(p1); l.appendChild(p2); root.appendChild(l);
const orig = $id('team-chat'); if(orig) orig.style.visibility='hidden';
/*
* @title 陣取り司令官コア:外枠フィット版
* @description 右側の会話タブの外枠が小さくなる問題を修正
* @private
*/
(function(){
const $id = (id)=>document.getElementById(id);
let chat = $id('tc-panel-chat'), team = $id('tc-panel-team'), log = $id('tc-panel-log');
if(!chat) {
const oldRoot = $id('j-all');
if(oldRoot) {
chat = oldRoot.querySelector('#tc-panel-chat');
team = oldRoot.querySelector('#tc-panel-team');
log = oldRoot.querySelector('#tc-panel-log');
}
}
if(!chat) return console.log("パネル未検出");
const old = $id('j-all'); if(old) old.remove();
const saved = localStorage.getItem('j-phrases');
const phrases = saved ? JSON.parse(saved) : ['攻めましょう!', '守備!', '援護!', '感謝!'];
const style = document.createElement('style');
style.innerHTML = `
/* 共通設定 */
.j-box { background:rgba(10,20,40,0.92); border:2px solid #3b82f6; border-radius:5px; padding:5px; z-index:99999; pointer-events:auto; color:#fff; box-sizing:border-box; }
/* 左パネル:サイズ固定 */
.j-left-box {
position: relative !important;
width: 200px !important;
height: 180px !important;
overflow-y: auto !important;
font-size: 11px;
}
/* 右パネル(会話):中身に合わせて広がるように */
.j-right-box {
position: fixed !important;
right: 100px;
bottom: 20px;
width: auto !important; /* 幅を自動に */
min-width: 270px; /* 最低限の幅を確保 */
}
.j-btn-side { position:fixed; right:10px; top:50%; transform:translateY(-50%); display:flex; flex-direction:column; gap:12px; z-index:100000; pointer-events:auto; }
.j-btn-round { width:75px; height:75px; background:#2563eb; color:#fff; border:2px solid #93c5fd; border-radius:50%; cursor:pointer; font-size:14px; font-weight:bold; }
/* 本家パーツの表示設定 */
#tc-panel-team, #tc-panel-log { display:block !important; width:100% !important; height:auto !important; position:static !important; }
#tc-panel-chat { display:block !important; width:100% !important; visibility:visible !important; position:static !important; }
#team-chat-messages { height:220px !important; }
`;
document.head.appendChild(style);
const root = document.createElement('div');
root.id = 'j-all';
root.style.cssText = 'position:fixed; top:0; left:0; width:100vw; height:100vh; pointer-events:none; z-index:99999;';
document.body.appendChild(root);
// --- 右側:ボタン ---
const sBtnArea = document.createElement('div');
sBtnArea.className = 'j-btn-side';
phrases.forEach((msg) => {
const b = document.createElement('button'); b.className='j-btn-round';
b.innerText = msg.substring(0, 3);
b.onclick=()=>{ const i=$id('team-chat-input'); if(i){i.value=msg; sendTeamChat();} };
sBtnArea.appendChild(b);
});
root.appendChild(sBtnArea);
// --- 右側:会話(クラスを変更) ---
const r = document.createElement('div');
r.className = 'j-box j-right-box';
r.appendChild(chat);
root.appendChild(r);
// --- 左側:状況 + 戦歴 ---
const l = document.createElement('div');
l.style.cssText = 'position:fixed; left:20px; bottom:30px; display:flex; gap:10px; pointer-events:auto; z-index:99999;';
const p1 = document.createElement('div'); p1.className='j-box j-left-box'; p1.appendChild(team);
const p2 = document.createElement('div'); p2.className='j-box j-left-box'; p2.appendChild(log);
l.appendChild(p1); l.appendChild(p2); root.appendChild(l);
const orig = $id('team-chat'); if(orig) orig.style.visibility='hidden';
if(!window.jTimer) {
window.jTimer = setInterval(()=>{
if(typeof refreshTeamStats==='function') refreshTeamStats();
if(typeof renderBattleLog==='function') renderBattleLog();
}, 2000);
}
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。