完成实验环境并且启用懒加载

This commit is contained in:
cxykevin 2024-05-31 23:13:38 +08:00
parent 5333cea014
commit 2d6b5c75a7
1 changed files with 26 additions and 6 deletions

View File

@ -65,7 +65,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
border: none; border: none;
background-color: white; background-color: rgb(34, 34, 34);
box-shadow: -5px 0 5px rgba(0, 0, 0, 0.2); box-shadow: -5px 0 5px rgba(0, 0, 0, 0.2);
z-index: 1000; z-index: 1000;
overflow-y: auto; overflow-y: auto;
@ -75,6 +75,7 @@
} }
.popup-window iframe { .popup-window iframe {
background-color: rgb(34, 34, 34);
width: 500px; width: 500px;
height: 100vh; height: 100vh;
/* Use viewport height to fill the height of the window */ /* Use viewport height to fill the height of the window */
@ -85,6 +86,14 @@
right: calc(-100% + 500px); right: calc(-100% + 500px);
/* Slide the window into view */ /* Slide the window into view */
} }
#pFrame {
background-color: rgb(34, 34, 34);
width: 500px;
height: 100vh;
/* Use viewport height to fill the height of the window */
border: none;
}
</style> </style>
</head> </head>
@ -280,7 +289,7 @@
</nav> </nav>
</div> </div>
<div id="popup-window" class="popup-window"> <div id="popup-window" class="popup-window">
<iframe src="https://nj1.mossfrp.cn:52719/" frameborder="0"></iframe> <iframe src="about:blank" id="pFrame" frameborder="0"></iframe>
</div> </div>
</div> </div>
@ -394,15 +403,26 @@
</script> </script>
{{/if}} {{/if}}
{{/if}} {{/if}}
<!-- study env -->
<!-- https://nj1.mossfrp.cn:52719/ -->
<script> <script>
var link = "https://nj1.mossfrp.cn:52719/";
document.getElementById('popup-btn').addEventListener('click', function () { document.getElementById('popup-btn').addEventListener('click', function () {
var popupWindow = document.getElementById('popup-window'); if (window.screen.width >= 700) {
if (popupWindow.classList.contains('show')) { var popupWindow = document.getElementById('popup-window');
popupWindow.classList.remove('show'); if (popupWindow.classList.contains('show')) {
popupWindow.classList.remove('show');
} else {
popupWindow.classList.add('show');
if (document.getElementById("pFrame").src === "about:blank")
document.getElementById("pFrame").src = link
}
} else { } else {
popupWindow.classList.add('show'); window.open(link, "_blank");
} }
}); });
</script> </script>
</div> </div>