|
| 1 | +import sys |
| 2 | +from PyQt5.QtWidgets import ( |
| 3 | + QApplication, QWidget, QVBoxLayout, QPushButton, QLabel, QMessageBox |
| 4 | +) |
| 5 | +from PyQt5.QtGui import QFont, QPalette, QColor |
| 6 | +from PyQt5.QtCore import Qt |
| 7 | + |
| 8 | +class ZKPGUILauncher(QWidget): |
| 9 | + def __init__(self): |
| 10 | + super().__init__() |
| 11 | + |
| 12 | + self.setWindowTitle("ZKP Learning Playground") |
| 13 | + self.setFixedSize(400, 320) |
| 14 | + self.setStyleSheet("background-color: #2C3E50;") |
| 15 | + |
| 16 | + layout = QVBoxLayout() |
| 17 | + |
| 18 | + # Title label |
| 19 | + title = QLabel("\ud83c\udf93 Zero-Knowledge Proof Playground") |
| 20 | + title.setFont(QFont("Arial", 16, QFont.Bold)) |
| 21 | + title.setStyleSheet("color: white; padding: 20px;") |
| 22 | + title.setAlignment(Qt.AlignCenter) |
| 23 | + layout.addWidget(title) |
| 24 | + |
| 25 | + # Button style |
| 26 | + button_style = """ |
| 27 | + QPushButton { |
| 28 | + background-color: #34495E; |
| 29 | + color: #ECF0F1; |
| 30 | + border-radius: 8px; |
| 31 | + padding: 10px; |
| 32 | + font-size: 14px; |
| 33 | + } |
| 34 | + QPushButton:hover { |
| 35 | + background-color: #3D566E; |
| 36 | + } |
| 37 | + """ |
| 38 | + |
| 39 | + buttons = [ |
| 40 | + ("\ud83d\udd10 Commitment Game", self.commitment_game), |
| 41 | + ("\ud83d\udc65 Prover-Verifier ZKP", self.zkp_game), |
| 42 | + ("\ud83c\udfad Indistinguishability Game", self.ind_game) |
| 43 | + ] |
| 44 | + |
| 45 | + for label, handler in buttons: |
| 46 | + btn = QPushButton(label) |
| 47 | + btn.setFont(QFont("Arial", 12)) |
| 48 | + btn.setStyleSheet(button_style) |
| 49 | + btn.clicked.connect(handler) |
| 50 | + layout.addWidget(btn) |
| 51 | + |
| 52 | + self.setLayout(layout) |
| 53 | + |
| 54 | + def commitment_game(self): |
| 55 | + QMessageBox.information(self, "Coming Soon", "\ud83d\udd10 Commitment Game will launch here!") |
| 56 | + |
| 57 | + def zkp_game(self): |
| 58 | + QMessageBox.information(self, "Coming Soon", "\ud83d\udc65 Prover-Verifier ZKP Game will launch here!") |
| 59 | + |
| 60 | + def ind_game(self): |
| 61 | + QMessageBox.information(self, "Coming Soon", "\ud83c\udfad Indistinguishability Game will launch here!") |
| 62 | + |
| 63 | +if __name__ == "__main__": |
| 64 | + app = QApplication(sys.argv) |
| 65 | + window = ZKPGUILauncher() |
| 66 | + window.show() |
| 67 | + sys.exit(app.exec_()) |
0 commit comments