Files
marketing-assistant-ai/frontend/styles.css
T
Michael Ikehi c1a894ad50 feat(feedback): Add content improvement feedback system
Frontend (frontend/app.js):

- Add textarea for improvement feedback

- Add submit button with loading state

- Handle API response and display improved content

Backend (backend/copywriter.py):

- Add improve_copy() method using Cohere API

- Integrate retry mechanism for API calls

Backend (backend/main.py):

- Add /improve-content POST endpoint

- Implement error handling and return improved content with metadata

Testing:

- Verified feedback submission flow

- Confirmed improved content generation

- Tested error scenarios and loading states
2025-04-21 17:32:33 +01:00

1028 lines
17 KiB
CSS

/* Global Variables */
:root {
--primary-color: #6236FF;
--primary-light: #8E6FFF;
--primary-dark: #4B2AD8;
--secondary-color: #FFB800;
--success-color: #1AC888;
--danger-color: #FF4757;
--warning-color: #FFBA00;
--dark-color: #161925;
--grey-100: #F5F7FA;
--grey-200: #E4E8F0;
--grey-300: #CBD2E0;
--grey-400: #9AA5B9;
--grey-500: #6B7A99;
--grey-600: #4A5568;
--grey-700: #2D3748;
--grey-800: #1A202C;
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.15);
--font-family: 'Poppins', sans-serif;
}
/* Reset & Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: var(--font-family);
font-size: 15px;
line-height: 1.5;
color: var(--grey-700);
background-color: var(--grey-100);
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 0.5rem;
font-weight: 600;
line-height: 1.2;
color: var(--grey-800);
}
a {
color: var(--primary-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* Layout */
.app-container {
display: flex;
min-height: 100vh;
}
.sidebar {
width: 240px;
background-color: var(--grey-800);
display: flex;
flex-direction: column;
color: white;
padding: 20px 0;
position: fixed;
height: 100vh;
box-shadow: var(--shadow-md);
}
.content {
flex: 1;
margin-left: 240px;
padding: 20px;
max-width: calc(100vw - 240px);
}
/* Logo */
.logo {
padding: 10px 20px 30px;
text-align: center;
}
.logo h2 {
color: white;
background-color: var(--primary-color);
width: 60px;
height: 60px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
font-size: 26px;
font-weight: 700;
}
/* Menu */
.menu {
list-style: none;
margin-bottom: auto;
}
.menu li {
padding: 12px 20px;
cursor: pointer;
display: flex;
align-items: center;
transition: background-color 0.2s;
color: var(--grey-300);
margin-bottom: 4px;
border-left: 3px solid transparent;
}
.menu li i {
margin-right: 12px;
font-size: 16px;
width: 20px;
text-align: center;
}
.menu li:hover {
background-color: rgba(255, 255, 255, 0.05);
color: white;
}
.menu li.active {
background-color: rgba(255, 255, 255, 0.1);
color: white;
border-left: 3px solid var(--primary-color);
}
/* User Info */
.user-info {
display: flex;
align-items: center;
padding: 16px 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
margin-top: auto;
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
overflow: hidden;
margin-right: 12px;
}
.user-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.user-name {
font-weight: 500;
font-size: 14px;
}
/* Header */
header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid var(--grey-200);
}
.header-actions {
display: flex;
gap: 10px;
}
/* Page */
.page {
display: none;
}
.page.active {
display: block;
}
.page-header {
margin-bottom: 30px;
}
.page-header h2 {
margin-bottom: 8px;
font-size: 24px;
}
.page-header p {
color: var(--grey-500);
}
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 8px 16px;
border-radius: var(--radius-md);
border: none;
font-weight: 500;
font-size: 14px;
cursor: pointer;
transition: all 0.2s;
}
.btn i {
margin-right: 8px;
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover {
background-color: var(--primary-dark);
}
.btn-secondary {
background-color: var(--grey-200);
color: var(--grey-700);
}
.btn-secondary:hover {
background-color: var(--grey-300);
}
.btn-outline {
background-color: transparent;
color: var(--primary-color);
border: 1px solid var(--primary-color);
}
.btn-outline:hover {
background-color: var(--primary-color);
color: white;
}
.btn-lg {
padding: 12px 20px;
font-size: 16px;
}
.btn-icon {
padding: 8px;
border-radius: 50%;
width: 36px;
height: 36px;
display: inline-flex;
align-items: center;
justify-content: center;
background: transparent;
color: var(--grey-600);
border: none;
cursor: pointer;
transition: all 0.2s;
}
.btn-icon:hover {
background-color: var(--grey-200);
color: var(--grey-800);
}
.btn-icon i {
margin-right: 0;
}
/* Forms */
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: var(--grey-700);
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
width: 100%;
padding: 10px 12px;
border-radius: var(--radius-md);
border: 1px solid var(--grey-300);
font-family: var(--font-family);
font-size: 15px;
transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(98, 54, 255, 0.1);
}
.form-row {
display: flex;
gap: 20px;
margin-bottom: 20px;
}
.form-row .form-group {
flex: 1;
margin-bottom: 0;
}
.form-actions {
margin-top: 30px;
display: flex;
gap: 15px;
}
.form-section {
margin-bottom: 30px;
}
.form-section h3 {
font-size: 18px;
margin-bottom: 12px;
}
.form-section p {
margin-bottom: 15px;
color: var(--grey-500);
}
/* Checkbox */
.checkbox-group {
display: flex;
gap: 20px;
}
.checkbox {
display: flex;
align-items: center;
position: relative;
padding-left: 30px;
cursor: pointer;
font-weight: normal;
user-select: none;
}
.checkbox input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 20px;
width: 20px;
background-color: white;
border: 1px solid var(--grey-300);
border-radius: var(--radius-sm);
}
.checkbox:hover input ~ .checkmark {
border-color: var(--grey-400);
}
.checkbox input:checked ~ .checkmark {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.checkbox input:checked ~ .checkmark:after {
display: block;
}
.checkbox .checkmark:after {
left: 7px;
top: 3px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
/* Generation Form */
.generation-form {
background-color: white;
border-radius: var(--radius-lg);
padding: 25px;
box-shadow: var(--shadow-sm);
margin-bottom: 30px;
}
/* Result Container */
.result-container {
background-color: white;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
margin-top: 30px;
}
.result-container.hidden {
display: none;
}
.result-header {
padding: 20px 25px;
border-bottom: 1px solid var(--grey-200);
display: flex;
justify-content: space-between;
align-items: center;
}
.result-header h3 {
margin-bottom: 0;
}
.result-actions {
display: flex;
gap: 10px;
}
.result-content {
white-space: pre-wrap;
font-family: var(--font-family);
line-height: 1.6;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: var(--shadow-sm);
}
.result-content ul,
.result-content ol {
padding-left: 20px;
margin: 1em 0;
}
.result-content p {
margin: 1em 0;
}
/* Style bullet points */
.result-content {
margin-left: 1em;
display: list-item;
list-style-type: disc;
}
.metadata-panel {
background-color: var(--grey-100);
padding: 20px 25px;
border-top: 1px solid var(--grey-200);
}
.metadata-item {
margin-bottom: 15px;
}
.metadata-label {
display: block;
font-weight: 500;
margin-bottom: 5px;
color: var(--grey-600);
}
.score-bar {
height: 8px;
background-color: var(--grey-200);
border-radius: 4px;
overflow: hidden;
}
.score-fill {
height: 100%;
background-color: var(--success-color);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 10px;
font-weight: 700;
transition: width 0.5s ease;
}
.suggestions-container {
margin-top: 20px;
}
.suggestions-container h4 {
margin-bottom: 10px;
color: var(--grey-600);
font-size: 15px;
}
.suggestions-list {
list-style: none;
}
.suggestions-list li {
margin-bottom: 8px;
padding: 8px 12px;
background-color: white;
border-radius: var(--radius-md);
border: 1px solid var(--grey-200);
cursor: pointer;
transition: all 0.2s;
}
.suggestions-list li:hover {
border-color: var(--primary-color);
background-color: rgba(98, 54, 255, 0.05);
}
.improvement-panel {
padding: 20px 25px;
border-top: 1px solid var(--grey-200);
}
.improvement-panel.hidden {
display: none;
}
.improvement-panel h4 {
margin-bottom: 10px;
}
/* Loading Indicator */
.loading-indicator {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 40px 0;
}
.loading-indicator.hidden {
display: none;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid var(--grey-200);
border-top: 4px solid var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 15px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Templates Grid */
.templates-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 20px;
margin-top: 20px;
}
.template-card {
background-color: white;
border-radius: var(--radius-lg);
padding: 25px;
box-shadow: var(--shadow-sm);
transition: all 0.2s;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.template-card:hover {
transform: translateY(-5px);
box-shadow: var(--shadow-md);
}
.template-icon {
width: 60px;
height: 60px;
border-radius: 50%;
background-color: var(--primary-light);
color: white;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 15px;
font-size: 24px;
}
.template-card h3 {
margin-bottom: 8px;
}
.template-card p {
color: var(--grey-500);
margin-bottom: 20px;
}
.template-card button {
margin-top: auto;
}
.template-card.template-add {
border: 2px dashed var(--grey-300);
background-color: transparent;
}
.template-card.template-add .template-icon {
background-color: var(--grey-300);
}
.template-card.template-add:hover {
border-color: var(--primary-color);
}
/* History and Training List */
.history-filters,
.training-filters {
display: flex;
gap: 15px;
margin-bottom: 20px;
}
.history-filters .form-group,
.training-filters .form-group {
margin-bottom: 0;
flex: 1;
}
.history-list,
.training-list {
background-color: white;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
overflow: hidden;
}
.history-item,
.training-item {
display: flex;
padding: 15px 20px;
border-bottom: 1px solid var(--grey-200);
align-items: center;
}
.history-item:last-child,
.training-item:last-child {
border-bottom: none;
}
.history-item-type,
.training-item-type {
width: 80px;
text-align: center;
padding: 4px 8px;
border-radius: var(--radius-md);
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
}
.history-item-type.email_campaign,
.training-item-type.email_campaign {
background-color: var(--primary-light);
color: white;
}
.history-item-type.social_media,
.training-item-type.social_media {
background-color: var(--secondary-color);
color: white;
}
.history-item-type.blog_post,
.training-item-type.blog_post {
background-color: var(--success-color);
color: white;
}
.history-item-type.website_copy,
.training-item-type.website_copy {
background-color: var(--warning-color);
color: white;
}
.history-item-content,
.training-item-content {
flex: 1;
padding: 0 20px;
}
.history-item-content h4,
.training-item-content h4 {
margin-bottom: 5px;
}
.history-item-content p,
.training-item-content p {
color: var(--grey-500);
font-size: 14px;
}
.history-item-date {
color: var(--grey-500);
font-size: 14px;
min-width: 100px;
text-align: right;
margin-right: 15px;
}
.history-item-actions,
.training-item-actions {
display: flex;
gap: 5px;
}
.metrics {
display: flex;
gap: 10px;
margin-top: 5px;
}
.metric {
font-size: 13px;
color: var(--grey-600);
background-color: var(--grey-100);
padding: 2px 8px;
border-radius: var(--radius-sm);
}
/* Brand Style */
.tag-selector {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 10px;
}
.tag-selector.read-only .tag {
cursor: default;
}
.style-description {
margin-top: 15px;
font-style: italic;
color: var(--grey-600);
line-height: 1.6;
}
.style-note {
display: flex;
align-items: center;
color: var(--grey-600);
font-style: italic;
}
.style-note i {
margin-right: 8px;
color: var(--grey-500);
}
.alert {
padding: 15px;
border-radius: var(--radius-md);
margin-top: 15px;
display: flex;
align-items: center;
}
.alert i {
margin-right: 10px;
font-size: 18px;
}
.alert-info {
background-color: rgba(98, 54, 255, 0.1);
color: var(--primary-dark);
border-left: 4px solid var(--primary-color);
}
.tag {
display: inline-flex;
align-items: center;
padding: 6px 12px;
background-color: var(--grey-200);
color: var(--grey-700);
border-radius: 20px;
font-size: 14px;
cursor: pointer;
transition: all 0.2s;
}
.tag.selected {
background-color: var(--primary-color);
color: white;
}
.tag.removable {
padding-right: 8px;
}
.tag.removable i {
margin-left: 8px;
font-size: 12px;
}
.tag-editor {
margin-top: 10px;
}
.tag-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 10px;
}
.tag-input-container {
display: flex;
gap: 10px;
}
.tag-input-container input {
flex: 1;
}
.terminology-table {
margin-top: 15px;
border: 1px solid var(--grey-200);
border-radius: var(--radius-md);
overflow: hidden;
}
.terminology-header {
display: flex;
background-color: var(--grey-100);
padding: 12px 15px;
font-weight: 600;
border-bottom: 1px solid var(--grey-200);
}
.terminology-row {
display: flex;
padding: 12px 15px;
border-bottom: 1px solid var(--grey-200);
align-items: center;
}
.terminology-row:last-child {
border-bottom: none;
}
.term-avoid {
flex: 1;
}
.term-use {
flex: 1;
}
.term-actions {
width: 50px;
text-align: right;
}
.terminology-row.add-row input {
width: 100%;
border: none;
padding: 5px 0;
background: transparent;
}
.terminology-row.add-row input:focus {
outline: none;
box-shadow: none;
}
/* Training Tabs */
.training-tabs {
display: flex;
margin-bottom: 20px;
border-bottom: 1px solid var(--grey-200);
}
.tab {
padding: 12px 20px;
cursor: pointer;
position: relative;
color: var(--grey-500);
}
.tab.active {
color: var(--primary-color);
font-weight: 500;
}
.tab.active:after {
content: '';
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 2px;
background-color: var(--primary-color);
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Responsive */
@media (max-width: 992px) {
.sidebar {
width: 80px;
padding: 15px 0;
}
.logo h2 {
width: 50px;
height: 50px;
font-size: 20px;
}
.menu li {
justify-content: center;
padding: 12px;
}
.menu li i {
margin-right: 0;
font-size: 20px;
}
.menu li span {
display: none;
}
.user-info {
justify-content: center;
padding: 10px;
}
.user-avatar {
margin-right: 0;
}
.user-name {
display: none;
}
.content {
margin-left: 80px;
max-width: calc(100vw - 80px);
}
}
@media (max-width: 768px) {
.form-row {
flex-direction: column;
gap: 10px;
}
.templates-grid {
grid-template-columns: 1fr;
}
.history-item,
.training-item {
flex-direction: column;
align-items: flex-start;
}
.history-item-type,
.training-item-type {
margin-bottom: 10px;
}
.history-item-content,
.training-item-content {
padding: 0;
margin-bottom: 10px;
}
.history-item-date {
text-align: left;
margin-bottom: 10px;
}
.checkbox-group {
flex-direction: column;
gap: 10px;
}
}