WEBLEB
Startseite
Editor
Anmelden
Pro
Deutsch
English
Français
Español
Português
Deutsch
Italiano
हिंदी
HTML-Nachrichtenblase mit SVG-Design
186
weekzim
Im Editor öffnen
Veröffentlichen Sie Ihren Code
Empfohlen
29 July 2025
Firmenkartenliste mit Branding und Marketing
28 December 2024
Eine mit Indizes erstellte Matrix-Homepage
21 October 2024
Einstellige Eingaben mit einem Element
HTML
Copy
messages
Messages
CSS
Copy
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,100..1000&display=swap"); :root{ --c-glass: #bbbbbc; --c-light: #fff; --c-dark: #000; --c-content: #224; --c-action: linear-gradient(94deg, rgb(0, 144, 247), rgb(186, 98, 252), rgb(242, 65, 107), rgb(245, 86, 0)); --c-bg: #e8e8e9; --m-bg :#a5a5a5 ; --glass-reflex-dark: 1; --glass-reflex-light: 1; --saturation: 150%; font-size: 20px; font-family: "DM Sans", sans-serif; font-optical-sizing: auto; background: var(--c-bg); color: var(--c-content); transition: background 400ms cubic-bezier(1, 0, 0.4, 1), color 400ms cubic-bezier(1, 0, 0.4, 1); } html { scroll-behavior: smooth; } html.dark-mode{ --c-glass: #bbbbbc; --c-light: #fff; --c-dark: #000; --c-content: #e1e1e1; --c-bg: #1b1b1d; --glass-reflex-dark: 2; --glass-reflex-light: 0.3; --saturation: 150%; } header { z-index: 100; position: fixed; width: 100%; margin-top : 15px; } body { display: block; margin: 0px; } a { text-decoration: none; color: var(--c-content); text-decoration-thickness: 0.05em; text-underline-position: under; text-decoration-color: color-mix(in srgb, currentColor, transparent 70%); transition: color 160ms, text-decoration-color 160ms; } a:hover { background: var(--c-action); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; text-decoration-color: color-mix(in srgb, currentColor, transparent 30%); } /*EFFET GLASS*/ .glass_menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 30px; } .glass_container { z-index: 1; display: flex; align-items: center; gap: 8px; height: 70px; box-sizing: border-box; padding: 8px 12px 10px; border: none; border-radius: 99em; font-size: var(--fz); background-color: rgba(255, 255, 255, 0.1); /* fallback */ background-color: color-mix(in srgb, var(--c-glass) 12%, transparent); backdrop-filter: blur(8px) saturate(var(--saturation)); -webkit-backdrop-filter: blur(8px) saturate(var(--saturation)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 10%), transparent), inset 1.8px 3px 0px -2px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 90%), transparent), inset -2px -2px 0px -2px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 80%), transparent), inset -3px -8px 1px -6px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent), inset -0.3px -1px 4px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 12%), transparent), inset -1.5px 2.5px 0px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent), inset 0px 3px 4px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent), inset 2px -6.5px 1px -4px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent), 0px 1px 5px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent), 0px 6px 16px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 8%), transparent); } #box2{ display: none; } .theme::after { content: ""; position: absolute; left: 4px; top: 4px; display: block; width: 84px; height: calc(100% - 8.5px); border-radius: 99em; background-color: color-mix(in srgb, var(--c-glass) 36%, transparent); z-index: -1; pointer-events: none; box-shadow: inset 0 0 0 1px color-mix( in srgb, var(--c-light) calc(var(--glass-reflex-light) * 10%), transparent ), inset 2px 1px 0px -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 90%), transparent), inset -1.5px -1px 0px -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 80%), transparent), inset -2px -6px 1px -5px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent), inset -1px 2px 3px -1px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent ), inset 0px -4px 1px -2px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent ), 0px 3px 6px 0px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 8%), transparent ); } .theme[data-selected="1"]::after { translate: 0 0; transform-origin: right; transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1), box-shadow 400ms cubic-bezier(1, 0, 0.4, 1), translate 400ms cubic-bezier(1, 0, 0.4, 1); animation: scaleToggle 440ms ease; transform-origin: left; } .theme[data-selected="2"]::after { translate: 76px 0; transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1), box-shadow 400ms cubic-bezier(1, 0, 0.4, 1), translate 400ms cubic-bezier(1, 0, 0.4, 1); animation: scaleToggle2 440ms ease; animation: scaleToggle2 440ms ease; transform-origin: right; } .theme_container { color: var(--c-content); display: flex; justify-content: center; align-items: center; padding: 0 16px; width: 68px; height: 100%; box-sizing: border-box; border-radius: 99em; opacity: 1; transition: all 160ms; } .theme_container:hover { cursor: pointer; } .theme_container:hover .switcher__icon { scale: 1.2; } .theme_container:has(input:checked) { color: var(--c-content); cursor: auto; } .theme_container:has(input:checked) .switcher__icon { scale: 1; } .theme_input{ clip: rect(0 0 0 0); clip-path: inset(100%); height: 1px; width: 1px; overflow: hidden; position: absolute; white-space: nowrap; } .theme_icon { fill: var(--c-content); display: block; width: 100%; transition: transform 200ms cubic-bezier(0.5, 0, 0, 1), fill 200ms ease-in-out; } .theme_icon:hover { transform: scale(1.1); fill: url(#themeGradient); /* applique le dégradé défini dans le <defs> */ } .theme_filter { position: absolute; width: 0; height: 0; z-index: -1; } .glass_hour { display: flex; justify-content: center; width: 80px; max-width: 80px; text-align: center; } .glass_hour p { line-height: 0; margin: 0; } .glass_nav{ width: 550px; } .nav_list{ display: flex; align-items: center; padding: 0 10px; justify-content: center; } .nav_list li{ list-style: none; } .nav_link { padding: 20px 10px; } .active{ background: var(--c-action); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; } .bouton-off { pointer-events: none; /* empêche tout clic */ cursor: default; /* change le curseur */ } /*ANNIMATIONS*/ @keyframes scaleToggle { 0% { scale: 1 1; } 50% { scale: 1.1 1; } 100% { scale: 1 1; } } @keyframes scaleToggle2 { 0% { scale: 1 1; } 50% { scale: 1.2 1; } 100% { scale: 1 1; } } /* ////////////////////////////////////////// / Article Styles //////////////////////// */ .article { display: flex; flex-direction: column; align-items: center; } section{ padding-top: 50px; } h1, h2, p, blockquote { width: 100%; max-width: 700px; box-sizing: border-box; } h1 { font-size: 3em; margin: 1.4em 0 0.6em; } h2 { font-size: 2em; margin: 1.4em 0 0.6em; } p { line-height: 160%; margin: 0 0 1em; } blockquote { margin-left: 0; margin-right: 0; font-size: 2em; padding-left: 1em; border-left: 0.1em solid currentColor; } figure { margin: 1em 0 2em; display: flex; flex-direction: column; align-items: center; } figcaption { max-width: 600px; margin-top: 1em; font-size: 0.8em; color: color-mix(in srgb, var(--c-content) 60%, var(--c-bg)); } img { display: block; border-radius: 0.8em; width: 100%; max-width: 700px; aspect-ratio: 5 / 3; object-fit: cover; } .box { padding: 1em 1.4em; border-top: 4px solid color-mix(in srgb, var(--c-action) 50%, transparent); border-radius: 0.8em; background-color: color-mix(in srgb, var(--c-action) 8%, var(--c-bg)); transition: background 400ms cubic-bezier(1, 0, 0.4, 1); } .bubble { display: grid; justify-content: center; gap: 20px; } .bubble-svg { margin-left: 60px; fill: #007aff; width: 300px; } .bubble-inverte-svg{ margin-left: -50px; fill: var(--m-bg); width: 300px; } .bubble-text-inverte { color: white; font-size: 65px; text-align: left; margin: -15px 0px 0px 35px; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%; } .bubble-text{ color:white; font-size: 70px; margin: 0px 0px 0px 40px; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%; } @media screen and (max-width: 940px) { :root { font-size: 16px; } header { margin-top: 10px; } #box4 { display:none; } #box4.show { top: 70px; display: flex; justify-content: center; } .glass_menu, .nav_list { display: flex; gap: 10px; flex-direction: row; justify-content: center; } .glass_menu { display: flex; } .glass_nav { width: 330px; height: 30px; display: flex; justify-content: center; align-items: center; } #box1 { order: 2; } #box2 { order: 3; } #box3 { order: 1; } #box4{ order: 4; } #box2 { display: block; } .nav__toggle { color: var(--c-content); font-size: 1.5rem; cursor: pointer; margin-top: 5px; } .glass_container { gap: 6px; height: auto; display:flex; } .theme_container { justify-content: center; } h1 { font-size: 1.8em; } h2 { font-size: 1.4em; } .box { padding: 0.8em 1em; } img { aspect-ratio: auto; } } @media screen and (max-width: 480px) { :root { font-size: 16px; } header { margin-top: 10px; } #box4 { display:none; } #box4.show { top: 70px; display: flex; justify-content: center; } .glass_menu, .nav_list { display: flex; gap: 10px; flex-direction: row; justify-content: center; } .glass_menu { display: flex; } .glass_nav { width: 330px; height: 30px; display: flex; justify-content: center; align-items: center; } #box1 { order: 2; } #box2 { order: 3; } #box3 { order: 1; } #box4{ order: 4; } #box2 { display: block; } .nav__toggle { color: var(--c-content); font-size: 1.5rem; cursor: pointer; margin-top: 3px; } .glass_container { gap: 6px; height: auto; display:flex; } .theme_container { justify-content: center; } h1 { font-size: 1.8em; } h2 { font-size: 1.4em; } .box { padding: 0.8em 1em; } img { aspect-ratio: auto; } .bubble { display: grid; justify-content: center; gap: 20px; } .bubble-svg { margin-left: 50px; fill: #007aff; width: 250px; } .bubble-inverte-svg{ margin-left: 10px; fill: gray; width: 250px; } .bubble-text-inverte { color: white; font-size: 65px; text-align: left; margin: -15px 0px 0px 35px; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%; } .bubble-text{ color:white; font-size: 70px; margin: 0px 0px 0px 30px; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; max-width: 80%; }
JS
Copy
/* Replace with your JS Code (Leave empty if not needed) */