Показать сообщение отдельно
  #3 (permalink)  
Старый 19.05.2021, 00:45
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,115

Angelinasen,
<!DOCTYPE html>
<html>
<head>
    <title>Untitled</title>
    <meta charset="utf-8">
    <style type="text/css">
        .mySlider__wrapper {
            display: flex;
            flex-wrap: wrap;
        }
    </style>
    <script>
        let cropImage = [
            'polygon(0 0, 100% 0%, 97% 100%, 0% 100%)',
            'polygon(0 0, 100% 0%, 100% 100%, 0 94%)',
            'polygon(0 0, 100% 0%, 100% 94%, 0 100%)',
            'polygon(0 0, 94% 0, 100% 100%, 0 100%)',
            'polygon(0 0, 100% 3%, 100% 100%, 0 100%)',
            'polygon(1% 6%, 100% 0, 100% 100%, 0 100%)',
            'polygon(5% 0, 100% 0, 100% 100%, 0 100%)',
            'polygon(0 0, 100% 0, 100% 100%, 4% 100%)',
            'polygon(0 0, 94% 0, 100% 100%, 0 100%)',
        ];
        document.addEventListener("DOMContentLoaded", function() {
            let images = document.querySelectorAll('img');
            images.forEach(({ style }) => style.clipPath = cropImage[Math.random() * cropImage.length | 0])
        });
    </script>
</head>
<body>
    <div class="mySlider__wrapper">
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?1"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?2"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?3"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?4"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?5"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?6"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?7"></div>
        <div class="mySlider__slide"><img src="https://picsum.photos/200/145?8"></div>
    </div>
</body>
</html>
Ответить с цитированием