@mindfiredigital/page-builder
Version:
865 lines (765 loc) • 15.9 kB
CSS
/* General Styles */
body,
html {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
background-color: #f4f4f9ab;
overflow: hidden;
}
/* Navbar for preview buttons */
#preview-navbar {
background-color: #f5f5f5; /* Dark grey background */
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1);
}
.preview-btn {
border: none;
padding: 8px;
cursor: pointer;
border-radius: 4px;
background-color: transparent;
}
.preview-btn:hover {
background-color: #bdc3c7; /* Lighter grey on hover */
}
/* App Container */
#app {
display: flex;
/* width: calc(215vh - 15px); */
height: calc(100vh - 85px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: #ffffff0a;
}
/* Sidebar (Left) */
#sidebar {
width: auto;
flex-shrink: 0;
background-color: #f5f5f5;
padding: 8px;
overflow-y: auto;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-top: 4px;
}
/* Canvas Area */
#canvas {
width: 100%;
background-color: #ffffff; /* White background */
padding: 5px;
overflow-y: auto;
overflow-x: auto;
box-sizing: border-box;
background-size: 20px 20px;
background-image: linear-gradient(to right, #efefef 1px, transparent 1px),
linear-gradient(to bottom, #efefef 1px, transparent 1px);
}
#customization {
display: none;
right: 0;
width: 240px;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 15px;
margin-top: 4px;
border: 1px solid #ecf0f1;
overflow: auto;
}
#sidebar h3 {
text-align: center;
font-size: 1.2em;
margin-bottom: 15px;
color: #ecf0f1; /* Light grey */
}
/* Draggable Items */
.draggable {
border-radius: 8px;
padding: 8px;
text-align: center;
cursor: grab;
transition: background-color 0.3s;
box-sizing: border-box; /* Ensure padding is included in width/height */
max-width: 100%; /* Prevent overflow on small screens */
overflow: hidden; /* Prevent content from spilling out */
}
.draggable:hover {
background-color: #bdc3c7; /* Lighter grey on hover */
outline: none; /* Remove any extra outlines */
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* Optional: Add subtle shadow */
}
.draggable:active {
cursor: grabbing;
opacity: 0.8;
}
/* Component Styles */
.component {
padding: 15px;
border: 1px solid #ddd;
background-color: #f9f9f9; /* Light grey */
border-radius: 5px;
cursor: pointer;
position: absolute;
transition: box-shadow 0.3s;
}
.component:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.text-component {
font-size: 16px;
color: #333; /* Dark text for readability */
}
.button-component {
padding: 10px 20px;
background-color: #3498db; /* Blue button background */
color: #ffffff; /* White text */
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.button-component:hover {
background-color: #2980b9; /* Darker blue on hover */
}
.header-component {
font-size: 24px;
font-weight: bold;
color: #333; /* Dark text */
margin: 10px 0;
}
.image-component {
max-width: 100%;
border-radius: 5px;
position: relative; /* Allow absolute positioned label to sit within */
display: flex;
justify-content: center;
width: 300px;
height: 300px;
}
/* Responsive Preview Modes */
.preview-desktop {
max-width: 100%;
}
.preview-tablet {
max-width: 768px;
margin-left: auto;
margin-right: auto;
}
.preview-mobile {
max-width: 375px;
margin-left: auto;
margin-right: auto;
}
/* Utility Classes */
.hidden {
display: none;
}
/* Editable components on the canvas */
.editable-component {
border: 1px solid #ddd;
padding: 10px;
margin: 5px;
border-radius: 4px;
cursor: text;
position: relative;
pointer-events: auto;
}
.component-resizer {
overflow: hidden ;
resize: both ;
}
/* Focused style for better visibility when editing */
/* .editable-component:focus {
outline: 2px solid #3498db;
}
.editable-component:hover {
outline: 1px solid #3498db;
} */
.container-highlight {
outline: 1px solid #3498db;
}
/* Ensures child containers are styled separately */
.container-component .editable-component {
pointer-events: auto;
}
/* Container Component */
.container-component {
min-height: 100px;
padding: 10px;
margin: 5px;
border: 0.5px dashed #ccc; /* Light grey dashed border */
display: flex;
flex-direction: column;
position: relative;
pointer-events: auto;
}
/* Draggable Icons */
.component-icon {
width: 40px; /* Icon size */
height: 40px; /* Maintain aspect ratio */
object-fit: contain;
}
.nav-icon {
width: 24px; /* Adjust icon size */
height: 24px; /* Maintain aspect ratio */
object-fit: contain; /* Maintain aspect ratio */
}
.left-buttons,
.right-buttons {
display: flex;
gap: 10px;
}
.center-text {
font-size: 18px;
font-weight: bold;
color: #000708;
text-align: center;
flex-grow: 1;
display: flex;
justify-content: center;
}
.component-label,
.column-label {
position: absolute;
top: 1px;
left: 0;
background: rgba(0, 0, 0, 0.7);
color: white;
font-size: 12px;
padding: 2px 4px;
border-radius: 3px;
display: none;
z-index: 10;
pointer-events: none;
}
.editable-component:hover .component-label {
display: block;
}
/* Show column-label on hover of its column */
.column:hover .column-label {
display: block;
}
/* Pencil button styling */
.upload-btn {
position: absolute;
top: 10px;
left: 10px;
background-color: transparent;
color: white;
border: none;
padding: 5px;
border-radius: 50%;
cursor: pointer;
font-size: 18px;
display: none; /* Initially hidden */
opacity: 0.5;
z-index: 10;
transition: opacity 200ms ease;
}
/* Show the pencil button when hovering over the image component */
.image-component:hover .upload-btn {
display: block;
}
.upload-btn:hover {
opacity: 1;
background-color: rgba(0, 0, 0, 0.253);
}
/* Notification styling */
.notification {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #4caf50; /* Green */
color: white;
padding: 10px 20px;
border-radius: 5px;
font-size: 16px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
.notification.visible {
opacity: 1;
}
.notification.hidden {
opacity: 0;
}
/* Styling for dialog box */
.dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.dialog.hidden {
display: none;
}
.dialog-content {
background: white;
padding: 20px;
border-radius: 8px;
text-align: center;
width: 300px;
}
.dialog-btn {
margin: 10px;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
#dialog-yes {
background-color: #e74c3c;
color: white;
}
#dialog-no {
background-color: #95a5a6;
color: white;
}
/* Control panel that appears on hover */
.component-controls {
display: none;
position: absolute;
top: 1px;
right: 1px;
align-items: center;
z-index: 10;
cursor: pointer;
}
.delete-icon {
width: 16px;
height: 16px;
vertical-align: middle; /* Center-align if needed */
cursor: pointer;
}
/* Show controls on component hover */
.editable-component:hover .component-controls {
display: flex;
gap: 2px;
}
/* Control wrapper styling */
.control-wrapper {
display: flex;
align-items: center;
margin-bottom: 10px;
gap: 10px;
}
#controls {
display: flex;
flex-direction: column;
}
.control-wrapper label {
display: block;
margin-bottom: 6px;
font-size: 14px;
font-weight: 500;
color: #333;
}
.control-wrapper input[type='number'] {
width: 40px;
padding: 4px 8px;
font-size: 14px;
margin-right: 4px;
border: 1px solid #ccc;
border-radius: 4px;
}
.control-wrapper input[type='color'] {
width: 25px;
height: 25px;
border: none;
cursor: pointer;
border-radius: 100%;
padding: 1px;
margin: 0;
overflow: hidden;
}
/* Select dropdown styling */
.control-wrapper select {
width: 60px;
padding: 8px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #fff;
appearance: none;
}
/* Increment/Decrement Buttons for Number Inputs */
.control-wrapper .step-buttons {
display: inline-flex;
flex-direction: column;
justify-content: center;
}
.control-wrapper .step-buttons button {
width: 40px;
height: 20px;
border: 1px solid #ccc;
border-radius: 2px;
background-color: #f1f1f1;
cursor: pointer;
font-size: 12px;
text-align: center;
padding: 0;
line-height: 20px;
user-select: none;
}
.control-wrapper .step-buttons button:hover {
background-color: #e7e7e7;
}
.control-wrapper .step-buttons button:active {
background-color: #ddd;
}
#component-name {
background-color: #f5f5f5; /* Light background color */
padding: 3px; /* Add some padding for spacing */
margin-bottom: 20px; /* Add space below the box */
border: 2px solid #ddd; /* Light border around the box */
border-radius: 5px; /* Rounded corners */
font-weight: bold; /* Make the text bold */
font-size: 12px; /* Adjust font size */
color: #333; /* Dark text for readability */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional subtle shadow */
width: auto;
}
#component-name span {
font-size: 12px; /* Slightly smaller text for the component ID */
color: #666; /* Lighter color for the component ID */
}
#color-value {
display: inline-block;
font-size: 13px;
border: 1px solid #ccc;
border-radius: 4px;
color: #333;
}
.close-button {
position: absolute;
top: 90px;
right: 10px;
background-color: transparent;
color: rgb(7, 7, 7);
border: none;
border-radius: 50%;
width: 30px;
height: 30px;
cursor: pointer;
font-size: 30px;
text-align: center;
line-height: 30px;
display: flex;
justify-content: center;
align-items: center;
transition: transform 0.2s;
}
.close-button:hover {
transform: scale(1.1);
background-color: #706e6e42;
}
/* Full-screen modal styles */
#preview-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
z-index: 9999;
overflow: auto;
}
/* Close button styles */
#close-modal-btn {
position: absolute;
top: 10px;
left: 10px;
background-color: #f5f5f5;
color: rgb(10, 9, 9);
border: none;
border-radius: 50%;
width: 30px;
height: 30px;
font-size: 18px;
cursor: pointer;
z-index: 10000;
transition: transform 0.2s;
}
#close-modal-btn:hover {
transform: scale(1.1);
background-color: #bebebe;
}
/* Basic Modal Styles */
.modal {
display: none; /* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
z-index: 1000;
transition: opacity 0.3s ease;
}
.modal.show {
display: flex;
opacity: 1;
}
.modal.hide {
opacity: 0;
}
/* Modal Content */
.modal-content {
position: relative;
background-color: white;
width: 90%;
height: 70%;
max-width: 1000px;
max-height: 600px;
display: flex;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
padding: 10px;
}
/* Each Section of the Modal */
.modal-section {
width: 50%;
padding: 10px;
}
.modal-section h2 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
/* Code Block Styles */
.code-block {
width: 95%;
height: 80%;
font-family: 'Courier New', monospace;
font-size: 14px;
padding: 10px;
border-radius: 4px;
border: 1px solid #ccc;
color: #de8f5f;
background-color: #342931;
overflow-y: auto;
white-space: pre-wrap;
line-height: 1.5;
}
/* Syntax Highlighting */
.tag {
color: #66d9ef;
}
.attribute {
color: #a6e22e;
}
.string {
color: #e6db74;
}
.property {
color: #66d9ef;
}
.value {
color: #e6db74;
}
.bracket {
color: #ec8305;
}
.button-wrapper {
display: flex;
flex-direction: column;
padding: 20px;
}
.export-btn {
position: absolute;
bottom: 15px;
right: 15px;
padding: 10px 20px;
font-size: 14px;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
text-align: center;
outline: none;
transition: background-color 0.2s ease-in-out;
}
.export-btn:hover {
background-color: #0056b3;
}
.layers-mode-toggle {
display: flex;
margin-bottom: 10px;
}
.layers-mode-toggle button {
flex: 1;
padding: 10px;
background-color: #f0f0f0;
border: none;
cursor: pointer;
}
.layers-mode-toggle button.active {
background-color: #e0e0e0;
font-weight: bold;
}
.hidden {
display: none;
}
/* Remove default padding and add animation */
ul {
margin: 0; /* Remove any default margins */
padding: 0; /* Remove any default padding */
list-style: none; /* Optional: Remove bullets if not needed */
}
.layer-item {
display: flex;
align-items: center;
justify-content: space-between;
list-style: none;
padding: 8px 12px;
border-bottom: 1px solid #ddd;
transition: background-color 300ms ease;
}
.layer-item:hover {
background-color: #f9f9f9;
transform: scale(1.02);
}
.layer-children {
padding: 0; /* No padding for nested children */
margin: 0;
max-height: 0;
padding: 0;
list-style: none;
transition:
max-height 300ms ease,
opacity 300ms ease;
}
.layer-expand-toggle {
cursor: pointer;
margin-right: 8px;
}
.layer-children.expanded {
max-height: none; /* Allow height to expand */
opacity: 1; /* Smoothly fade in */
}
/* Drop preview for grid corner */
.drop-preview {
border: 2px dashed rgba(0, 0, 255, 0.7); /* Dashed blue border */
background-color: rgba(0, 0, 255, 0.1); /* Light blue background */
position: absolute;
pointer-events: none; /* Ensure it doesn't interfere with events */
display: none; /* Initially hidden */
}
.drop-preview.visible {
display: block;
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
background: transparent;
border: none;
font-size: 24px;
cursor: pointer;
color: #333;
}
.close-btn:hover {
color: red; /* Optional: Change color on hover */
}
.categoryHeading {
margin: 0%;
text-align: center;
}
.video-component {
width: 300px;
height: 300px;
position: relative;
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #ccc;
}
.video-component video {
display: none;
}
.pencil-button {
position: absolute;
top: 10px;
left: 10px;
background: transparent;
border: none;
cursor: pointer;
font-size: 24px;
}
.upload-text {
color: #666;
text-align: center;
}
.table-component .button-container {
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none; /* Prevent interaction when hidden */
}
/* Show buttons on hover of the table-component */
.table-component:hover .button-container {
opacity: 1;
pointer-events: auto; /* Allow interaction when visible */
}
/* Link component css*/
.link-component {
border: none;
display: flex;
gap: 8px;
align-items: center;
padding: 8px;
}
.link-component-label {
text-decoration: none;
color: blue;
font-size: 14px;
cursor: pointer;
margin: 10px;
}
.edit-link {
background-color: transparent ;
position: absolute;
bottom: 1px;
left: 4px;
text-decoration: none;
padding: 4px 8px;
cursor: pointer;
display: none;
border: none;
font-size: 12px;
}
.link-component:hover .edit-link {
display: block;
/* Show the button when hovering over the container */
}
.edit-link-form {
display: none;
flex-direction: column;
gap: 8px;
padding: 8px;
}
.input-field {
padding: 4px;
margin-bottom: 4px;
}
.save-button {
padding: 4px 8px;
cursor: pointer;
}
.checkbox-label {
display: flex;
align-items: center;
}