from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(470, 582)
        MainWindow.setMinimumSize(QtCore.QSize(470, 582))
        MainWindow.setMaximumSize(QtCore.QSize(470, 582))
        font = QtGui.QFont()
        font.setPointSize(8)
        MainWindow.setFont(font)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        MainWindow.setToolTip("")
        MainWindow.setStyleSheet("")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setStyleSheet("background-color: rgb(250, 248, 239);")
        self.centralwidget.setObjectName("centralwidget")
        self.title_game = QtWidgets.QLabel(self.centralwidget)
        self.title_game.setGeometry(QtCore.QRect(10, 20, 270, 70))
        self.title_game.setMaximumSize(QtCore.QSize(270, 70))
        font = QtGui.QFont()
        font.setFamily("Georgia")
        font.setPointSize(35)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.title_game.setFont(font)
        self.title_game.setToolTip("")
        self.title_game.setAutoFillBackground(False)
        self.title_game.setStyleSheet("color: rgb(119, 110, 101);")
        self.title_game.setAlignment(QtCore.Qt.AlignCenter)
        self.title_game.setObjectName("title_game")
        self.score_frame = QtWidgets.QFrame(self.centralwidget)
        self.score_frame.setGeometry(QtCore.QRect(310, 20, 150, 70))
        self.score_frame.setMaximumSize(QtCore.QSize(150, 70))
        self.score_frame.setStyleSheet("background-color: rgb(187, 173, 160);\n"
                                       "border-radius: 8px;")
        self.score_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.score_frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.score_frame.setObjectName("score_frame")
        self.title_sc = QtWidgets.QLabel(self.score_frame)
        self.title_sc.setGeometry(QtCore.QRect(0, 0, 150, 40))
        self.title_sc.setMaximumSize(QtCore.QSize(150, 40))
        font = QtGui.QFont()
        font.setFamily("Aharoni")
        font.setPointSize(16)
        self.title_sc.setFont(font)
        self.title_sc.setStyleSheet("color: white;")
        self.title_sc.setAlignment(QtCore.Qt.AlignCenter)
        self.title_sc.setObjectName("title_sc")
        self.score = QtWidgets.QLabel(self.score_frame)
        self.score.setGeometry(QtCore.QRect(0, 30, 150, 40))
        self.score.setMaximumSize(QtCore.QSize(150, 40))
        font = QtGui.QFont()
        font.setFamily("Aharoni")
        font.setPointSize(26)
        self.score.setFont(font)
        self.score.setStyleSheet("color: white;")
        self.score.setAlignment(QtCore.Qt.AlignCenter)
        self.score.setObjectName("score")
        self.game_frame = QtWidgets.QFrame(self.centralwidget)
        self.game_frame.setGeometry(QtCore.QRect(10, 160, 450, 410))
        self.game_frame.setMaximumSize(QtCore.QSize(450, 410))
        self.game_frame.setStyleSheet("border-radius: 12px;\n"
                                      "background-color: rgb(187, 173, 160);")
        self.game_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.game_frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.game_frame.setObjectName("game_frame")

        for i in range(4):
                for j in range(4):
                        cell = QtWidgets.QLabel(self.game_frame)
                        cell.setGeometry(QtCore.QRect(j*110+10, i*100+10, 100, 90))
                        cell.setMaximumSize(QtCore.QSize(100, 90))
                        font = QtGui.QFont()
                        font.setFamily("David")
                        font.setPointSize(40)
                        cell.setFont(font)
                        cell.setStyleSheet("background-color: rgb(205, 193, 180);\n"
                                           "color: rgb(119, 110, 101);")
                        cell.setText("")
                        cell.setAlignment(QtCore.Qt.AlignCenter)

        self.new_game_button = QtWidgets.QPushButton(self.centralwidget)
        self.new_game_button.setGeometry(QtCore.QRect(310, 110, 150, 40))
        self.new_game_button.setMaximumSize(QtCore.QSize(150, 40))
        font = QtGui.QFont()
        font.setFamily("Aharoni")
        font.setPointSize(16)
        self.new_game_button.setFont(font)
        self.new_game_button.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.new_game_button.setAutoFillBackground(False)
        self.new_game_button.setStyleSheet("border-radius: 8px;\n"
                                         "background-color: rgb(143, 122, 102);\n"
                                         "color: white;"
                                         "outline: 0;")
        self.new_game_button.setCheckable(False)
        self.new_game_button.setChecked(False)
        self.new_game_button.setObjectName("newGameButton")
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "2048 Game analog with degree 3 for PyAcademy"))
        self.title_game.setText(_translate("MainWindow", "177147 Game"))
        self.title_sc.setText(_translate("MainWindow", "Score"))
        self.score.setText(_translate("MainWindow", "0"))
        self.new_game_button.setText(_translate("MainWindow", "New Game"))


