Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index.html:
- <!DOCTYPE html>
- <html lang="id">
- <head>
- <meta charset="UTF-8" />
- <title>Halaman 1</title>
- <link rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div class="container">
- <h1>Halaman Pertama</h1>
- <p>Ini adalah halaman pertama.</p>
- <a href="#" onclick="showFloatingPage()">Buka Halaman Kedua</a>
- </div>
- <!-- Halaman Kedua (mengambang & transparan) -->
- <div id="floatingPage">
- <div class="glass">
- <iframe src="halaman2.html"></iframe>
- <button onclick="closeFloatingPage()">Tutup</button>
- </div>
- </div>
- <script>
- function showFloatingPage() {
- document.getElementById("floatingPage").style.display = "flex";
- }
- function closeFloatingPage() {
- document.getElementById("floatingPage").style.display = "none";
- }
- </script>
- </body>
- </html>
- home.html:
- <!DOCTYPE html>
- <html lang="id">
- <head>
- <meta charset="UTF-8" />
- <title>Halaman 2</title>
- <style>
- body {
- font-family: Arial, sans-serif;
- margin: 20px;
- color: white;
- }
- </style>
- </head>
- <body>
- <h2>Halaman Kedua</h2>
- <p>Ini adalah isi halaman kedua yang transparan seperti kaca.</p>
- </body>
- </html>
- style.css:
- /* Gaya dasar body */
- body {
- font-family: Arial, sans-serif;
- background: url('https://source.unsplash.com/1600x900/?technology') no-repeat center center fixed;
- background-size: cover;
- margin: 0;
- padding: 20px;
- }
- /* Kontainer halaman pertama */
- .container {
- background: rgba(255, 255, 255, 0.8);
- padding: 20px;
- border-radius: 8px;
- max-width: 600px;
- margin: 0 auto;
- box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
- }
- /* Halaman kedua (mengambang) */
- #floatingPage {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
- background: rgba(0, 0, 0, 0.3);
- -webkit-backdrop-filter: blur(6px);
- backdrop-filter: blur(6px);
- z-index: 999;
- justify-content: center;
- align-items: center;
- }
- /* Efek kaca transparan */
- .glass {
- width: 80%;
- height: 70%;
- background: rgba(255, 255, 255, 0.1);
- border-radius: 15px;
- -webkit-backdrop-filter: blur(15px);
- backdrop-filter: blur(15px);
- border: 1px solid rgba(255, 255, 255, 0.2);
- padding: 20px;
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
- display: flex;
- flex-direction: column;
- }
- /* iframe halaman kedua */
- iframe {
- flex: 1;
- border: none;
- width: 100%;
- border-radius: 10px;
- background: transparent;
- }
- /* Tombol tutup */
- button {
- margin-top: 10px;
- padding: 10px;
- background: rgba(255, 255, 255, 0.2);
- border: none;
- color: white;
- font-weight: bold;
- border-radius: 8px;
- cursor: pointer;
- -webkit-backdrop-filter: blur(5px);
- backdrop-filter: blur(5px);
- transition: background 0.3s;
- }
- button:hover {
- background: rgba(255, 255, 255, 0.4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement