Spaces:
Running
Running
File size: 3,047 Bytes
b33cdea | 1 2 3 4 5 6 7 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | class QuantumWindow extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
position: absolute;
min-width: 300px;
min-height: 200px;
background: rgba(30, 30, 40, 0.9);
border-radius: 8px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
transition: all 0.3s ease;
z-index: 10;
overflow: hidden;
}
.titlebar {
height: 32px;
background: linear-gradient(to right, #4a00e0, #8e2de2);
color: white;
display: flex;
align-items: center;
padding: 0 10px;
cursor: move;
font-weight: 500;
}
.title {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.controls {
display: flex;
}
.control {
width: 16px;
height: 16px;
border-radius: 50%;
margin-left: 8px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 8px;
}
.close {
background: #ff5f56;
}
.minimize {
background: #ffbd2e;
}
.maximize {
background: #27c93f;
}
.content {
padding: 15px;
height: calc(100% - 32px);
overflow: auto;
}
</style>
<div class="titlebar">
<slot name="icon"></slot>
<span class="title"><slot name="title"></slot></span>
<div class="controls">
<div class="control minimize">_</div>
<div class="control maximize">□</div>
<div class="control close">×</div>
</div>
</div>
<div class="content">
<slot name="content"></slot>
</div>
`;
}
connectedCallback() {
// Implement window dragging, controls, etc.
}
}
customElements.define('quantum-window', QuantumWindow); |