Guest User

Random UI that means nothing

a guest
Dec 17th, 2025
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.00 KB | None | 0 0
  1. /*
  2. OWOT Multi-Window UI System
  3. Features:
  4. - Glassmorphism & Modern Dark Theme
  5. - Draggable & Closeable Windows
  6. - Reusable Window Creation API
  7. - Automatic input isolation
  8. */
  9. (function() {
  10. const theme = {
  11. bg: 'rgba(25, 25, 30, 0.9)',
  12. accent: '#5e5ce6',
  13. text: '#ffffff',
  14. textDim: '#a0a0a5',
  15. border: 'rgba(255, 255, 255, 0.1)',
  16. shadow: '0 8px 32px rgba(0, 0, 0, 0.4)'
  17. };
  18. const containerId = 'owot-multi-window-container';
  19. let container = document.getElementById(containerId);
  20. if (!container) {
  21. container = document.createElement('div');
  22. container.id = containerId;
  23. document.body.appendChild(container);
  24. }
  25. function createWindow(id, title, content, x, y, width = 250) {
  26. if (document.getElementById(`owot-win-${id}`)) return;
  27. const win = document.createElement('div');
  28. win.id = `owot-win-${id}`;
  29. win.style = `
  30. position: fixed;
  31. left: ${x}px;
  32. top: ${y}px;
  33. width: ${width}px;
  34. background: ${theme.bg};
  35. backdrop-filter: blur(12px);
  36. border: 1px solid ${theme.border};
  37. border-radius: 12px;
  38. box-shadow: ${theme.shadow};
  39. color: ${theme.text};
  40. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  41. z-index: 10002;
  42. overflow: hidden;
  43. display: flex;
  44. flex-direction: column;
  45. user-select: none;
  46. animation: owotWinFadeIn 0.3s ease;
  47. `;
  48. win.innerHTML = `
  49. <div class="owot-win-header" style="padding: 12px; background: rgba(255,255,255,0.05); cursor: move; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid ${theme.border};">
  50. <span style="font-weight: 600; font-size: 13px; letter-spacing: 0.5px;">${title.toUpperCase()}</span>
  51. <span class="owot-win-close" style="cursor: pointer; opacity: 0.5; transition: 0.2s; font-size: 18px;">&times;</span>
  52. </div>
  53. <div class="owot-win-body" style="padding: 15px; font-size: 13px; color: ${theme.textDim}; max-height: 400px; overflow-y: auto;">
  54. ${content}
  55. </div>
  56. `;
  57. container.appendChild(win);
  58. const closeBtn = win.querySelector('.owot-win-close');
  59. closeBtn.onmousedown = (e) => e.stopPropagation();
  60. closeBtn.onclick = () => win.remove();
  61. closeBtn.onmouseover = () => closeBtn.style.opacity = '1';
  62. closeBtn.onmouseout = () => closeBtn.style.opacity = '0.5';
  63. // Dragging Logic
  64. const header = win.querySelector('.owot-win-header');
  65. let isDragging = false;
  66. let offset = { x: 0, y: 0 };
  67. header.onmousedown = (e) => {
  68. isDragging = true;
  69. offset.x = e.clientX - win.offsetLeft;
  70. offset.y = e.clientY - win.offsetTop;
  71. win.style.zIndex = '10003';
  72. Array.from(container.children).forEach(c => {
  73. if (c !== win) c.style.zIndex = '10002';
  74. });
  75. };
  76. document.addEventListener('mousemove', (e) => {
  77. if (!isDragging) return;
  78. win.style.left = (e.clientX - offset.x) + 'px';
  79. win.style.top = (e.clientY - offset.y) + 'px';
  80. });
  81. document.addEventListener('mouseup', () => isDragging = false);
  82. // Input isolation
  83. win.querySelectorAll('input, textarea, select').forEach(el => {
  84. ['keydown', 'keyup', 'keypress'].forEach(evt => {
  85. el.addEventListener(evt, (e) => e.stopPropagation());
  86. });
  87. });
  88. }
  89. // Add Fade-In Animation
  90. const styleTag = document.createElement('style');
  91. styleTag.innerHTML = `
  92. @keyframes owotWinFadeIn {
  93. from { opacity: 0; transform: translateY(10px) scale(0.98); }
  94. to { opacity: 1; transform: translateY(0) scale(1); }
  95. }
  96. .owot-win-body::-webkit-scrollbar { width: 4px; }
  97. .owot-win-body::-webkit-scrollbar-track { background: transparent; }
  98. .owot-win-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
  99. `;
  100. document.head.appendChild(styleTag);
  101. // Initial Desktop Layout
  102. createWindow('dashboard', 'System Dashboard', `
  103. <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
  104. <div style="background: rgba(255,255,255,0.03); padding: 8px; border-radius: 8px; text-align: center;">
  105. <div style="font-size: 10px; color: ${theme.accent};">STABILITY</div>
  106. <div style="font-size: 16px; color: #fff;">100%</div>
  107. </div>
  108. <div style="background: rgba(255,255,255,0.03); padding: 8px; border-radius: 8px; text-align: center;">
  109. <div style="font-size: 10px; color: ${theme.accent};">PING</div>
  110. <div style="font-size: 16px; color: #fff;">24ms</div>
  111. </div>
  112. </div>
  113. <div style="margin-top: 15px;">
  114. <div style="margin-bottom: 5px; display: flex; justify-content: space-between;">
  115. <span>CPU Usage</span>
  116. <span>12%</span>
  117. </div>
  118. <div style="height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px;">
  119. <div style="width: 12%; height: 100%; background: ${theme.accent}; border-radius: 2px;"></div>
  120. </div>
  121. </div>
  122. `, 20, 20, 220);
  123. createWindow('toolbox', 'Toolbox', `
  124. <button style="width: 100%; padding: 8px; margin-bottom: 8px; background: ${theme.accent}; border: none; color: white; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 500;">Refresh Assets</button>
  125. <button style="width: 100%; padding: 8px; margin-bottom: 8px; background: rgba(255,255,255,0.05); border: 1px solid ${theme.border}; color: white; border-radius: 6px; cursor: pointer; font-size: 12px;">Clear Cache</button>
  126. <div style="display: flex; gap: 5px;">
  127. <input type="text" placeholder="Command..." style="flex: 1; background: #000; border: 1px solid ${theme.border}; color: #fff; padding: 5px; border-radius: 4px; font-size: 11px;">
  128. <button style="background: #222; border: 1px solid ${theme.border}; color: #fff; padding: 5px 10px; border-radius: 4px; cursor: pointer;">↵</button>
  129. </div>
  130. `, 260, 20, 200);
  131. createWindow('weather', 'World Weather', `
  132. <div style="display: flex; align-items: center; gap: 15px;">
  133. <div style="font-size: 32px;">☀️</div>
  134. <div>
  135. <div style="font-size: 18px; color: #fff; font-weight: 600;">Sunny</div>
  136. <div style="font-size: 11px;">World Offset: 0, 0</div>
  137. </div>
  138. </div>
  139. <div style="margin-top: 15px; font-size: 11px;">
  140. It is a beautiful day in Our World of Text. Visibility is high and the text density is optimal.
  141. </div>
  142. `, 20, 200, 220);
  143. createWindow('stats', 'Live Feed', `
  144. <div style="display: flex; flex-direction: column; gap: 8px;">
  145. <div style="border-left: 2px solid #ed4b4b; padding-left: 10px;">
  146. <div style="font-size: 11px; color: #fff;">Guest_3021 connected</div>
  147. <div style="font-size: 9px;">2 seconds ago</div>
  148. </div>
  149. <div style="border-left: 2px solid #4bed6d; padding-left: 10px;">
  150. <div style="font-size: 11px; color: #fff;">New text block at (34, -12)</div>
  151. <div style="font-size: 9px;">1 minute ago</div>
  152. </div>
  153. <div style="border-left: 2px solid #4b97ed; padding-left: 10px;">
  154. <div style="font-size: 11px; color: #fff;">Maintenance scheduled</div>
  155. <div style="font-size: 9px;">3 hours ago</div>
  156. </div>
  157. </div>
  158. `, 260, 180, 200);
  159. console.log("Multi-Window UI System Loaded.");
  160. })();
Advertisement
Add Comment
Please, Sign In to add comment