css
This commit is contained in:
+12
-13
@@ -22,24 +22,23 @@ if (!isset($_SESSION["user"])) {
|
||||
<div id="block-container"></div>
|
||||
|
||||
<!-- Plus-Button und das Pop-up-Menü -->
|
||||
<div id="add-block-control" class="add-block-control">
|
||||
<button type="button" id="plus-button" class="plus-button">+</button>
|
||||
<div id="block-popup" class="block-popup hidden">
|
||||
<div id="add-block-control" class="article-editor-scope add-block-control">
|
||||
<button type="button" id="plus-button" class="article-editor-scope plus-button">+</button>
|
||||
<div id="block-popup" class="article-editor-scope block-popup hidden">
|
||||
<button type="button" data-type="text">Textblock</button>
|
||||
<button type="button" data-type="image">Bild einfügen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Unsichtbares Textfeld, das die JSON-Daten hält und an den Controller postet -->
|
||||
<textarea id="content" name="content" style="display:none;">
|
||||
<?php
|
||||
if (isset($_SESSION['old_content']) && !empty($_SESSION['old_content'])){
|
||||
echo htmlspecialchars($_SESSION['old_content']);
|
||||
unset($_SESSION['old_content']);
|
||||
} else {
|
||||
echo '[]'; // Standardmäßig ein leeres JSON-Array
|
||||
}?>
|
||||
</textarea>
|
||||
<!-- Unsichtbares Textfeld, das die JSON-Daten hält und an den Controller postet -->
|
||||
<textarea id="content" name="content" style="display:none;"><?php
|
||||
if (isset($_SESSION['old_content']) && !empty($_SESSION['old_content'])){
|
||||
echo htmlspecialchars($_SESSION['old_content']);
|
||||
unset($_SESSION['old_content']);
|
||||
} else {
|
||||
echo '[]'; // Standardmäßig ein leeres JSON-Array
|
||||
}
|
||||
?></textarea>
|
||||
</main>
|
||||
|
||||
<!-- Seitenleiste -->
|
||||
|
||||
@@ -90,6 +90,135 @@
|
||||
padding: 18px 12px;
|
||||
}
|
||||
|
||||
/* Container für die dynamisch per JS eingefügten Blöcke */
|
||||
.article-editor-scope #block-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
/* Styling für jeden einzelnen dynamisch generierten Block */
|
||||
.article-editor-scope .editor-block {
|
||||
position: relative; /* Wichtig für die absolute Positionierung des Lösch-Buttons */
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
background-color: #fafafa;
|
||||
border: 1px dashed #cccccc;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Textarea innerhalb eines dynamischen Textblocks */
|
||||
.article-editor-scope .editor-block textarea {
|
||||
width: 100%;
|
||||
min-height: 120px;
|
||||
padding: 10px;
|
||||
border: 1px solid #dddddd;
|
||||
border-radius: 4px;
|
||||
font-family: inherit;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.6;
|
||||
resize: vertical;
|
||||
outline: none;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
/* Komfort-Löschbutton oben rechts an jedem Block */
|
||||
.article-editor-scope .delete-block-btn {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
right: -10px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
background-color: #e74c3c;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.article-editor-scope .delete-block-btn:hover {
|
||||
background-color: #c0392b;
|
||||
}
|
||||
|
||||
/* Steuerungselement für den Plus-Button und das Pop-up */
|
||||
.article-editor-scope .add-block-control {
|
||||
position: relative; /* Dient als Anker für das absolut positionierte Pop-up */
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
align-self: flex-start; /* Verhindert, dass der Button die volle Breite spannt */
|
||||
}
|
||||
|
||||
/* Der runde Plus-Button */
|
||||
.article-editor-scope .plus-button {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
border-radius: 50%;
|
||||
background-color: #3498db;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
font-size: 26px;
|
||||
font-weight: 300;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
||||
transition: background-color 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.article-editor-scope .plus-button:hover {
|
||||
background-color: #2980b9;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* Das Pop-up Menü */
|
||||
.article-editor-scope .block-popup {
|
||||
position: absolute;
|
||||
left: 60px; /* Platziert das Menü rechts neben dem Plus-Button */
|
||||
top: 50%;
|
||||
transform: translateY(-50%); /* Zentriert das Menü vertikal zum Button */
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
|
||||
z-index: 999;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Die entscheidende Klasse zum Ausblenden */
|
||||
.article-editor-scope .block-popup.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Buttons im Pop-up (Textblock / Bild einfügen) */
|
||||
.article-editor-scope .block-popup button {
|
||||
background-color: #f8f9fa;
|
||||
border: 1px solid #dcdde1;
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #2f3640;
|
||||
transition: background-color 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.article-editor-scope .block-popup button:hover {
|
||||
background-color: #f1f2f6;
|
||||
border-color: #b2bec3;
|
||||
}
|
||||
|
||||
/* Responsive Anpassungen unter 760px (für z.B. Smartphones) */
|
||||
@media (max-width: 760px) {
|
||||
.article-editor-scope.editor-container {
|
||||
@@ -113,4 +242,8 @@
|
||||
border-left: none;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.article-editor-scope .editor-block textarea {
|
||||
min-height: 150px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user