Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完美自适应 #5

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,35 @@
<body>
<h1 class="title">华南理工腾讯创新创业俱乐部官方网站</h1>
<h3>添加了钟✌✌✌ ---- 587! 23.11.15</h3>

<div style="display: flex;justify-content: center;margin: 0 16px;">
<iframe src="https://0x587.github.io/clock-of-clock/"
style="width: 60vw;height: 60vh;background-color: #FFF;border-radius: 18px;"></iframe>
<iframe src="https://0x587.github.io/clock-of-clock/" id="clock-iframe"
style="display: block; width: 60vw;height: 40vw;background-color: #FFF;border-radius: 18px;"></iframe>
<div style="display: none;font-size: 24px;" id="clock-hide">
<p>竖屏没有钟!竖屏没有钟!</p>
<p>竖屏没有钟!竖屏没有钟!</p>
<p>竖屏没有钟!竖屏没有钟!</p>
<p>竖屏没有钟!竖屏没有钟!</p>
<p>竖屏没有钟!竖屏没有钟!</p>
<p>竖屏没有钟!竖屏没有钟!</p>
</div>
<script>
function onWindowSizeChange() {
var width = window.innerWidth;
var height = window.innerHeight;
iframe = document.getElementById('clock-iframe');
iframeHide = document.getElementById('clock-hide');
if (width < height) {
iframe.style.display = 'none';
iframeHide.style.display = 'block';
}
else {
iframe.style.display = 'block';
iframeHide.style.display = 'none';
}
}
onWindowSizeChange();
window.addEventListener('resize', onWindowSizeChange);
</script>
</div>
<h3>添加了标题 ----71綦 23.11.13</h3>

Expand Down