Дата: Воскресенье, 31.08.2025, 16:52 | Сообщение # 1 |
|
Написал: Начинающий
Автор темы
Мурчанн
не в сети
Сообщений: 101
Добавил милую фишечку: при наведении на рейтинг выезжает аккуратненькая стрелочка, по которой можно пройти в профиль пользователя. Нежная и интересная деталька, при этом совсем не нарушает общий контур форума. CSS Код
<!-- ====== LILAC MINIMAL INFORMER FIXED REPUTATION + CLICKABLE ARROW ====== --> <style> .infsimg1 { border: 1px solid #aaa; background: #fff; padding: 2px; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.12); transition: transform 0.3s ease, box-shadow 0.3s ease; } .infsimg1:hover { transform: scale(1.1); box-shadow: 0 3px 10px rgba(0,0,0,0.2); } .spa { font-family: "Segoe UI", Geneva, Tahoma, Verdana, sans-serif; font-size: 13px; font-weight: 500; line-height: 1.4; color: #333; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,0.08); padding: 6px 36px 6px 6px; /* учитываем место для стрелки */ display: flex; align-items: center; border-radius: 8px; background: #fff; /* ===== разделение между сообщениями ===== */ margin-bottom: 3px; /* расстояние между блоками */ border-bottom: 1px solid #eee; /* тонкая линия между сообщениями */ } /* Блок с именем и ролью */ .informer-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; } .informer-text { display: flex; flex-direction: column; } /* Имя пользователя */ .username-link { font-weight: 500; font-size: 13px; color: #5b2c82; text-decoration: none; transition: color 0.3s ease; } .username-link:hover { color: #a569bd; } /* Роль */ .user-role { font-size: 11px; color: #777; margin-top: 2px; } /* Репутация (фиксированная справа) */ .positive { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 10px; font-weight: 500; color: #fff; border-radius: 12px; background: linear-gradient(135deg, #4b0082, #7d3c98); box-shadow: 0 1px 4px rgba(0,0,0,0.12); transition: transform 0.3s ease, box-shadow 0.3s ease; } .positive::before { content: "⭐"; font-size: 11px; } .positive:hover { transform: scale(1.1); box-shadow: 0 3px 10px rgba(0,0,0,0.2); } /* Стрелка */ .informer-arrow { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #9b59b6; opacity: 0.0; /* изначально скрыта */ transition: transform 0.3s ease, opacity 0.3s ease; text-decoration: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; } .spa:hover .informer-arrow { transform: translateY(-50%) translateX(3px); opacity: 1; } </style>
Html каркас. Код
<div class="spa"> <div class="informer-left"> <img class="infsimg1" src="$AVATAR_URL$" alt="$USERNAME$" width="36" height="36"> <div class="informer-text"> <a href="$PROFILE_URL$" class="username-link" title="$USERNAME$">$USERNAME$</a> <span class="user-role">Автор</span> </div> </div> <!-- Репутация фиксирована справа --> <span class="positive">$REPUTATION$</span> <!-- Кликабельная стрелка --> <a href="$PROFILE_URL$" class="informer-arrow">➜</a> </div>
Информер Код
<!-- ====== LILAC MINIMAL INFORMER FIXED REPUTATION + CLICKABLE ARROW ====== --> <style> .infsimg1 { border: 1px solid #aaa; background: #fff; padding: 2px; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.12); transition: transform 0.3s ease, box-shadow 0.3s ease; } .infsimg1:hover { transform: scale(1.1); box-shadow: 0 3px 10px rgba(0,0,0,0.2); } .spa { font-family: "Segoe UI", Geneva, Tahoma, Verdana, sans-serif; font-size: 13px; font-weight: 500; line-height: 1.4; color: #333; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,0.08); padding: 6px 36px 6px 6px; /* учитываем место для стрелки */ display: flex; align-items: center; border-radius: 8px; background: #fff; /* ===== разделение между сообщениями ===== */ margin-bottom: 3px; /* расстояние между блоками */ border-bottom: 1px solid #eee; /* тонкая линия между сообщениями */ } /* Блок с именем и ролью */ .informer-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; } .informer-text { display: flex; flex-direction: column; } /* Имя пользователя */ .username-link { font-weight: 500; font-size: 13px; color: #5b2c82; text-decoration: none; transition: color 0.3s ease; } .username-link:hover { color: #a569bd; } /* Роль */ .user-role { font-size: 11px; color: #777; margin-top: 2px; } /* Репутация (фиксированная справа) */ .positive { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 10px; font-weight: 500; color: #fff; border-radius: 12px; background: linear-gradient(135deg, #4b0082, #7d3c98); box-shadow: 0 1px 4px rgba(0,0,0,0.12); transition: transform 0.3s ease, box-shadow 0.3s ease; } .positive::before { content: "⭐"; font-size: 11px; } .positive:hover { transform: scale(1.1); box-shadow: 0 3px 10px rgba(0,0,0,0.2); } /* Стрелка */ .informer-arrow { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #9b59b6; opacity: 0.0; /* изначально скрыта */ transition: transform 0.3s ease, opacity 0.3s ease; text-decoration: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; } .spa:hover .informer-arrow { transform: translateY(-50%) translateX(3px); opacity: 1; } </style> <div class="spa"> <div class="informer-left"> <img class="infsimg1" src="$AVATAR_URL$" alt="$USERNAME$" width="36" height="36"> <div class="informer-text"> <a href="$PROFILE_URL$" class="username-link" title="$USERNAME$">$USERNAME$</a> <span class="user-role">Автор</span> </div> </div> <!-- Репутация фиксирована справа --> <span class="positive">$REPUTATION$</span> <!-- Кликабельная стрелка --> <a href="$PROFILE_URL$" class="informer-arrow">➜</a> </div>
Прикрепления:
3691353.jpg
(33.2 Kb)
Признаюсь, не знаю почему, но глядя на звезды мне всегда хочется мечтать.
Дата: Воскресенье, 31.08.2025, 22:53 | Сообщение # 2 |
|
Написал: Новичок
Для белых шаблонов форума - очень даже подошло бы