Write a GUI program with pyqt6 for planner to record daily things such as daily tasks, thanksgiving, study hours, today's song, when I woke up, today's motivation
Program structure colors
#96CEB4
#FFAD60
#A02334
#FFEEAD
Buttons are like iPhone buttons, everything has animation
hamburger menu
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here is a PyQt6 program that creates a daily planner GUI application based on your requirements. It includes sections for daily tasks, thanksgiving, study hours, today's song, when you woke up, and today's motivation. The color scheme uses the colors you provided, buttons are styled like iPhone buttons with simple animations, and there is a hamburger menu.
python
import sys
from PyQt6.QtWidgets import (
QApplication,
QMainWindow,
QWidget,
QLabel,
QTextEdit,
QPushButton,
QVBoxLayout,
QHBoxLayout,
QScrollArea,
QMenuBar,
QMenu,
QAction,
)
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QFont, QColor
class PlannerApp(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Daily Planner")
self.setFixedSize(800, 600)
self.init_ui()
def init_ui(self):
# Define colors
color1 = "#96CEB4" # Light green
color2 = "#FFAD60" # Orange
color3 = "#A02334" # Dark red
color4 = "#FFEEAD" # Light yellow
# Set up the main widget and layout
main_widget = QWidget()
self.setCentralWidget(main_widget)
main_layout = QVBoxLayout()
main_widget.setLayout(main_layout)
# Create a scroll area for the main content
scroll_area = QScrollArea()
scroll_area.setWidgetResizable(True)
scroll_content = QWidget()
scroll_area.setWidget(scroll_content)
scroll_layout = QVBoxLayout()
scroll_content.setLayout(scroll_layout)
# Set up the menu bar (hamburger menu)
menu_bar = QMenuBar()
menu = QMenu("☰", self)
menu_bar.addMenu(menu)
self.setMenuBar(menu_bar)
# Add actions to the menu
menu.addAction("Settings")
menu.addAction("About")
# Sections to include
sections = [
("Daily Tasks", "daily_tasks"),
("Thanksgiving", "thanksgiving"),
("Study Hours", "study_hours"),
("Today's Song", "todays_song"),
("When I Woke Up", "when_i_woke_up"),
("Today's Motivation", "todays_motivation"),
]
# Create input fields for each section
self.inputs = {}
for title, name in sections:
label = QLabel(title)
label.setFont(QFont("Arial", 14))
label.setStyleSheet(f"color: {color3};")
text_edit = QTextEdit()
text_edit.setFixedHeight(80)
text_edit.setStyleSheet(f"background-color: {color4}; border-radius: 5px;")
self.inputs[name] = text_edit
scroll_layout.addWidget(label)
scroll_layout.addWidget(text_edit)
# Add the scroll area to the main layout
main_layout.addWidget(scroll_area)
# Create Save and Cancel buttons
button_layout = QHBoxLayout()
save_button = QPushButton("Save")
save_button.setFixedHeight(40)
save_button.setStyleSheet(self.button_style(color1))
save_button.pressed.connect(lambda: save_button.setStyleSheet(self.button_pressed_style()))
save_button.released.connect(lambda: save_button.setStyleSheet(self.button_style(color1)))
save_button.clicked.connect(self.save_data)
cancel_button = QPushButton("Cancel")
cancel_button.setFixedHeight(40)
cancel_button.setStyleSheet(self.button_style(color2))
cancel_button.pressed.connect(lambda: cancel_button.setStyleSheet(self.button_pressed_style()))
cancel_button.released.connect(lambda: cancel_button.setStyleSheet(self.button_style(color2)))
cancel_button.clicked.connect(self.cancel_data)
button_layout.addWidget(save_button)
button_layout.addWidget(cancel_button)
main_layout.addLayout(button_layout)
def button_style(self, color):
return f"""
QPushButton {{
background-color: {color};
color: black;
border: none;
border-radius: 20px;
font-size: 16px;
}}
"""
def button_pressed_style(self):
return """
QPushButton {
background-color: #CCCCCC;
color: black;
border: none;
border-radius: 20px;
font-size: 16px;
}
"""
def save_data(self):
# Save the data from inputs (placeholder implementation)
data = {name: field.toPlainText() for name, field in self.inputs.items()}
print("Data saved:", data)
# Implement actual saving logic here (e.g., writing to a file or database)
def cancel_data(self):
# Clear all input fields
for field in self.inputs.values():
field.clear()
def main():
app = QApplication(sys.argv)
window = PlannerApp()
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()
Requirements:
PyQt6: Make sure you have PyQt6 installed. You can install it using pip install pyqt6.
Features:
Sections: The application includes input sections for daily tasks, thanksgiving, study hours, today's song, when you woke up, and today's motivation.
Color Scheme: The colors #96CEB4, #FFAD60, #A02334, and #FFEEAD are used throughout the application for backgrounds, buttons, and text.
iPhone-style Buttons: The Save and Cancel buttons are styled to look like iPhone buttons with rounded corners and include simple animation effects when pressed.
Animations: Button animations are implemented by changing the stylesheet on pressed and released events.
Hamburger Menu: A basic hamburger menu is included in the menu bar with placeholder actions for Settings and About.
How to Run the Program:
Copy the code into a file named planner_app.py.
Ensure you have Python 3 and PyQt6 installed.
Run the program using the command python planner_app.py.
Note:
The save_data method currently prints the data to the console. You can modify this method to save the data to a file or a database as needed.
The button animations are simple and change the button style when pressed and released. For more advanced animations, you may need to use QPropertyAnimation or similar mechanisms in PyQt6.
The hamburger menu includes placeholder actions. You can add functionality to these actions as required.