Update index.html
Browse files- index.html +128 -83
index.html
CHANGED
|
@@ -3,107 +3,152 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<
|
|
|
|
|
|
|
| 7 |
<style>
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
}
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
| 42 |
}
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
text-align: center;
|
| 47 |
-
padding: 10px 0;
|
| 48 |
-
margin-top: auto;
|
| 49 |
-
border-radius: 0 0 5px 5px;
|
| 50 |
}
|
| 51 |
</style>
|
| 52 |
</head>
|
| 53 |
<body>
|
| 54 |
-
<
|
| 55 |
-
<
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
<
|
| 68 |
-
<pre id="consoleOutput"></pre>
|
| 69 |
-
</div>
|
| 70 |
-
|
| 71 |
-
<div class="card">
|
| 72 |
-
<h2>Run Code</h2>
|
| 73 |
-
<button onclick="runCode()">Execute</button>
|
| 74 |
</div>
|
| 75 |
-
</
|
| 76 |
|
| 77 |
-
<footer>
|
| 78 |
-
<p>© 2023 Coder Space. All rights reserved.</p>
|
| 79 |
-
</footer>
|
| 80 |
-
|
| 81 |
-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/min/vs/loader.js"></script>
|
| 82 |
<script>
|
| 83 |
-
//
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
| 102 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
-
// Example of using environment variables
|
| 105 |
-
const envVars = window.huggingface.variables;
|
| 106 |
-
console.log('Environment Variables:', JSON.stringify(envVars, null, 2));
|
| 107 |
-
</script>
|
| 108 |
</body>
|
| 109 |
</html>
|
|
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
| 7 |
+
<meta name="description" content="Full screen iframe implementation">
|
| 8 |
+
<title>Full Screen Iframe</title>
|
| 9 |
<style>
|
| 10 |
+
/* CSS Reset for cross-browser consistency */
|
| 11 |
+
*,
|
| 12 |
+
*::before,
|
| 13 |
+
*::after {
|
| 14 |
+
box-sizing: border-box;
|
| 15 |
+
margin: 0;
|
| 16 |
+
padding: 0;
|
| 17 |
}
|
| 18 |
+
|
| 19 |
+
/* Base styles */
|
| 20 |
+
html, body {
|
| 21 |
+
height: 100vh;
|
| 22 |
+
width: 100vw;
|
| 23 |
+
overflow: hidden;
|
| 24 |
+
position: relative;
|
| 25 |
}
|
| 26 |
+
|
| 27 |
+
/* Container for iframe with fallback message */
|
| 28 |
+
.iframe-container {
|
| 29 |
+
position: fixed;
|
| 30 |
+
top: 0;
|
| 31 |
+
left: 0;
|
| 32 |
+
width: 100%;
|
| 33 |
+
height: 100%;
|
| 34 |
+
background-color: #f5f5f5;
|
| 35 |
}
|
| 36 |
+
|
| 37 |
+
/* Iframe styles with improved performance */
|
| 38 |
+
.responsive-iframe {
|
| 39 |
+
position: absolute;
|
| 40 |
+
top: 0;
|
| 41 |
+
left: 0;
|
| 42 |
+
width: 100%;
|
| 43 |
+
height: 100%;
|
| 44 |
+
border: none;
|
| 45 |
+
overflow: hidden;
|
| 46 |
+
/* Enable hardware acceleration */
|
| 47 |
+
transform: translateZ(0);
|
| 48 |
+
-webkit-transform: translateZ(0);
|
| 49 |
+
/* Improve scrolling performance */
|
| 50 |
+
-webkit-overflow-scrolling: touch;
|
| 51 |
}
|
| 52 |
+
|
| 53 |
+
/* Fallback message styling */
|
| 54 |
+
.fallback-message {
|
| 55 |
+
display: none;
|
| 56 |
+
position: absolute;
|
| 57 |
+
top: 50%;
|
| 58 |
+
left: 50%;
|
| 59 |
+
transform: translate(-50%, -50%);
|
| 60 |
+
text-align: center;
|
| 61 |
+
padding: 20px;
|
| 62 |
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 63 |
}
|
| 64 |
+
|
| 65 |
+
/* Show fallback when iframe fails */
|
| 66 |
+
.iframe-error .fallback-message {
|
| 67 |
+
display: block;
|
| 68 |
}
|
| 69 |
+
|
| 70 |
+
.iframe-error .responsive-iframe {
|
| 71 |
+
display: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
</style>
|
| 74 |
</head>
|
| 75 |
<body>
|
| 76 |
+
<div class="iframe-container">
|
| 77 |
+
<iframe
|
| 78 |
+
src="https://aidark.net/"
|
| 79 |
+
class="responsive-iframe"
|
| 80 |
+
title="Full screen content"
|
| 81 |
+
sandbox="allow-scripts allow-same-origin allow-forms"
|
| 82 |
+
loading="lazy"
|
| 83 |
+
referrerpolicy="no-referrer"
|
| 84 |
+
onload="this.parentElement.classList.remove('iframe-error')"
|
| 85 |
+
onerror="this.parentElement.classList.add('iframe-error')"
|
| 86 |
+
></iframe>
|
| 87 |
+
<div class="fallback-message">
|
| 88 |
+
<h2>Unable to load content</h2>
|
| 89 |
+
<p>Please check your internet connection and try again.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
</div>
|
| 91 |
+
</div>
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
<script>
|
| 94 |
+
// Handle iframe loading errors
|
| 95 |
+
window.addEventListener('load', function() {
|
| 96 |
+
const iframe = document.querySelector('.responsive-iframe');
|
| 97 |
+
const container = document.querySelector('.iframe-container');
|
| 98 |
+
|
| 99 |
+
// Additional error handling
|
| 100 |
+
iframe.addEventListener('error', function() {
|
| 101 |
+
container.classList.add('iframe-error');
|
| 102 |
+
});
|
| 103 |
+
|
| 104 |
+
// Handle resize events efficiently
|
| 105 |
+
let resizeTimeout;
|
| 106 |
+
window.addEventListener('resize', function() {
|
| 107 |
+
clearTimeout(resizeTimeout);
|
| 108 |
+
resizeTimeout = setTimeout(function() {
|
| 109 |
+
// Trigger reflow only when resize ends
|
| 110 |
+
iframe.style.height = window.innerHeight + 'px';
|
| 111 |
+
iframe.style.width = window.innerWidth + 'px';
|
| 112 |
+
}, 250);
|
| 113 |
+
});
|
| 114 |
});
|
| 115 |
+
</script>
|
| 116 |
+
</body>
|
| 117 |
+
</html>
|
| 118 |
+
<!--
|
| 119 |
|
| 120 |
+
<!DOCTYPE html>
|
| 121 |
+
<html lang="en">
|
| 122 |
+
<head>
|
| 123 |
+
<meta charset="UTF-8">
|
| 124 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 125 |
+
<title>Full Screen Iframe</title>
|
| 126 |
+
<style>
|
| 127 |
+
/* Remove padding and margin for body and html */
|
| 128 |
+
html, body {
|
| 129 |
+
margin: 0;
|
| 130 |
+
padding: 0;
|
| 131 |
+
height: 100%;
|
| 132 |
+
}
|
| 133 |
|
| 134 |
+
/* Make the iframe full screen and remove the border */
|
| 135 |
+
iframe {
|
| 136 |
+
position: absolute;
|
| 137 |
+
top: 0;
|
| 138 |
+
left: 0;
|
| 139 |
+
width: 100%;
|
| 140 |
+
height: 100%;
|
| 141 |
+
border: none; /* Removes the border */
|
| 142 |
+
margin: 0;
|
| 143 |
+
padding: 0;
|
| 144 |
+
overflow: hidden; /* Prevents scrollbars */
|
| 145 |
}
|
| 146 |
+
</style>
|
| 147 |
+
</head>
|
| 148 |
+
<body>
|
| 149 |
+
|
| 150 |
+
<iframe src="https://aidark.net/" frameborder="0" scrolling="no"></iframe>
|
| 151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
</body>
|
| 153 |
</html>
|
| 154 |
+
-->
|