templates/components/messenger/messenger_styles.html.twig line 1

Open in your IDE?
  1. {% set options = {
  2. }|merge(options|default({})) %}
  3. <style>
  4.     :root {
  5.         /* =========================
  6.            TELEGRAM COLOR SYSTEM
  7.            ========================= */
  8.         --tg-bg: #e7ebf0;
  9.         --tg-surface: #ffffff;
  10.         --tg-incoming: #ffffff;
  11.         --tg-outgoing: #d9fdd3;
  12.         --tg-primary: #3390ec;
  13.         --tg-online: #31d158;
  14.         --tg-text: #0f172a;
  15.         --tg-muted: #6b7280;
  16.         --tg-border: #e6e6e6;
  17.         --tg-shadow: 0 0.0625rem 0.125rem rgba(0,0,0,0.06);
  18.     }
  19.     /* =========================
  20.        GLOBAL
  21.        ========================= */
  22.     :root {
  23.         --vh: 100dvh;
  24.     }
  25.     html, body {
  26.         height: var(--vh);
  27.         font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  28.         color: var(--tg-text);
  29.         overflow: hidden !important;
  30.         font-size: 1rem;
  31.         @media (max-width: 769px) {
  32.             font-size: 18px;
  33.         }
  34.     }
  35.     /* =========================
  36.        LAYOUT
  37.        ========================= */
  38.     .layout {
  39.         height: 100%;
  40.         display: flex;
  41.         flex-direction: column;
  42.         background: var(--tg-bg);
  43.         max-width: 62.5rem;
  44.         border-left: 0.0625rem solid var(--tg-border);
  45.         border-right: 0.0625rem solid var(--tg-border);
  46.     }
  47.     .layout-container {
  48.         width: 100%;
  49.         height: 100%;
  50.         display: flex;
  51.         justify-content: center;
  52.         align-items: center;
  53.     }
  54.     .screens-container {
  55.         flex: 1;
  56.         display: flex;
  57.         flex-direction: column;
  58.         min-height: 0;
  59.     }
  60.     .screens {
  61.         flex: 1;
  62.         overflow: hidden;
  63.         background: var(--tg-bg);
  64.     }
  65.     /* =========================
  66.        TOPBAR
  67.        ========================= */
  68.     .topbar {
  69.         background: var(--tg-surface);
  70.         border-bottom: 0.0625rem solid var(--tg-border);
  71.         box-shadow: var(--tg-shadow);
  72.         z-index: 10;
  73.     }
  74.     /* avatar */
  75.     .topbar .rounded-circle {
  76.         box-shadow: var(--tg-shadow);
  77.     }
  78.     /* online */
  79.     .text-success {
  80.         color: var(--tg-online) !important;
  81.     }
  82.     /* =========================
  83.        CHAT AREA
  84.        ========================= */
  85.     .chat {
  86.         height: 100%;
  87.         display: flex;
  88.         flex-direction: column;
  89.         position: relative;
  90.     }
  91.     .chat-scroll-down {
  92.         position: absolute;
  93.         bottom: 1rem;
  94.         right: 1rem;
  95.         width: 2.5rem;
  96.         height: 2.5rem;
  97.         border-radius: 50%;
  98.         background: var(--tg-surface);
  99.         border: 0.0625rem solid var(--tg-border);
  100.         box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.12);
  101.         color: var(--tg-muted);
  102.         display: flex;
  103.         align-items: center;
  104.         justify-content: center;
  105.         cursor: pointer;
  106.         z-index: 10;
  107.         transition: opacity .2s;
  108.     }
  109.     .chat-bodies {
  110.         flex: 1;
  111.         overflow: hidden;
  112.         display: flex;
  113.         flex-direction: column;
  114.     }
  115.     .chat-body {
  116.         flex: 1;
  117.         overflow-y: auto;
  118.         padding: 0.75rem 0.625rem;
  119.         background: radial-gradient(rgba(0,0,0,0.02) 0.0625rem, transparent 0.0625rem);
  120.         background-size: 1.125rem 1.125rem;
  121.     }
  122.     /* message rows */
  123.     .message {
  124.         display: flex;
  125.         margin-bottom: 0.5rem;
  126.     }
  127.     .message-in { justify-content: flex-start; }
  128.     .message-out { justify-content: flex-end; }
  129.     /* =========================
  130.        BUBBLES (REAL TELEGRAM COLORS)
  131.        ========================= */
  132.     .bubble {
  133.         max-width: 78%;
  134.         padding: 0.5625rem 0.75rem 0.4375rem 0.75rem;
  135.         border-radius: 1rem;
  136.         font-size: 1.1rem;
  137.         line-height: 1.35;
  138.         word-break: break-word;
  139.         box-shadow: var(--tg-shadow);
  140.     }
  141.     .bubble:has(img, video) {
  142.         padding: 0 0 0.4375rem 0;
  143.         overflow: hidden;
  144.         .time {
  145.             padding-right: 0.75rem;
  146.         }
  147.         .message-text {
  148.             padding: 0.5625rem 0.75rem 0.4375rem 0.75rem;
  149.         }
  150.     }
  151.     .bubble:has(img):not(:has(.message-text)) {
  152.         position: relative;;
  153.         padding: 0;
  154.         .time {
  155.             background: rgba(0, 0, 0, 0.62);
  156.             border-radius: 62.5rem;
  157.             padding: 0.125rem 0.5rem;
  158.             position: absolute;
  159.             right: 0.75rem;
  160.             bottom: 0.4375rem;
  161.             color: #fff;
  162.         }
  163.     }
  164.     /* incoming */
  165.     .message-in .bubble {
  166.         background: var(--tg-incoming);
  167.         color: var(--tg-text);
  168.         border-top-left-radius: 0.375rem;
  169.         border-top-right-radius: 1rem;
  170.         border-bottom-right-radius: 1rem;
  171.         border-bottom-left-radius: 1rem;
  172.         border: 0.0625rem solid rgba(0,0,0,0.04);
  173.     }
  174.     /* outgoing */
  175.     .message-out .bubble {
  176.         background: var(--tg-outgoing);
  177.         color: var(--tg-text);
  178.         border-top-right-radius: 0.375rem;
  179.         border-top-left-radius: 1rem;
  180.         border-bottom-right-radius: 1rem;
  181.         border-bottom-left-radius: 1rem;
  182.         border: 0.0625rem solid rgba(0,0,0,0.03);
  183.     }
  184.     /* timestamp */
  185.     .time {
  186.         font-size: 0.8rem;
  187.         color: var(--tg-muted);
  188.         text-align: right;
  189.         margin-top: 0.25rem;
  190.     }
  191.     /* date label */
  192.     .chat-group { position: relative; }
  193.     /* unread divider - hidden */
  194.     .chat-unread-divider { display: none; }
  195.     /* unread badge on scroll button */
  196.     .chat-unread-badge {
  197.         position: absolute;
  198.         top: -0.5rem;
  199.         left: 50%;
  200.         transform: translateX(-50%);
  201.         background: var(--tg-primary);
  202.         color: #fff;
  203.         font-size: 0.6875rem;
  204.         font-weight: 600;
  205.         min-width: 1.25rem;
  206.         height: 1.25rem;
  207.         border-radius: 62.5rem;
  208.         display: flex;
  209.         align-items: center;
  210.         justify-content: center;
  211.         padding: 0 0.25rem;
  212.         white-space: nowrap;
  213.         pointer-events: none;
  214.     }
  215.     .chat-date-label {
  216.         display: flex;
  217.         justify-content: center;
  218.         margin: 0.75rem 0 0.5rem;
  219.         position: sticky;
  220.         top: 0;
  221.         z-index: 1;
  222.     }
  223.     .chat-date-label span {
  224.         background: rgb(255,255,255);
  225.         color: var(--tg-muted);
  226.         font-size: 0.8125rem;
  227.         padding: 0.1875rem 0.625rem;
  228.         border-radius: 3.125rem;
  229.     }
  230.     /* =========================
  231.        MESSAGE INPUT
  232.        ========================= */
  233.     .message-text-container {
  234.         display: flex;
  235.         gap: 0.5rem;
  236.     }
  237.     .message-attachment-panel {
  238.         border-radius: 0.35rem;
  239.         overflow: hidden;
  240.     }
  241.     .message-input-container {
  242.         background: var(--tg-surface);
  243.         border-top: 0.0625rem solid var(--tg-border);
  244.         padding: 0.5rem 0.625rem;
  245.         display: flex;
  246.         flex-direction: column;
  247.         gap: 0.5rem;
  248.     }
  249.     .message-input-container input {
  250.         border: 0.0625rem solid var(--tg-border);
  251.         border-radius: 62.5rem;
  252.         padding: 0.625rem 0.875rem;
  253.         font-size: 0.875rem;
  254.         box-shadow: none;
  255.     }
  256.     .message-input-container input:focus {
  257.         border-color: var(--tg-primary);
  258.         outline: none;
  259.     }
  260.     .message-input-container .btn {
  261.         width: 2.625rem;
  262.         height: 2.625rem;
  263.         border-radius: 50%;
  264.         display: flex;
  265.         align-items: center;
  266.         justify-content: center;
  267.     }
  268.     /* =========================
  269.        BOTTOM NAVBAR
  270.        ========================= */
  271.     .navbar {
  272.         background: var(--tg-surface);
  273.         border-top: 0.0625rem solid var(--tg-border);
  274.         height: 4.375rem;
  275.         padding: 0;
  276.     }
  277.     .navbar a {
  278.         flex: 1;
  279.         text-align: center;
  280.         text-decoration: none;
  281.         color: var(--tg-muted);
  282.         font-size: 0.8125rem;
  283.     }
  284.     .navbar a i {
  285.         display: block;
  286.         font-size: 1.5rem;
  287.         margin-bottom: 0.1875rem;
  288.     }
  289.     .navbar a.active { color: var(--tg-primary); }
  290.     .navbar a.active i { color: var(--tg-primary); }
  291.     .topbar .btn-link { color: var(--tg-muted); }
  292.     .topbar .btn-link:hover { color: var(--tg-primary); }
  293.     @media (max-width: 48rem) {
  294.         .bubble { max-width: 85%; }
  295.         .message-input-container { padding: 0.375rem 0.5rem; }
  296.         .navbar { height: 4.375rem; }
  297.     }
  298.     .screen { display: none; height: 100%; }
  299.     .screen.active { display: flex; flex-direction: column; }
  300.     .chat-list-container {
  301.         position: relative;
  302.         width: 100%;
  303.         height: 100%;
  304.     }
  305.     .chat-list {
  306.         display: flex;
  307.         flex-direction: column;
  308.         gap: 0.625rem;
  309.         padding: 0.625rem;
  310.         width: 100%;
  311.         height: 100%;
  312.         overflow-y: auto;
  313.     }
  314.     .chat-item {
  315.         display: flex;
  316.         align-items: center;
  317.         gap: 0.625rem;
  318.         padding: 0.625rem;
  319.         background: white;
  320.         border-radius: 0.75rem;
  321.         cursor: pointer;
  322.     }
  323.     .chat-item .avatar {
  324.         min-width: 2.625rem;
  325.         min-height: 2.625rem;
  326.         border-radius: 50%;
  327.         background: #3390ec;
  328.         color: white;
  329.         display: flex;
  330.         align-items: center;
  331.         justify-content: center;
  332.     }
  333.     .chat-info .name { font-weight: 600; }
  334.     .chat-info .preview { font-size: 0.75rem; color: #6b7280; }
  335.     .chat-row-unread-badge {
  336.         min-width:22px;
  337.         height:22px;
  338.         padding:0 7px;
  339.         border-radius:11px;
  340.         background:#3b82f6;
  341.         color:#fff;
  342.         font-size:12px;
  343.         font-weight:600;
  344.         display:flex;
  345.         align-items:center;
  346.         justify-content:center;
  347.         box-sizing:border-box;
  348.     }
  349.     .contacts-screen { display:flex; flex-direction:column; height:100%; position:relative; }
  350.     .contacts-header { background:var(--tg-surface); border-bottom:0.0625rem solid var(--tg-border); }
  351.     .contacts-list { flex:1; overflow-y:auto; padding:0.5rem; }
  352.     .contact-item {
  353.         display:flex; align-items:center; gap:0.875rem;
  354.         padding:0.75rem; margin-bottom:0.375rem;
  355.         background:var(--tg-surface); border-radius:1rem;
  356.         color:var(--tg-text); transition:.15s;
  357.     }
  358.     .contact-item:hover { background:#f8fafc; }
  359.     .contact-avatar {
  360.         width:3.25rem; height:3.25rem; border-radius:50%;
  361.         background:var(--tg-primary); color:#fff;
  362.         font-weight:600; font-size:1.125rem;
  363.         display:flex; align-items:center; justify-content:center; flex-shrink:0;
  364.     }
  365.     .contact-content { flex:1; }
  366.     .contact-name { font-weight:600; margin-bottom:0.1875rem; }
  367.     .contact-status { font-size:0.75rem; }
  368.     .contact-status i { font-size:0.4375rem; margin-right:0.25rem; }
  369.     .contact-action { color:var(--tg-muted); }
  370.     .contact-fab {
  371.         position:absolute; right:1.25rem; bottom:1.25rem;
  372.         width:3.625rem; height:3.625rem; border-radius:50%;
  373.         display:flex; align-items:center; justify-content:center;
  374.         font-size:1.25rem; z-index:100;
  375.     }
  376.     .contacts-add-screen { display:flex; flex-direction:column; height:100%; background:var(--tg-bg); }
  377.     .contacts-search-header { padding:0.625rem; background:#fff; border-bottom:0.0625rem solid #e5e7eb; }
  378.     .contacts-search-input { border:none; box-shadow:none !important; }
  379.     .contacts-search-input:focus { box-shadow:none !important; }
  380.     .contacts-search-input {
  381.         box-shadow:none !important;
  382.         &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
  383.         -moz-appearance:textfield;
  384.     }
  385.     .contacts-search-results {
  386.         flex:1; overflow-y:auto; padding:0.625rem;
  387.         display:flex; flex-direction:column; gap:0.5rem;
  388.     }
  389.     .contact-result-item {
  390.         display:flex; align-items:center; gap:0.75rem;
  391.         padding:0.75rem; border-radius:0.875rem;
  392.         background:#fff; cursor:pointer;
  393.     }
  394.     .contact-result-avatar {
  395.         min-width:2.75rem;
  396.         min-height:2.75rem;
  397.         border-radius:50%;
  398.         background:#3390ec;
  399.         color:#fff;
  400.         display:flex;
  401.         align-items:center;
  402.         justify-content:center;
  403.         font-weight:600;
  404.     }
  405.     .contact-result-name { font-weight:600; }
  406.     .contact-result-meta { font-size:0.75rem; color:#6b7280; }
  407.     .user-screen { display:flex; flex-direction:column; height:100%; background:var(--tg-bg); }
  408.     .user-screen-body {
  409.         display:flex; flex-direction:column; align-items:center;
  410.         padding:1.5rem 1.25rem; gap:0.75rem;
  411.         background:var(--tg-surface); border-radius:1rem;
  412.         margin:1rem 0.75rem 0;
  413.     }
  414.     .user-screen-body .contact-avatar { width:5rem; height:5rem; font-size:1.75rem; }
  415.     .user-info { text-align:center; }
  416.     .user-chat-btn { margin-top:0.5rem; border-radius:62.5rem; padding:0.5rem 1.5rem; }
  417.     .user-details { width:100%; }
  418.     .user-detail-row { padding:0.375rem 1rem; text-align:left; }
  419.     .user-detail-label { font-size:0.6875rem; color:var(--tg-muted); margin-top:0.125rem; }
  420.     .profile-screen { display:flex; flex-direction:column; height:100%; background:var(--tg-bg); }
  421.     .profile-body {
  422.         display:flex; flex-direction:column; align-items:center;
  423.         padding:1.5rem 1.25rem; gap:0.75rem;
  424.         background:var(--tg-surface); border-radius:1rem;
  425.         margin:1rem 0.75rem 1rem;
  426.     }
  427.     .profile-avatar {
  428.         width:5rem; height:5rem; font-size:1.75rem;
  429.         border-radius:50%; background:var(--tg-primary); color:#fff;
  430.         font-weight:600; display:flex; align-items:center; justify-content:center; flex-shrink:0;
  431.     }
  432.     .profile-fields { width:80%; }
  433.     .profile-field { padding:0.375rem 1rem; text-align:left; }
  434.     .profile-field input, .profile-field textarea {
  435.         border:none; background:transparent; box-shadow:none !important;
  436.         padding:0; width:100%; font-size:0.875rem;
  437.         color:var(--tg-text); outline:none; resize:none;
  438.     }
  439.     .profile-field input:focus, .profile-field textarea:focus { outline:none; box-shadow:none !important; }
  440.     .profile-field-label { font-size:0.6875rem; color:var(--tg-muted); margin-top:0.125rem; }
  441.     .profile-logout-btn { margin-top:0.5rem; border-radius:62.5rem; padding:0.5rem 1.5rem; }
  442.     .upload-progress-widget {
  443.         position: relative;
  444.         width: 2.625rem;
  445.         height: 2.625rem;
  446.         flex: 0 0 2.625rem;
  447.     }
  448.     .upload-progress-circle {
  449.         width: 100%;
  450.         height: 100%;
  451.         transform: rotate(-90deg);
  452.     }
  453.     .upload-progress-bg {
  454.         fill: none;
  455.         stroke: #e3e6f0;
  456.         stroke-width: 0.28rem;
  457.     }
  458.     .upload-progress-value {
  459.         fill: none;
  460.         stroke: var(--bs-primary);
  461.         stroke-width: 0.28rem;
  462.         stroke-linecap: round;
  463.         stroke-dasharray: 276.46;
  464.         stroke-dashoffset: 276.46;
  465.         transition: stroke-dashoffset .15s linear;
  466.     }
  467.     .upload-progress-icon {
  468.         position: absolute;
  469.         inset: 0;
  470.         display: flex;
  471.         justify-content: center;
  472.         align-items: center;
  473.         font-size: 1.3rem;
  474.         color: var(--bs-secondary);
  475.         pointer-events: none;
  476.     }
  477.     .upload-progress-cancel {
  478.         position: absolute;
  479.         inset: 0;
  480.         display: flex;
  481.         justify-content: center;
  482.         align-items: center;
  483.         width: 100%;
  484.         height: 100%;
  485.         border: 0;
  486.         background: rgba(0, 0, 0, 0.25);
  487.         color: #fff;
  488.         opacity: 1;
  489.         cursor: pointer;
  490.         transition:
  491.                 opacity .15s ease,
  492.                 background .15s ease;
  493.         border-radius: 50%;
  494.     }
  495.     .upload-progress-cancel:hover {
  496.         background: rgba(172, 172, 172, 0.9);
  497.     }
  498.     .upload-progress-cancel i {
  499.         font-size: .8rem;
  500.     }
  501.     .upload-progress-circle {
  502.         width: 100%;
  503.         height: 100%;
  504.         transform-origin: center;
  505.     }
  506.     .upload-progress-circle.rotating {
  507.         animation: upload-progress-rotate 1s linear infinite;
  508.     }
  509.     @keyframes upload-progress-rotate {
  510.         from {
  511.             transform: rotate(-90deg);
  512.         }
  513.         to {
  514.             transform: rotate(270deg);
  515.         }
  516.     }
  517.     .attachment-preview {
  518.         position: relative;
  519.         width: 3.5rem;
  520.         height: 3.5rem;
  521.         flex: 0 0 3.5rem;
  522.     }
  523.     .attachment-preview-image,
  524.     .attachment-preview-icon {
  525.         width: 100%;
  526.         height: 100%;
  527.         border-radius: .375rem;
  528.         object-fit: cover;
  529.         display: flex;
  530.         align-items: center;
  531.         justify-content: center;
  532.         background: #f8f9fc;
  533.         color: #2e59d9;
  534.         font-size: 1.9rem;
  535.     }
  536.     .attachment-remove-btn {
  537.         position: absolute;
  538.         inset: 0;
  539.         font-size: 1.3rem;
  540.         border: 0;
  541.         border-radius: .35rem;
  542.         background: rgba(0, 0, 0, 0.28);
  543.         color: #fff;
  544.         opacity: 1;
  545.         transition: background .15s;
  546.     }
  547.     .attachment-preview:hover .attachment-remove-btn {
  548.         background: rgba(0, 0, 0, 0.58);
  549.     }
  550.     .file-image, .file-video {
  551.         img, video {
  552.             max-width: 31.25rem;
  553.             max-height: 31.25rem;
  554.             width: 100%;
  555.         }
  556.     }
  557.     .file-other {
  558.         display: flex;
  559.         align-items: center;
  560.         gap: 0.5rem;
  561.     }
  562.     .menu-overlay {
  563.         position: fixed;
  564.         inset: 0;
  565.         display: none;
  566.         z-index: 9998;
  567.         background: rgba(0, 0, 0, .28);
  568.         backdrop-filter: blur(2px);
  569.     }
  570.     .popup-menu {
  571.         position: fixed;
  572.         top: 60px;
  573.         right: 12px;
  574.         min-width: 220px;
  575.         max-width: fit-content;
  576.         background: #fff;
  577.         border-radius: 14px;
  578.         box-shadow: 0 10px 35px rgba(0,0,0,.18);
  579.         overflow: hidden;
  580.         display: none;
  581.         z-index: 9999;
  582.     }
  583.     .popup-menu-item {
  584.         display: flex;
  585.         align-items: center;
  586.         gap: 14px;
  587.         padding: 14px 18px;
  588.         cursor: pointer;
  589.         transition: background .15s;
  590.     }
  591.     .popup-menu-item:hover {
  592.         background: #f5f5f5;
  593.     }
  594.     .popup-menu-item i {
  595.         width: 20px;
  596.         text-align: center;
  597.         color: #666;
  598.     }
  599.     .popup-menu-divider {
  600.         height: 1px;
  601.         background: #ececec;
  602.     }
  603.     .popup-menu.show,
  604.     .menu-overlay.show {
  605.         display: block;
  606.     }
  607.     .create-group-screen {
  608.         height: 100%;
  609.         overflow-y: auto;
  610.     }
  611.     .create-group-body {
  612.         padding: 20px;
  613.     }
  614.     .group-avatar {
  615.         width: 96px;
  616.         height: 96px;
  617.         border-radius: 50%;
  618.         background: #0d6efd;
  619.         color: white;
  620.         display: flex;
  621.         align-items: center;
  622.         justify-content: center;
  623.         font-size: 38px;
  624.         margin: 0 auto 25px;
  625.     }
  626.     .group-fields {
  627.         margin-bottom: 20px;
  628.     }
  629.     .group-field {
  630.         margin-bottom: 15px;
  631.     }
  632.     .group-field input,
  633.     .group-field textarea {
  634.         width: 100%;
  635.         border: 0;
  636.         border-bottom: 1px solid #ddd;
  637.         padding: 10px 0;
  638.         outline: none;
  639.         resize: none;
  640.     }
  641.     .group-field-label {
  642.         font-size: 12px;
  643.         color: #888;
  644.         margin-top: 4px;
  645.     }
  646.     .group-section-title {
  647.         font-weight: 600;
  648.         margin: 20px 0 10px;
  649.     }
  650.     .group-members-list {
  651.         margin-top: 15px;
  652.     }
  653.     .group-member {
  654.         display: flex;
  655.         align-items: center;
  656.         padding: 10px 0;
  657.     }
  658.     .group-member-avatar {
  659.         width: 42px;
  660.         height: 42px;
  661.         border-radius: 50%;
  662.         background: #eee;
  663.         display: flex;
  664.         align-items: center;
  665.         justify-content: center;
  666.         margin-right: 12px;
  667.     }
  668.     .create-group-btn {
  669.         width: 100%;
  670.         margin-top: 20px;
  671.     }
  672.     .chat-select {
  673.         align-items: center;
  674.         justify-content: center;
  675.         width: 22px;
  676.         height: 22px;
  677.         cursor: pointer;
  678.         user-select: none;
  679.         flex-shrink: 0;
  680.     }
  681.     .chat-select-checkbox {
  682.         display: none;
  683.     }
  684.     .chat-select-icon {
  685.         font-size: 22px;
  686.         color: #b6bcc6;
  687.         transition: color .15s ease, transform .15s ease;
  688.     }
  689.     .chat-select-checkbox:checked + .chat-select-icon {
  690.         color: var(--bs-primary);
  691.         transform: scale(1.05);
  692.     }
  693.     .chat-item.selection-mode .chat-select {
  694.         display: flex;
  695.     }
  696. </style>