document.addEventListener("DOMContentLoaded", function () {
const canvas = document.createElement("canvas");
canvas.style.position = "fixed";
canvas.style.top = "0";
canvas.style.left = "0";
canvas.style.pointerEvents = "none";
canvas.style.zIndex = "9999";
document.body.appendChild(canvas);
const ctx = canvas.getContext("2d");
let width = window.innerWidth + 100;
let height = window.innerHeight;
canvas.width = width;
canvas.height = height;
const flakes = [];
// Загружаем изображения для снежинок
const snowflakeImages = ["/sneg.png", "/sneg2.png"];
const snowflakes = [];
let img1 = new Image();
img1.src = snowflakeImages[0];
let img2 = new Image();
img2.src = snowflakeImages[1];
// Создаем снежинку с отклонением по горизонтали
function createFlake() {
const randomImage = Math.random() > 0.5 ? img1 : img2; // Выбираем случайное изображение
return {
x: Math.random() * width,
y: Math.random() * height * 0.5, // Появление снежинок в верхней половине экрана
image: randomImage, // Присваиваем изображение
width: 13 + Math.random() * 5, // Ширина изображения снежинки
height: 13 + Math.random() * 5, // Высота изображения снежинки
speed: Math.random() * 5 + 0.5, // Скорость падения
direction: (Math.random() - 0.5) * 2, // Направление горизонтального отклонения (-1 до 1)
drift: Math.random() * 0.5 - 0.1, // Медленное горизонтальное отклонение со временем
};
}
// Рисуем снежинки
function drawFlakes() {
ctx.clearRect(0, 0, width, height); // Очистить экран
// Рисуем падающие снежинки
flakes.forEach((flake) => {
ctx.drawImage(flake.image, flake.x, flake.y, flake.width, flake.height);
});
}
// Двигаем снежинки с эффектом отскока от краев
function moveFlakes() {
flakes.forEach((flake, index) => {
flake.y += flake.speed; // Падение вниз
flake.x += flake.direction + flake.drift; // Горизонтальное отклонение
// Отскок при достижении левого или правого края экрана
if (flake.x < 0 || flake.x > width) {
flake.direction = -flake.direction; // Меняем направление на противоположное
// Плавное возвращение к центру экрана
flake.x = Math.min(Math.max(flake.x, 0), width);
}
// Если снежинка выходит за нижнюю границу экрана, перемещаем её обратно в верхнюю часть
if (flake.y > height) {
flake.y = -flake.height; // Переходит в верхнюю часть
flake.x = Math.random() * width; // Новая случайная позиция по горизонтали
}
});
// Добавляем новые снежинки, чтобы поддерживать их количество
while (flakes.length < 100) { // Поддерживаем количество снежинок
flakes.push(createFlake());
}
}
// Анимация
function loop() {
drawFlakes();
moveFlakes();
requestAnimationFrame(loop);
}
// Инициализация снежинок
for (let i = 0; i < 100; i++) {
flakes.push(createFlake());
}
// Адаптация к изменению размера окна
window.addEventListener("resize", () => {
width = window.innerWidth + 100;
height = window.innerHeight;
canvas.width = width;
canvas.height = height;
});
loop();
});
MOLDINGS IN ART DECO STYLE
Moldings play an important role in Art Deco style, helping to create its character and atmosphere. In this style, moldings are often used to emphasize geometric shapes, add decorative details, and give the interior a luxurious and elegant look.
One of the main places where moldings meet in Art Deco style is in ceilings. Ceiling moldings are often used, which can be made in the form of geometric patterns, friezes, relief patterns or stylized plant motifs. The moldings on the ceiling create a sense of depth and texture, adding luxury and sophistication to the space.
Another common place for Art Deco moldings is in walls. Moldings can be installed as panels or frames that add structure and decorativeness to walls. They can be used in the living room, dining room or hallway to create eye-catching accents and give the interior a unique character.
Moldings can also be used around window and door openings. They can be made in the form of arches, stylized columns or other decorative elements that give the space elegance and luxury. Moldings around windows and doors create focal points and help emphasize architectural details.
Moldings can be made from various materials such as wood, plaster, polyurethane, polystyrene and even plastic. They are protruding elements that can have various shapes and patterns. The main purpose of moldings is to create a unique and attractive appearance of the room. They can be used to divide walls into different levels, add volume to a space, emphasize architectural details, and hide irregularities or imperfections. Moldings can be installed in different rooms including living rooms, bedrooms, kitchens and bathrooms. They are also used in public buildings, restaurants, hotels and theaters. Moldings can be used as an independent decorative element or in combination with other interior elements such as wallpaper, cornices or lighting. The color of Art Deco moldings can be varied. Contrasting combinations are often used, such as black moldings on a light background or golden moldings on a dark background. The color of the moldings is chosen in such a way as to emphasize the geometric shapes and the overall color palette of the interior. Art Deco moldings help to create a unique and inimitable interior filled with luxury, elegance and character. They add decorativeness, depth and texture to a space.