Примеры CSS эффектов

Интерактивная демонстрация современных CSS возможностей

🎨 Градиенты

Линейный градиент

background: linear-gradient(45deg, 
    #8B4513, #D2691E, #CD853F);

Радиальный градиент

background: radial-gradient(circle, 
    #FFE4C4, #D2691E, #8B4513);

Конический градиент

background: conic-gradient(from 0deg, 
    #8B4513, #D2691E, #CD853F);

Повторяющийся градиент

background: repeating-linear-gradient(
    45deg, #8B4513, #8B4513 10px, 
    #D2691E 10px, #D2691E 20px);

🌟 Тени

Простая тень

Box Shadow
box-shadow: 0 5px 15px 
    rgba(139, 69, 19, 0.3);

Множественные тени

Multiple Shadows
box-shadow: 
    0 2px 4px rgba(0,0,0,0.1),
    0 4px 8px rgba(0,0,0,0.1),
    0 8px 16px rgba(0,0,0,0.1);

Внутренняя тень

Inset Shadow
box-shadow: inset 0 2px 5px 
    rgba(139, 69, 19, 0.3);

Текстовая тень

Text Shadow
text-shadow: 2px 2px 4px 
    rgba(139, 69, 19, 0.5);

🔄 Трансформации

Поворот (Rotate)

Rotated
transform: rotate(5deg);

Масштабирование (Scale)

Hover me!
transform: scale(1.1);

Наклон (Skew)

Skewed
transform: skewX(-10deg);

3D трансформация

3D Effect
transform: perspective(100px) 
    rotateX(10deg);

✨ Анимации

Пульсация

Pulse
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
animation: pulse 2s infinite;

Скольжение

Slide
@keyframes slide {
    0% { transform: translateX(-10px); }
    100% { transform: translateX(10px); }
}
animation: slide 2s alternate infinite;

Вращение

⚙️
@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
animation: rotate360 3s linear infinite;

Радуга

Rainbow
@keyframes rainbow {
    0% { background-color: red; }
    50% { background-color: blue; }
    100% { background-color: red; }
}
animation: rainbow 5s infinite;

🎭 CSS Фильтры

Размытие (Blur)

Blurred
filter: blur(2px);

Яркость (Brightness)

Bright
filter: brightness(1.3);

Оттенки серого (Grayscale)

Grayscale
filter: grayscale(100%);

Сепия (Sepia)

Sepia
filter: sepia(100%);

✂️ Clip-path

Круг

clip-path: circle(50%);

Треугольник

clip-path: polygon(
    50% 0%, 0% 100%, 100% 100%);

Шестиугольник

clip-path: polygon(30% 0%, 70% 0%, 
    100% 30%, 100% 70%, 70% 100%, 
    30% 100%, 0% 70%, 0% 30%);

Звезда

clip-path: polygon(50% 0%, 61% 35%, 
    98% 35%, 68% 57%, 79% 91%, 
    50% 70%, 21% 91%, 32% 57%, 
    2% 35%, 39% 35%);

📝 Псевдоэлементы и псевдоклассы

::before и ::after

Контент
::before { content: "→ "; }
::after { content: " ✓"; }

Tooltip с ::after

Наведите курсор
::after {
    content: "Подсказка!";
    position: absolute;
    /* стили tooltip */
}

:hover эффект

button:hover {
    background: #D2691E;
    transform: scale(1.1);
}

:nth-child() селектор

  • Item 1
  • Item 2
  • Item 3
  • Item 4
li:nth-child(odd) { 
    background: #F5DEB3; 
}
li:nth-child(even) { 
    background: #FFE4C4; 
}

📐 Flexbox

Justify Content

1
2
3
display: flex;
justify-content: space-between;

Align Items

1
2
3
display: flex;
align-items: center;

Flex Direction

1
2
3
display: flex;
flex-direction: column;

Flex Grow

1
2 (grow)
3
.item-2 {
    flex-grow: 2;
}

🏗️ CSS Grid

Базовая сетка

1
2
3
4
5
6
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;

Grid Span

1
2 (span 2)
3
4
5
.item {
    grid-column: span 2;
}

Grid Areas

Header
Sidebar
Content
grid-template-areas:
    "header header"
    "sidebar content"
    "footer footer";

Responsive Grid

1
2
3
4
grid-template-columns: 
    repeat(auto-fit, minmax(50px, 1fr));

🎨 CSS переменные

Использование CSS Custom Properties

CSS Variables Demo
:root {
    --primary-color: #8B4513;
    --spacing: 1rem;
    --radius: 10px;
}

.element {
    background: var(--primary-color);
    padding: var(--spacing);
    border-radius: var(--radius);
}

🎭 Blend Modes

Mix Blend Mode

Screen Blend
mix-blend-mode: screen;

Background Blend Mode

'), linear-gradient(45deg, #D2691E, #CD853F); background-blend-mode: multiply; border-radius: 10px;">
background-blend-mode: multiply;