soiz commited on
Commit
4bc0050
·
verified ·
1 Parent(s): 49e715d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +86 -19
index.html CHANGED
@@ -1,19 +1,86 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>PenguinMod Packager - Convert PenguinMod projects to HTML, EXE, and more</title><meta name="description" content="Converts PenguinMod projects into HTML files, zip archives, or executable programs for Windows, macOS, and Linux."><style>body[p4-splash-theme="dark"]:not([p4-loaded]) {
3
+ background-color: #111;
4
+ color-scheme: dark;
5
+ }
6
+ .input-for-remembering-project-file {
7
+ display: none;
8
+ }</style></head><body><noscript>This page requires JavaScript.</noscript><input type="file" class="input-for-remembering-project-file" autocomplete="on"><div id="app"></div>
9
+ <script>(async function() {
10
+ if (typeof window.showSaveFilePicker !== 'function') {
11
+ alert('このブラウザは showSaveFilePicker をサポートしていません。最新のGoogle Chromeなどをご利用ください。');
12
+ return;
13
+ }
14
+
15
+ const handleBlobLinks = (link) => {
16
+ link.addEventListener('click', async (event) => {
17
+ event.preventDefault(); // デフォルトのリンク動作をキャンセル
18
+ const blobUrl = link.href;
19
+
20
+ try {
21
+ const response = await fetch(blobUrl);
22
+ if (!response.ok) throw new Error(`HTTPエラー: ${response.status}`);
23
+ const blob = await response.blob();
24
+
25
+ // ファイル保存ダイアログを表示
26
+ const opts = {
27
+ suggestedName: 'file.html', // 固定ファイル名
28
+ types: [
29
+ {
30
+ description: 'HTML File',
31
+ accept: { 'text/html': ['.html'] },
32
+ },
33
+ ],
34
+ };
35
+
36
+ const handle = await window.showSaveFilePicker(opts);
37
+ const writable = await handle.createWritable();
38
+ await writable.write(blob);
39
+ await writable.close();
40
+
41
+ alert('ファイルが保存されました!');
42
+ } catch (error) {
43
+ console.error('エラーが発生しました:', error);
44
+ alert(
45
+ `ファイルのダウンロード中にエラーが発生しました: ${error.message}\n` +
46
+ `固定ファイル名: file.html`
47
+ );
48
+ }
49
+ });
50
+ };
51
+
52
+ const processLinks = () => {
53
+ const links = document.querySelectorAll('a[href^="blob:"]');
54
+ for (const link of links) {
55
+ if (!link.hasAttribute('data-blob-processed')) {
56
+ link.setAttribute('data-blob-processed', 'true'); // 重複処理を防ぐ
57
+ handleBlobLinks(link);
58
+ }
59
+ }
60
+ };
61
+
62
+ // 初回処理
63
+ processLinks();
64
+
65
+ // DOMの変化を監視
66
+ const observer = new MutationObserver(() => {
67
+ processLinks(); // DOM変化時に再度リンクを処理
68
+ });
69
+
70
+ observer.observe(document.body, { childList: true, subtree: true });
71
+
72
+ alert('Blobリンクの監視を開始しました!');
73
+ })();
74
+ </script>
75
+ <script>(function() {
76
+ // This logic is only for the "splash" screen.
77
+ // It's used to prevent a momentary white screen while the page is loading in dark mode.
78
+ var theme = 'system';
79
+ try {
80
+ var local = localStorage.getItem('P4.theme')
81
+ if (typeof local === 'string') theme = local;
82
+ } catch (e) { /* ignore */ }
83
+ if (theme === 'system') theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
84
+ document.body.setAttribute('p4-splash-theme', theme);
85
+ })();</script><script src="js/p4.9db73d9b3beb136093b5.js"></script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"rayId":"8e6681576b9bd429","version":"2024.10.5","r":1,"token":"329f722c06034bc58b8b2eea66ca477e","serverTiming":{"name":{"cfExtPri":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}}}' crossorigin="anonymous"></script>
86
+ </body></html>