Spaces:
Running
Running
Update 2.html
Browse files
2.html
CHANGED
|
@@ -80,60 +80,59 @@
|
|
| 80 |
<script>
|
| 81 |
let pipWindow = null;
|
| 82 |
|
| 83 |
-
// 初期状態で #hide を非表示にする
|
| 84 |
document.getElementById('hide').style.display = 'none';
|
| 85 |
|
| 86 |
document.getElementById('open').addEventListener('click', async () => {
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
form.method = 'post';
|
| 90 |
-
form.action = 'https://huggingface.co/login';
|
| 91 |
-
form.target = '_blank';
|
| 92 |
-
|
| 93 |
-
const input1 = document.createElement('input');
|
| 94 |
-
input1.type = 'hidden';
|
| 95 |
-
input1.name = 'username';
|
| 96 |
-
input1.value = 'izum' + localStorage.getItem('no') + '@mbox.re';
|
| 97 |
-
|
| 98 |
-
const input2 = document.createElement('input');
|
| 99 |
-
input2.type = 'hidden';
|
| 100 |
-
input2.name = 'password';
|
| 101 |
-
input2.value = '!Aaaaaa0';
|
| 102 |
-
|
| 103 |
-
form.appendChild(input1);
|
| 104 |
-
form.appendChild(input2);
|
| 105 |
-
document.body.appendChild(form);
|
| 106 |
-
|
| 107 |
-
form.submit();
|
| 108 |
-
|
| 109 |
-
// 少し待ってからPiPを開く
|
| 110 |
-
setTimeout(async () => {
|
| 111 |
if ('documentPictureInPicture' in window) {
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
pipWindow.document.body.appendChild(iframe);
|
| 129 |
-
} catch (error) {
|
| 130 |
-
console.error('PiPウィンドウ起動エラー:', error);
|
| 131 |
-
document.getElementById('hide').style.display = 'block';
|
| 132 |
-
}
|
| 133 |
} else {
|
| 134 |
document.getElementById('hide').style.display = 'block';
|
| 135 |
}
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
});
|
| 138 |
</script>
|
| 139 |
|
|
|
|
| 80 |
<script>
|
| 81 |
let pipWindow = null;
|
| 82 |
|
|
|
|
| 83 |
document.getElementById('hide').style.display = 'none';
|
| 84 |
|
| 85 |
document.getElementById('open').addEventListener('click', async () => {
|
| 86 |
+
try {
|
| 87 |
+
// PiPウィンドウを先に開く
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
if ('documentPictureInPicture' in window) {
|
| 89 |
+
pipWindow = await documentPictureInPicture.requestWindow({
|
| 90 |
+
width: 600,
|
| 91 |
+
height: 400,
|
| 92 |
+
});
|
| 93 |
+
|
| 94 |
+
pipWindow.document.body.style.margin = '0';
|
| 95 |
+
pipWindow.document.body.style.padding = '0';
|
| 96 |
+
|
| 97 |
+
const iframe = pipWindow.document.createElement('iframe');
|
| 98 |
+
iframe.src = '3.html';
|
| 99 |
+
iframe.style.border = 'none';
|
| 100 |
+
iframe.style.width = '100vw';
|
| 101 |
+
iframe.style.height = '100vh';
|
| 102 |
+
iframe.style.display = 'block';
|
| 103 |
+
pipWindow.document.body.appendChild(iframe);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
} else {
|
| 105 |
document.getElementById('hide').style.display = 'block';
|
| 106 |
}
|
| 107 |
+
|
| 108 |
+
// フォーム送信(別タブを先に開いてからPOSTする)
|
| 109 |
+
const loginWindow = window.open('', '_blank');
|
| 110 |
+
|
| 111 |
+
const form = document.createElement('form');
|
| 112 |
+
form.method = 'post';
|
| 113 |
+
form.action = 'https://huggingface.co/login';
|
| 114 |
+
form.target = loginWindow.name; // 新しく開いたタブへ送信
|
| 115 |
+
|
| 116 |
+
const input1 = document.createElement('input');
|
| 117 |
+
input1.type = 'hidden';
|
| 118 |
+
input1.name = 'username';
|
| 119 |
+
input1.value = 'izum' + localStorage.getItem('no') + '@mbox.re';
|
| 120 |
+
|
| 121 |
+
const input2 = document.createElement('input');
|
| 122 |
+
input2.type = 'hidden';
|
| 123 |
+
input2.name = 'password';
|
| 124 |
+
input2.value = '!Aaaaaa0';
|
| 125 |
+
|
| 126 |
+
form.appendChild(input1);
|
| 127 |
+
form.appendChild(input2);
|
| 128 |
+
document.body.appendChild(form);
|
| 129 |
+
|
| 130 |
+
form.submit();
|
| 131 |
+
|
| 132 |
+
} catch (error) {
|
| 133 |
+
console.error('PiPウィンドウ起動エラー:', error);
|
| 134 |
+
document.getElementById('hide').style.display = 'block';
|
| 135 |
+
}
|
| 136 |
});
|
| 137 |
</script>
|
| 138 |
|