Skip to content

Commit 72e3882

Browse files
authored
Update main.py
1 parent 60644c1 commit 72e3882

File tree

1 file changed

+116
-12
lines changed

1 file changed

+116
-12
lines changed

main.py

Lines changed: 116 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ class IconLoader:
1212
def __init__(self):
1313
self.manager = QNetworkAccessManager()
1414
self.icons = {}
15-
1615
def load_icon(self, url, callback):
1716
request = QNetworkRequest(QUrl(url))
1817
reply = self.manager.get(request)
1918
reply.finished.connect(lambda: self.icon_loaded(reply, callback))
20-
2119
def icon_loaded(self, reply, callback):
2220
if reply.error() == QNetworkReply.NoError:
2321
pixmap = QPixmap()
@@ -40,7 +38,6 @@ def __init__(self):
4038
self.layout.setAlignment(Qt.AlignCenter)
4139
self.layout.setSpacing(50)
4240
self.layout.setContentsMargins(70, 70, 70, 70)
43-
4441
self.top_layout = QHBoxLayout()
4542
self.hackeros_logo = QLabel()
4643
self.hackeros_logo.setObjectName('logo')
@@ -54,23 +51,19 @@ def __init__(self):
5451
self.hackermode_logo.setPixmap(pixmap_hackermode.scaled(100, 100, Qt.KeepAspectRatio, Qt.SmoothTransformation))
5552
self.top_layout.addWidget(self.hackermode_logo, alignment=Qt.AlignRight)
5653
self.layout.addLayout(self.top_layout)
57-
5854
self.title = QLabel(get_text('title'))
5955
self.title.setFont(QFont('Hack', 60, QFont.Bold))
6056
self.title.setObjectName('neon-text')
6157
self.layout.addWidget(self.title, alignment=Qt.AlignCenter)
62-
6358
self.grid_layout = QGridLayout()
6459
self.grid_layout.setSpacing(60)
6560
self.grid_layout.setContentsMargins(50, 50, 50, 50)
6661
self.layout.addLayout(self.grid_layout)
67-
6862
self.launcher_buttons = []
6963
self.add_launcher_button('steam', 'https://store.steampowered.com/favicon.ico', 0, 0)
7064
self.add_launcher_button('heroic', 'https://www.heroicgameslauncher.com/favicon.ico', 0, 1)
7165
self.add_launcher_button('hyperplay', 'https://cdn-icons-png.flaticon.com/512/5968/5968778.png', 0, 2)
7266
self.add_launcher_button('lutris', 'https://lutris.net/static/images/logo.png', 0, 3)
73-
7467
self.bottom_layout = QHBoxLayout()
7568
self.hacker_menu_btn = QPushButton(get_text('hacker_menu'))
7669
self.hacker_menu_btn.setObjectName('action-btn')
@@ -84,7 +77,6 @@ def __init__(self):
8477
self.settings_btn.clicked.connect(self.launch_settings)
8578
self.bottom_layout.addWidget(self.settings_btn, alignment=Qt.AlignRight)
8679
self.layout.addLayout(self.bottom_layout)
87-
8880
self.update_texts()
8981
QTimer.singleShot(100, self.animate_elements)
9082

@@ -97,14 +89,12 @@ def animate_elements(self):
9789
anim.setDuration(1500)
9890
anim.setEasingCurve(QEasingCurve.OutQuint)
9991
QTimer.singleShot(i * 300, lambda: anim.start())
100-
10192
logo_anim1 = QPropertyAnimation(self.hackeros_logo, b"opacity")
10293
logo_anim1.setStartValue(0.0)
10394
logo_anim1.setEndValue(1.0)
10495
logo_anim1.setDuration(1500)
10596
logo_anim1.setEasingCurve(QEasingCurve.OutQuint)
10697
QTimer.singleShot(300, lambda: logo_anim1.start())
107-
10898
logo_anim2 = QPropertyAnimation(self.hackermode_logo, b"opacity")
10999
logo_anim2.setStartValue(0.0)
110100
logo_anim2.setEndValue(1.0)
@@ -162,8 +152,122 @@ def show_hacker_menu(self):
162152

163153
if __name__ == '__main__':
164154
app = QApplication(sys.argv)
165-
with open('styles.qss', 'r') as f:
166-
app.setStyleSheet(f.read())
155+
stylesheet = """
156+
QMainWindow, QWidget {
157+
background: qradialgradient(cx:0.5, cy:0.5, radius:1.4, stop:0 #1a1a1a, stop:1 #000000);
158+
color: white;
159+
font-family: 'Hack', 'Courier New', monospace;
160+
}
161+
#neon-text {
162+
color: #ffffff;
163+
text-shadow: 0 0 12px #ffffff, 0 0 25px #ffffff, 0 0 40px #ffffff, 0 0 60px #ffffff;
164+
animation: neon 0.8s ease-in-out infinite alternate;
165+
}
166+
@keyframes neon {
167+
from {
168+
text-shadow: 0 0 6px #ffffff, 0 0 12px #ffffff, 0 0 20px #ffffff;
169+
}
170+
to {
171+
text-shadow: 0 0 15px #ffffff, 0 0 30px #ffffff, 0 0 50px #ffffff, 0 0 70px #ffffff;
172+
}
173+
}
174+
#logo {
175+
border: 2px solid #ffffff;
176+
border-radius: 12px;
177+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
178+
transition: all 0.3s ease;
179+
}
180+
#logo:hover {
181+
box-shadow: 0 0 30px rgba(255, 255, 255, 0.7);
182+
transform: scale(1.08);
183+
}
184+
QPushButton#launcher-btn {
185+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #151515);
186+
border-radius: 30px;
187+
padding: 30px;
188+
border: 2px solid #ffffff;
189+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
190+
transition: all 0.3s ease;
191+
}
192+
QPushButton#launcher-btn:hover {
193+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #3d3d3d, stop:1 #252525);
194+
transform: scale(1.12);
195+
box-shadow: 0 0 40px rgba(255, 255, 255, 0.7);
196+
}
197+
QWidget#setting-panel {
198+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #151515);
199+
border-radius: 30px;
200+
padding: 30px;
201+
border: 2px solid #ffffff;
202+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
203+
transition: all 0.3s ease;
204+
}
205+
QWidget#setting-panel:hover {
206+
transform: translateY(-12px);
207+
box-shadow: 0 0 40px rgba(255, 255, 255, 0.7);
208+
}
209+
QPushButton#action-btn, QPushButton#setting-btn, QPushButton#list-btn {
210+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #151515);
211+
border-radius: 15px;
212+
padding: 15px;
213+
color: white;
214+
font-size: 22px;
215+
border: 2px solid #ffffff;
216+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
217+
transition: all 0.3s ease;
218+
}
219+
QPushButton#action-btn:hover, QPushButton#setting-btn:hover, QPushButton#list-btn:hover {
220+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #3d3d3d, stop:1 #252525);
221+
transform: translateY(-6px);
222+
box-shadow: 0 0 30px rgba(255, 255, 255, 0.7);
223+
}
224+
QLabel {
225+
color: white;
226+
font-size: 20px;
227+
}
228+
QLabel#list-label {
229+
font-size: 18px;
230+
color: #dddddd;
231+
}
232+
QComboBox, QLineEdit#input-field {
233+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #151515);
234+
color: white;
235+
border-radius: 12px;
236+
padding: 12px;
237+
border: 1px solid #ffffff;
238+
font-size: 20px;
239+
}
240+
QScrollArea {
241+
background: transparent;
242+
border: none;
243+
}
244+
QCheckBox#checkbox {
245+
color: white;
246+
font-size: 20px;
247+
}
248+
QMenu#hacker-menu {
249+
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #151515);
250+
border-radius: 15px;
251+
border: 2px solid #ffffff;
252+
color: white;
253+
padding: 12px;
254+
box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
255+
}
256+
QMenu#hacker-menu::item {
257+
padding: 12px 25px;
258+
border-radius: 10px;
259+
font-size: 20px;
260+
transition: all 0.2s ease;
261+
}
262+
QMenu#hacker-menu::item:hover {
263+
background: #3d3d3d;
264+
color: #ffffff;
265+
}
266+
QScrollArea > QWidget > QWidget {
267+
background: transparent;
268+
}
269+
"""
270+
app.setStyleSheet(stylesheet)
167271
setup_language()
168272
main_window = MainWindow()
169273
main_window.show()

0 commit comments

Comments
 (0)