File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Smooth animation for <details>
2+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
3+ document . querySelectorAll ( 'details' ) . forEach ( function ( detail ) {
4+ detail . addEventListener ( 'toggle' , function ( ) {
5+ if ( detail . open ) {
6+ detail . classList . add ( 'open' ) ;
7+ } else {
8+ detail . classList . remove ( 'open' ) ;
9+ }
10+ } ) ;
11+ } ) ;
12+ } ) ;
Original file line number Diff line number Diff line change 1+ /* Dark theme styles (2024-2025) */
2+ body {
3+ background : linear-gradient (135deg , # 0d0d0d, # 1a1a1a );
4+ color : # f0f0f0 ;
5+ font-family : Arial, Helvetica, sans-serif;
6+ display : flex;
7+ flex-direction : column;
8+ align-items : center;
9+ text-align : center;
10+ min-height : 100vh ;
11+ margin : 0 ;
12+ }
13+ h1 , h2 , p {
14+ margin : 0.5em 0 ;
15+ }
16+
17+ ul { list-style : none; padding : 0 ; }
18+ summary {
19+ cursor : pointer;
20+ font-weight : bold;
21+ }
22+ details .open > * { animation : fadeIn 0.5s ease forwards; }
23+ details [open ] summary ::after {
24+ animation : fadeIn 0.5s ease forwards;
25+ }
26+ @keyframes fadeIn {
27+ from { opacity : 0 ; }
28+ to { opacity : 1 ; }
29+ }
Original file line number Diff line number Diff line change 11<!DOCTYPE HTML>
2- < html xmlns:th ="http://www.thymeleaf.org ">
2+ < html xmlns:th ="http://www.thymeleaf.org " data-theme =" synthwave " >
33< head >
44 < title > Interview Questions</ title >
55 < meta charset ="UTF-8 "/>
6+ < script src ="https://cdn.tailwindcss.com "> </ script >
7+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/daisyui@latest/dist/full.css "/>
8+ < link rel ="stylesheet " th:href ="@{/style.css} "/>
9+ < script th:src ="@{/script.js} " defer > </ script >
610</ head >
7- < body >
11+ < body class =" min-h-screen flex flex-col items-center text-center p-4 " >
812< h1 > Выберите категории</ h1 >
913< form action ="/question " method ="get ">
1014 < ul >
@@ -15,7 +19,7 @@ <h1>Выберите категории</h1>
1519 </ label >
1620 </ li >
1721 </ ul >
18- < button type ="submit "> Получить вопросы</ button >
22+ < button type ="submit " class =" btn btn-primary mt-2 " > Получить вопросы</ button >
1923</ form >
2024</ body >
2125</ html >
Original file line number Diff line number Diff line change 11<!DOCTYPE HTML>
2- < html xmlns:th ="http://www.thymeleaf.org ">
2+ < html xmlns:th ="http://www.thymeleaf.org " data-theme =" synthwave " >
33< head >
44 < title > Вопрос</ title >
55 < meta charset ="UTF-8 "/>
6+ < script src ="https://cdn.tailwindcss.com "> </ script >
7+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/daisyui@latest/dist/full.css "/>
8+ < link rel ="stylesheet " th:href ="@{/style.css} "/>
9+ < script th:src ="@{/script.js} " defer > </ script >
610</ head >
7- < body >
11+ < body class =" min-h-screen flex flex-col items-center text-center p-4 " >
812< h1 th:text ="'Категории: ' + ${#strings.listJoin(categories, ', ')} "> </ h1 >
913< div th:if ="${qa != null} ">
1014 < h2 th:text ="${qa.category} "> </ h2 >
1115 < p th:text ="${qa.question} "> </ p >
1216 < details >
13- < summary > Answer </ summary >
17+ < summary > Ответ </ summary >
1418 < p th:text ="${qa.answer} "> </ p >
1519 </ details >
1620</ div >
1721< div th:if ="${qa == null} ">
1822 < p > No questions found.</ p >
1923</ div >
20- < a th:href ="@{/} "> К категориям</ a >
21- < a th:href ="@{/question(nav='back')} "> Назад</ a >
22- < a th:href ="@{/question(nav='next')} "> Следующий</ a >
24+ < a th:href ="@{/} " class =" btn btn-primary m-1 " > К категориям</ a >
25+ < a th:href ="@{/question(nav='back')} " class =" btn m-1 " > Назад</ a >
26+ < a th:href ="@{/question(nav='next')} " class =" btn m-1 " > Следующий</ a >
2327</ body >
2428</ html >
You can’t perform that action at this time.
0 commit comments