<h1><?= Html::encode($this->title) ?></h1>
<div class="mb-3">
- <button type="button" id="btn-speed-test" class="btn btn-outline-secondary btn-sm">
+ <a href="#" id="speed-test-toggle" style="color:#6c757d; text-decoration:none; font-size:14px; display:inline-flex; align-items:center; gap:4px; user-select:none;">
+ <span id="speed-test-chevron" style="display:inline-block; transition:transform .2s; font-size:10px;">▶</span>
Тест скорости загрузки
- </button>
- <div id="speed-test-progress" style="display:none; max-width:400px;" class="mt-2">
- <div class="progress" style="height:22px;">
- <div id="speed-test-bar" class="progress-bar bg-primary progress-bar-striped progress-bar-animated"
- role="progressbar" style="width:0%">0%</div>
+ </a>
+ <div id="speed-test-panel" style="display:none; padding-top:10px;">
+ <button type="button" id="btn-speed-test" class="btn btn-outline-secondary btn-sm">
+ Запустить тест
+ </button>
+ <div id="speed-test-progress" style="display:none; max-width:400px;" class="mt-2">
+ <div class="progress" style="height:22px;">
+ <div id="speed-test-bar" class="progress-bar bg-primary progress-bar-striped progress-bar-animated"
+ role="progressbar" style="width:0%">0%</div>
+ </div>
+ <small id="speed-test-progress-text" class="text-muted"></small>
</div>
- <small id="speed-test-progress-text" class="text-muted"></small>
+ <div id="speed-test-result"></div>
</div>
- <div id="speed-test-result"></div>
</div>
<?php
}
document.addEventListener('DOMContentLoaded', function () {
+ var toggle = document.getElementById('speed-test-toggle');
+ var panel = document.getElementById('speed-test-panel');
+ var chevron = document.getElementById('speed-test-chevron');
+
+ if (toggle && panel && chevron) {
+ toggle.addEventListener('click', function (e) {
+ e.preventDefault();
+ var isOpen = panel.style.display !== 'none';
+ panel.style.display = isOpen ? 'none' : 'block';
+ chevron.style.transform = isOpen ? 'rotate(0deg)' : 'rotate(90deg)';
+ });
+ }
+
var btn = document.getElementById('btn-speed-test');
if (btn) {
btn.addEventListener('click', function () {