Skip to content

Commit fbd1bc1

Browse files
alanpoulainsoyuka
authored andcommitted
Webby easter egg (api-platform#2196)
* Webby easter egg * Fix style and name * Fix review comments
1 parent 3137c47 commit fbd1bc1

File tree

4 files changed

+162
-133
lines changed

4 files changed

+162
-133
lines changed

src/Bridge/Symfony/Bundle/Resources/public/init-swagger-ui.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
'use strict';
22

33
window.onload = () => {
4+
const webby = document.getElementsByClassName('webby')[0];
5+
const web = document.getElementsByClassName('web')[0];
6+
webby.classList.add('calm');
7+
web.classList.add('calm');
8+
webby.addEventListener('click', () => {
9+
if (webby.classList.contains('frighten')) {
10+
return;
11+
}
12+
webby.classList.replace('calm', 'frighten');
13+
web.classList.replace('calm', 'frighten');
14+
setTimeout(() => {
15+
webby.classList.replace('frighten', 'calm');
16+
web.classList.replace('frighten', 'calm');
17+
}, 10000);
18+
});
19+
420
const data = JSON.parse(document.getElementById('swagger-data').innerText);
521
const ui = SwaggerUIBundle({
622
spec: data.spec,

0 commit comments

Comments
 (0)