Список пользователей

1
Админ
Постов: 106
2
Элита
Постов: 34
3
Элита
Постов: 28
4
VIP
Постов: 26
5
Проверенные
Постов: 25
6
Дизайнер
Постов: 25
7
Пользователи
Постов: 25
8
Пользователи
Постов: 24

  • Страница 1 из 1
  • 1
iPad rendering logic -комментарии белый UCOZ V1.0
Дата: Воскресенье, Вчера, 22:01 | Сообщение # 1 | | Написал: Начинающий
Автор темы
Мурчанн не в сети
        Сообщений:106
         Регистрация:20.10.2016

Решил немного изменить структуру: чисто белый iPad в светлом исполнении показался мне интересной идеей. Но, как мне кажется, нужно менять фон и внутреннее оформление планшета, максимально меняя подход. Возможно, вас это заинтересует.

Создаем глобальный блок и вставляем на сайт.

Код
<!-- iPad контейнер -->
<div class="ipad-mockup">

<div class="real-pencil">
<div class="pencil-tip"></div>
<div class="pencil-body">
<span class="pencil-label">Apple Pencil</span>

</div>
<div class="pencil-top"></div>

<span class="pencil-label">
<span class="apple-icon">🍏</span>
</span>

</div>

<div class="ipad-screen">

<!-- Основной контент внутри экрана -->
<div class="acesories">

<!-- Вывод комментарии через информер -->

$MYINF_5$

<!-- Комментарии -->

</div>
</div>

<div class="ipad-label">iPad</div>
</div>

<style>

/* Яркие и контрастные фоны для всего блока комментария — HSL для точного различия */
.askolenada.comment-admin { background-color: hsl(0, 90%, 60%); color: #fff; } /* админ - ярко-красный */
.askolenada.comment-moder { background-color: hsl(0, 0%, 10%); color: #fff; } /* модератор - почти черный */
.askolenada.comment-designer { background-color: hsl(210, 90%, 55%); color: #fff; } /* дизайнер - насыщенный синий */
.askolenada.comment-vip { background-color: hsl(45, 100%, 50%); color: #000; } /* VIP - чистый желтый */
.askolenada.comment-elite { background-color: hsl(285, 80%, 45%); color: #fff; } /* элита - насыщенный фиолетовый */
.askolenada.comment-verified { background-color: hsl(180, 80%, 50%); color: #000; } /* проверенные - ярко-голубой */
.askolenada.comment-user { background-color: hsl(0, 0%, 95%); color: #000; } /* обычные пользователи - очень светло-серый */
.askolenada.comment-blocked { background-color: hsl(0, 0%, 45%); color: #fff; } /* заблокированные - темно-серый */

/* Внутренние элементы для корректного отображения */
.askolenada .keeping {
display: flex;
align-items: flex-start;
padding: 10px;
border-radius: 8px;
transition: background 0.3s ease;
}

.askolenada .text-wrapper {
margin-left: -40px;
word-wrap: break-word;
}

.askolenada .nickname {
font-weight: bold;
margin-bottom: 5px;
}

.askolenada .comment img {
vertical-align: middle;
}

/* Ромбовидный стилус */
.real-pencil {
position: absolute;
left: -50px;
top: 50px;
width: 25px;
height: 600px;
display: flex;
flex-direction: column;
align-items: center;
transform: rotate(-8deg);
z-index: 10;
animation: sway 6s infinite ease-in-out;
}

.pencil-label {
writing-mode: vertical-rl;
font-size: 11px;
color: #555;
font-family: "Segoe UI", sans-serif;
font-weight: bold;
text-shadow: 0 0 1px rgba(0,0,0,0.3);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(180deg);
display: flex;
align-items: center;
gap: 2px;
}

.apple-icon {
display: inline-block;
transform: rotate(90deg);
font-size: 12px;
margin-bottom: 80px; /* сдвигаем вниз/назад относительно текста */
}

/* Основной корпус с гранями */
.pencil-body {
flex: 1;
width: 24px;
background: linear-gradient(180deg, #fefefe 0%, #e6e6e6 100%);
clip-path: polygon(
50% 0%, /* верхний центр */
95% 10%, /* верхний правый угол */
95% 90%, /* нижний правый угол */
50% 100%, /* низ центр */
5% 90%, /* нижний левый угол */
5% 10% /* верхний левый угол */
);
box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 0 6px rgba(255,255,255,0.2);
position: relative;
display: flex;
justify-content: center;
align-items: center;
margin-top: -2px;
}

/* Надпись на корпусе с символом Apple */
.pencil-label {
writing-mode: vertical-rl;
transform: rotate(180deg);
font-size: 11px;
color: #555;
font-family: "Segoe UI", sans-serif;
font-weight: bold;
text-shadow: 0 0 1px rgba(0,0,0,0.3);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(180deg);
}

/* Добавляем сам текст с символом Apple через ::before */
.pencil-label::before {
content: " ";
font-size: 12px; /* немного больше, чтобы был заметен */
display: inline-block;
margin-bottom: 2px; /* подгоняем под вертикальный текст */
}

/* Верхняя часть */
.pencil-top {
width: 8px;
height: 8px;
background: #dcdcdc;
border-radius: 50%;
margin-top: -2px;
box-shadow: 0 1px 5px rgba(0,0,0,0.3), inset 0 1px 3px rgba(255,255,255,0.4);
}

/* Анимация лёгкого колебания */
@keyframes sway {
0%,100% { transform: rotate(-1deg); }
50% { transform: rotate(-0deg); }
}

/* iPad блок */
.ipad-mockup {
width: 768px;
max-width: 90vw;
height: 880px;
background: #1c1c1c;
border-radius: 40px;
box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 4px rgba(255,255,255,0.1);
position: relative;
margin: 40px auto;
font-family: "Segoe UI", sans-serif;

/* Настраиваем внутренние отступы отдельно */
padding-top: 20px;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 40px; /* <- увеличена нижняя рамка для надписи iPad */

display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}

/* Ограничиваем фон и шрифт только для iPad */
.ipad-mockup {
  background: #ffffff; /* белый фон */
  font-family: "Segoe UI", sans-serif;
  color: #000000; /* черный текст */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 980px; /* или 100% родителя */

}

/* Вырез под камеру/динамик сверху с отступом */
.ipad-mockup::before {
content: "";
position: absolute;
top: 8px; /* увеличен отступ сверху, был 12px */
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 6px;
background: #333;
border-radius: 3px;
}

/* Экран планшета */
.ipad-screen {
width: 100%;
height: 100%;
background: radial-gradient(circle at top left, #0b0614, #11081f 80%);
border-radius: 30px;
overflow: hidden;
padding: 20px;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}

/* Надпись iPad снизу с настраиваемым отступом */
:root {
--ipad-label-bottom: 3px; /* изменяем это значение, чтобы регулировать позицию */
}

.ipad-label {
  position: absolute;
  bottom: var(--ipad-label-bottom);
  width: 100%;
  text-align: center;
  font-family: "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #888; /* немного темнее, чтобы был виден эффект */
  letter-spacing: 1px;

  /* Эффект вдавленного текста */
  text-shadow:
    1px 1px 0 #fff,   /* верхняя подсветка */
   -1px -1px 0 #000,  /* нижняя тень */
    0 1px 2px rgba(0,0,0,0.2); /* лёгкая глубина */
}

/* Контейнер по центру с прокруткой*/
.acesories {
position: relative;
width: 780px;
height: 970px;
display: flex;
flex-direction: column; /* вертикальный поток комментариев */
justify-content: flex-start; /* прижимаем к верху */
align-items: stretch; /* растягиваем комментарии по ширине */

background: radial-gradient(circle at top left, #1a0826, #0c0713 80%);
border-radius: 12px;
box-shadow: 0 0 30px rgba(120, 40, 180, 0.4);

overflow-y: auto; /* включаем вертикальный скролл */
padding: 20px; /* немного меньше, чем было 60px */
margin: 10px auto;
}

/* Отступы между комментариями */
:root {
--comment-gap: 5px;
}

/* Комментарий */
.askolenada {
width: 93%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 28px 16px 160px;
background: linear-gradient(135deg, rgba(40, 20, 60, 0.9), rgba(30, 10, 50, 0.9));
border-radius: 100px 30px 30px 100px;
box-shadow: 0 8px 25px rgba(150, 70, 255, 0.25);
color: #fff;
font-size: 16px;
opacity: 0;
transform: translateY(50px);
position: relative;
margin-top: var(--comment-gap, 22px);
transition: transform 0.8s ease, opacity 0.8s ease;
animation: slideUp 1s ease forwards;
}

/* Анимация появления */
@keyframes slideUp {
from { opacity: 0; transform: translateY(60px); }
to { opacity: 1; transform: translateY(0); }
}

/* Задержки для упорядоченности */
.askolenada:nth-child(1) { animation-delay: 0.2s; }
.askolenada:nth-child(2) { animation-delay: 0.5s; }
.askolenada:nth-child(3) { animation-delay: 0.8s; }
.askolenada:nth-child(4) { animation-delay: 1.1s; }
.askolenada:nth-child(5) { animation-delay: 1.4s; }

/* Контейнер текста */
.text-wrapper {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: left;
margin-left: calc(var(--text-left, -50px));
margin-top: calc(var(--text-top, 0px));
}

/* Ник */
.nickname {
font-weight: 700;
font-size: 18px;
color: #d4b9ff;
text-shadow: 0 0 8px rgba(180, 90, 255, 0.5);

/* Отступы */
margin-top: -8px; /* сверху */
margin-bottom: 0px; /* снизу */

}

/* Комментарий */
.comment {
font-size: 15px;
color: #f4f4f4;
line-height: 1.4;
text-shadow: 0 0 6px rgba(180, 120, 255, 0.25);
}

/* Аватар */
.askolenada .img {
height: 100px;
width: 100px;
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
background: linear-gradient(145deg, #9a4dff, #692ac7);
border-radius: 50%;
padding: 5px;
box-shadow: 0 0 15px rgba(150, 70, 255, 0.5);

/* Отступы */
margin-top: 0px; /* сверху */
margin-bottom: 0px; /* снизу */
margin-left: -14px; /* слева */
}

.askolenada .img img {
height: 100%;
width: 100%;
border-radius: 50%;
object-fit: cover;
border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Кнопка */
.askolenada a {
text-decoration: none;
padding: 14px 22px;
border-radius: 25px;
color: #fff;
background: linear-gradient(135deg, #a24dfc 0%, #5c26e0 100%);
font-weight: 600;
font-size: 15px;
transition: all 0.25s ease;
box-shadow: 0 0 12px rgba(162, 77, 252, 0.4);
}

.askolenada a:hover {
transform: scale(1.05);
box-shadow: 0 0 20px rgba(162, 77, 252, 0.7);
}

/* Эффект свечения */
.askolenada::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
background: radial-gradient(circle at 80% 50%, rgba(200, 100, 255, 0.3), transparent 70%);
opacity: 0;
transition: opacity 0.5s ease;
}

.askolenada.active::after {
opacity: 1;
animation: glowTrail 1.8s ease-out;
}

@keyframes glowTrail {
0% { opacity: 1; filter: blur(6px); }
100% { opacity: 0; filter: blur(20px); }
}

/* Мобильные экраны */
@media (max-width: 768px) {
.ipad-mockup {
width: 95vw; /* почти весь экран */
height: auto;
min-height: 600px;
padding: 15px;
}

.acesories {
width: 100%;
height: auto;
padding: 10px;
}

.real-pencil {
left: -20px;
top: 30px;
height: 300px;
width: 15px;
}

.askolenada {
padding: 12px 16px 12px 120px;
font-size: 14px;
}

.askolenada .img {
width: 60px;
height: 60px;
margin-left: -10px;
}

.pencil-label {
font-size: 9px;
}

.ipad-label {
font-size: 16px;
}
}

/* Очень маленькие экраны (моб. телефоны) */
@media (max-width: 480px) {
.ipad-mockup {
width: 100vw;
min-height: 500px;
border-radius: 20px;
}

.acesories {
padding: 5px;
}

.askolenada {
padding: 8px 12px 8px 80px;
font-size: 12px;
}

.askolenada .img {
width: 50px;
height: 50px;
}

.real-pencil {
height: 200px;
left: -15px;
}

.pencil-label {
font-size: 8px;
}

.ipad-label {
font-size: 14px;
}
}

</style>

<script>
const comments = document.querySelectorAll('.askolenada');
const visibleSlots = 4;
let queue = [...comments];
let active = [];

function showNext() {
if (queue.length === 0) return;
const comment = queue.shift();
active.push(comment);

comment.style.opacity = '1';
comment.style.transform = `translateY(${active.indexOf(comment) * 85}px)`;
comment.classList.add('active');

if (active.length === visibleSlots) {
setTimeout(() => hideFirst(), 10000);
} else {
setTimeout(showNext, 800);
}
}

function hideFirst() {
const first = active.shift();
first.style.opacity = '0';
first.style.transform = `translateY(-100%)`;

if (queue.length > 0) {
showNext();
} else {
queue.push(first);
setTimeout(showNext, 500);
}
}

showNext();

const commentGap = 85 + 8;
setInterval(() => {
active.forEach((c, i) => {
c.style.transform = `translateY(${i * commentGap}px)`;
});
}, 300);
</script>


Мурчанн

Признаюсь, не знаю почему, но глядя на звезды мне всегда хочется мечтать.
  • Страница 1 из 1
  • 1
Поиск: