From 6aa51bc74e926e1845aa5d42091795397d6bbdd3 Mon Sep 17 00:00:00 2001 From: Pavel_Sorokin Date: Sun, 9 Apr 2023 16:14:20 +0400 Subject: [PATCH] 4 lab front) --- FrontEnd/js/banner.js | 18 ++++++++++++++++++ FrontEnd/public/favicon.svg | 1 + 2 files changed, 19 insertions(+) create mode 100644 FrontEnd/js/banner.js create mode 100644 FrontEnd/public/favicon.svg diff --git a/FrontEnd/js/banner.js b/FrontEnd/js/banner.js new file mode 100644 index 0000000..6cb12f3 --- /dev/null +++ b/FrontEnd/js/banner.js @@ -0,0 +1,18 @@ +document.addEventListener('DOMContentLoaded', function () { + console.info('Loaded'); + const banners = document.querySelectorAll("#banner img"); + var old = banners.length - 1; + var current = 0; + function loop() { + banners[current].setAttribute('className', 'show'); + banners[old].setAttribute('className', 'hide'); + console.info('Banner changed'); + old = current; + current++; + if (current === banners.length) { + current = 0; + } + setTimeout(loop, 5000); + } + loop(); +}); \ No newline at end of file diff --git a/FrontEnd/public/favicon.svg b/FrontEnd/public/favicon.svg new file mode 100644 index 0000000..419c76c --- /dev/null +++ b/FrontEnd/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file