Spaces:
Running
Running
Download components/quantum-processor.js from idhyksi097/quantumos-hypervisor: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/spaces/idhyksi097/quantumos-hypervisor/resolve/main/components/quantum-processor.js
- Command line
-
hf download hf://spaces/idhyksi097/quantumos-hypervisor/components/quantum-processor.js
-
curl -L -o quantum-processor.js https://huggingface.co/spaces/idhyksi097/quantumos-hypervisor/resolve/main/components/quantum-processor.js
2.33 kB
| class QuantumProcessor extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| background: rgba(10, 0, 20, 0.9); | |
| border-radius: 8px; | |
| padding: 15px; | |
| border: 1px solid rgba(255, 0, 255, 0.2); | |
| box-shadow: 0 0 15px rgba(255, 0, 255, 0.3); | |
| } | |
| .processor-header { | |
| color: #f0f; | |
| margin-bottom: 10px; | |
| display: flex; | |
| align-items: center; | |
| } | |
| .processor-icon { | |
| margin-right: 10px; | |
| color: #f0f; | |
| } | |
| .qubit-grid { | |
| display: grid; | |
| grid-template-columns: repeat(8, 1fr); | |
| gap: 5px; | |
| } | |
| .qubit { | |
| aspect-ratio: 1; | |
| border-radius: 50%; | |
| background: rgba(100, 0, 100, 0.5); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .qubit::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: radial-gradient(circle, | |
| rgba(255,0,255,0.8) 0%, | |
| rgba(100,0,100,0.2) 70%); | |
| animation: pulse 2s infinite alternate; | |
| } | |
| @keyframes pulse { | |
| 0% { opacity: 0.3; } | |
| 100% { opacity: 1; } | |
| } | |
| </style> | |
| <div class="processor-header"> | |
| <i class="processor-icon fas fa-question-circle"></i> | |
| <span>Quantum Processing Unit (64-Qubit)</span> | |
| </div> | |
| <div class="qubit-grid" id="qubit-container"></div> | |
| `; | |
| this.qubitStates = Array(64).fill(0); | |
| } | |
| connectedCallback() { | |
| this.renderQubits(); | |
| setInterval(() => this.updateQubits(), 1500); | |
| } | |
| renderQubits() { | |
| const container = this.shadowRoot.getElementById('qubit-container'); | |
| container.innerHTML = ''; | |
| for (let i = 0; i < 64; i++) { | |
| const qubit = document.createElement('div'); | |
| qubit.className = 'qubit'; | |
| qubit.style.animationDelay = `${Math.random() * 2}s`; | |
| container.appendChild(qubit); | |
| } | |
| } | |
| updateQubits() { | |
| this.qubitStates = this.qubitStates.map(() => Math.random() > 0.5 ? 1 : 0); | |
| } | |
| } | |
| customElements.define('quantum-processor', QuantumProcessor); |