94 lines
4.7 KiB
HTML
94 lines
4.7 KiB
HTML
<!doctype html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Styleguide – Pattern Delete Confirmation Overlay</title>
|
||
<link rel="stylesheet" href="../styleguide.css">
|
||
</head>
|
||
<body>
|
||
|
||
<h1 class="sg-main-heading">Pattern – Delete Confirmation Overlay</h1>
|
||
|
||
<section id="pattern-delete-confirmation-overlay" class="sg-delete-confirmation-pattern">
|
||
<p class="sg-preview-label">Pattern: Löschbestätigung mit Overlay</p>
|
||
|
||
<div class="sg-delete-confirmation-pattern__stage" data-pattern="delete-confirmation-overlay">
|
||
<article class="sg-card sg-object-card sg-delete-confirmation-pattern__target" aria-label="Zu löschendes Objekt">
|
||
<header class="sg-card-segment sg-card-segment--header sg-card-segment--darkblue sg-object-card__header">
|
||
<div class="sg-strong">Alcon Inc.</div>
|
||
<div class="sg-sandwich-menu-wrap" data-open="false" data-align="right" data-component="sandwich-menu" data-component-size="small">
|
||
<button class="sg-interaction-element sg-sandwich-button sg-sandwich-button--small" type="button" aria-expanded="false" aria-label="Menü öffnen" data-component-part="sandwich-trigger">
|
||
<span class="sg-sandwich-button__icon" aria-hidden="true">
|
||
<span class="sg-sandwich-button__line"></span>
|
||
<span class="sg-sandwich-button__line"></span>
|
||
<span class="sg-sandwich-button__line"></span>
|
||
</span>
|
||
</button>
|
||
</div>
|
||
</header>
|
||
<div class="sg-card-segment sg-card-segment--body sg-object-card__content">
|
||
<p class="sg-body">Objekt-Inhalt der Card. Während das Löschfenster sichtbar ist, wird dieses Objekt um 50% ausgegraut.</p>
|
||
</div>
|
||
<footer class="sg-card-segment sg-card-segment--body sg-object-card__actions-segment">
|
||
<div class="sg-object-card__actions">
|
||
<button class="sg-interaction-element sg-button sg-button--active sg-object-card__action" type="button">Peer-Group</button>
|
||
<button class="sg-interaction-element sg-button sg-button--active sg-object-card__action" type="button">Fundamentalanalyse</button>
|
||
</div>
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="sg-card sg-delete-confirmation-pattern__floating-card" aria-label="Löschbestätigung" role="dialog" aria-modal="true" aria-labelledby="delete-confirmation-title">
|
||
<div class="sg-card-segment sg-card-segment--body sg-delete-confirmation-pattern__body">
|
||
<p class="sg-body sg-delete-confirmation-pattern__text" id="delete-confirmation-title"><strong>Möchtest du Alcon Inc. wirklich löschen?</strong></p>
|
||
<p class="sg-body sg-delete-confirmation-pattern__text">Du kannst das nicht rückgängig machen. Bestätige durch Eingabe von <span class="sg-delete-confirmation-pattern__code">DELETE</span>.</p>
|
||
|
||
<label class="sg-labeled-input-row sg-delete-confirmation-pattern__input-row">
|
||
<span class="sg-label">Bestätigung</span>
|
||
<input
|
||
class="sg-interaction-element sg-input-single-line sg-input-single-line--inactive-selectable sg-form-inactive-selectable"
|
||
type="text"
|
||
placeholder="DELETE"
|
||
aria-label="Löschbestätigung durch DELETE"
|
||
data-delete-confirmation-input
|
||
>
|
||
</label>
|
||
|
||
<div class="sg-delete-confirmation-pattern__actions">
|
||
<button class="sg-interaction-element sg-button sg-button--active" type="button">Abbrechen</button>
|
||
<button
|
||
class="sg-interaction-element sg-button sg-button--process sg-button--process-inactive"
|
||
type="button"
|
||
disabled
|
||
aria-disabled="true"
|
||
data-delete-confirmation-submit
|
||
>
|
||
Löschen
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
</section>
|
||
|
||
<script>
|
||
const confirmationInput = document.querySelector('[data-delete-confirmation-input]');
|
||
const confirmationSubmitButton = document.querySelector('[data-delete-confirmation-submit]');
|
||
|
||
if (confirmationInput && confirmationSubmitButton) {
|
||
const updateDeleteConfirmationState = () => {
|
||
const isValid = confirmationInput.value === 'DELETE';
|
||
|
||
confirmationSubmitButton.disabled = !isValid;
|
||
confirmationSubmitButton.setAttribute('aria-disabled', String(!isValid));
|
||
confirmationSubmitButton.classList.toggle('sg-button--process-inactive', !isValid);
|
||
};
|
||
|
||
confirmationInput.addEventListener('input', updateDeleteConfirmationState);
|
||
updateDeleteConfirmationState();
|
||
}
|
||
</script>
|
||
|
||
</body>
|
||
</html>
|