Pashtetuum commited on
Commit
aa3b3e6
·
verified ·
1 Parent(s): 97ccd66

Update Главная.html

Browse files
Files changed (1) hide show
  1. Главная.html +20 -15
Главная.html CHANGED
@@ -19,34 +19,40 @@
19
  <style>
20
  /* Стили для кнопки */
21
  #scrollBtn {
22
- display: none;
23
  position: fixed;
24
- bottom: 20px;
25
  right: 20px;
26
  z-index: 99;
27
- border: none;
28
- outline: none;
29
- background-color: #333;
30
- color: white;
31
  cursor: pointer;
32
- padding: 15px;
33
- border-radius: 10px;
 
 
 
 
 
 
 
 
34
  }
35
  </style>
36
  </head>
37
  <body>
38
 
39
- <!-- Сама кнопка -->
40
- <button id="scrollBtn" title="Прокрутить к началу страницы">Наверх</button>
41
- <script>
42
- // Показываем или скрываем кнопку при прокрутке страницы
 
 
 
43
  window.onscroll = function() {scrollFunction()};
44
 
45
  function scrollFunction() {
46
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
47
- document.getElementById("scrollBtn").style.display = "block";
48
  } else {
49
- document.getElementById("scrollBtn").style.display = "none";
50
  }
51
  }
52
 
@@ -56,7 +62,6 @@ document.getElementById("scrollBtn").onclick = function() {
56
  document.documentElement.scrollTop = 0; // Для современных браузеров
57
  }
58
  </script>
59
-
60
  <script type="application/ld+json">{
61
  "@context": "http://schema.org",
62
  "@type": "Organization",
 
19
  <style>
20
  /* Стили для кнопки */
21
  #scrollBtn {
 
22
  position: fixed;
23
+ bottom: -60px; /* Начальное положение кнопки вне экрана */
24
  right: 20px;
25
  z-index: 99;
 
 
 
 
26
  cursor: pointer;
27
+ width: 50px; /* Ширина изображения */
28
+ height: 50px; /* Высота изображения */
29
+ border-radius: 50%; /* Сделаем изображение круглым */
30
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); /* Добавляем тень для кнопки */
31
+ transition: bottom 0.3s ease; /* Плавное изменение положения */
32
+ }
33
+ #scrollBtn img {
34
+ width: 100%;
35
+ height: 100%;
36
+ border-radius: 50%;
37
  }
38
  </style>
39
  </head>
40
  <body>
41
 
42
+ <!-- Сама кнопка с изображением -->
43
+ <a href="#" id="scrollBtn" title="Прокрутить к началу страницы">
44
+ <img src="images/strelka.png" alt="Стрелка">
45
+ </a>
46
+
47
+ <script>
48
+ // Показываем кнопку при прокрутке страницы
49
  window.onscroll = function() {scrollFunction()};
50
 
51
  function scrollFunction() {
52
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
53
+ document.getElementById("scrollBtn").style.bottom = "20px"; // Плавное появление кнопки
54
  } else {
55
+ document.getElementById("scrollBtn").style.bottom = "-60px"; // Скрытие кнопки
56
  }
57
  }
58
 
 
62
  document.documentElement.scrollTop = 0; // Для современных браузеров
63
  }
64
  </script>
 
65
  <script type="application/ld+json">{
66
  "@context": "http://schema.org",
67
  "@type": "Organization",