File tree Expand file tree Collapse file tree 5 files changed +173
-0
lines changed Expand file tree Collapse file tree 5 files changed +173
-0
lines changed Original file line number Diff line number Diff line change 1+ from flask import Blueprint , render_template
2+
3+ routes_interview = Blueprint ('routes_interview' , __name__ )
4+
5+ @routes_interview .route ('/interview' , methods = ['GET' ])
6+ def interview_page ():
7+ return render_template (
8+ 'interview.html'
9+ ), 200
Original file line number Diff line number Diff line change 1+ .interview-container {
2+ position : relative;
3+ min-height : 100vh ;
4+ display : flex;
5+ justify-content : center;
6+ align-items : flex-start;
7+ padding-top : 50px ;
8+ }
9+
10+ .placeholder-photo {
11+ width : 250px ;
12+ height : 250px ;
13+ background-color : black;
14+ margin : 0 auto;
15+ border-radius : 10px ;
16+ }
17+
18+ .mic-icon {
19+ font-size : 2.5rem ;
20+ color : # 007bff ;
21+ }
22+
23+ .mic-circle-wrapper {
24+ width : 60px ;
25+ height : 60px ;
26+ background-color : # 007bff ;
27+ border-radius : 50% ;
28+ display : flex;
29+ justify-content : center;
30+ align-items : center;
31+ margin : 15px auto 0 auto;
32+ cursor : pointer;
33+ transition : background-color 0.2s , transform 0.2s ;
34+ }
35+
36+ .mic-circle-wrapper : hover {
37+ background-color : # 0056b3 ;
38+ transform : scale (1.1 );
39+ }
40+
41+ .mic-circle-wrapper i {
42+ color : white;
43+ font-size : 1.5rem ;
44+ }
45+
46+ # start-btn {
47+ display : block;
48+ margin : 15px auto 0 auto;
49+ padding : 15px 40px ;
50+ font-size : 1.3rem ;
51+ border-radius : 12px ;
52+ background-color : # 363773 ;
53+ border : none;
54+ color : white;
55+ font-weight : bold;
56+ transition : background-color 0.2s ;
57+ }
58+ # start-btn : hover {
59+ background-color : # 218838 ;
60+ }
61+
62+ .stop-btn {
63+ position : fixed;
64+ bottom : 20px ;
65+ left : 20px ;
66+ padding : 15px 30px ;
67+ font-size : 1.2rem ;
68+ border-radius : 12px ;
69+ background-color : # 9F0F0F ;
70+ border : none;
71+ color : white;
72+ font-weight : bold;
73+ transition : background-color 0.2s ;
74+ }
75+ .stop-btn : hover {
76+ background-color : # c82333 ;
77+ }
78+
79+ .timer-section {
80+ position : absolute;
81+ top : 50px ;
82+ right : 50px ;
83+ text-align : left;
84+ max-width : 350px ;
85+ font-family : Arial, sans-serif;
86+ }
87+
88+ # timer {
89+ font-size : 2.5rem ;
90+ font-weight : bold;
91+ color : # 343a40 ;
92+ }
93+
94+ # question-number {
95+ font-size : 2.2rem ;
96+ font-weight : bold;
97+ }
98+
99+ # question-text {
100+ font-size : 2.2rem ;
101+ margin-top : 5px ;
102+ }
Original file line number Diff line number Diff line change 1+ let timerElement = document . getElementById ( "timer" ) ;
2+ let startBtn = document . getElementById ( "start-btn" ) ;
3+ let stopBtn = document . getElementById ( "stop-btn" ) ;
4+
5+ let seconds = 0 ;
6+ let timer = null ;
7+
8+ function updateTimer ( ) {
9+ let mins = Math . floor ( seconds / 60 ) ;
10+ let secs = seconds % 60 ;
11+ timerElement . textContent =
12+ `${ mins . toString ( ) . padStart ( 2 , '0' ) } :${ secs . toString ( ) . padStart ( 2 , '0' ) } ` ;
13+ }
14+
15+ startBtn ?. addEventListener ( "click" , ( ) => {
16+ if ( timer ) return ;
17+ timer = setInterval ( ( ) => {
18+ seconds ++ ;
19+ updateTimer ( ) ;
20+ } , 1000 ) ;
21+ } ) ;
22+
23+ stopBtn ?. addEventListener ( "click" , ( ) => {
24+ if ( confirm ( "Вы уверены, что хотите прервать сессию?" ) ) {
25+ clearInterval ( timer ) ;
26+ timer = null ;
27+ seconds = 0 ;
28+ updateTimer ( ) ;
29+ }
30+ } ) ;
Original file line number Diff line number Diff line change 1+ {% extends "base.html" %}
2+ {% block header %}
3+ < link rel ="stylesheet " href ="/static/css/interview.css ">
4+ < link rel ="
stylesheet "
href ="
https://cdn.jsdelivr.net/npm/[email protected] /font/bootstrap-icons.css "
> 5+ {% endblock %}
6+ {% block content %}
7+ < div class ="interview-container ">
8+
9+ < div class ="top-center text-center ">
10+ < div class ="placeholder-photo "> </ div >
11+ < div class ="mt-3 ">
12+ < button id ="start-btn " class ="btn btn-success px-4 py-2 "> Начать</ button >
13+ </ div >
14+ < div class ="mic-circle-wrapper ">
15+ < i class ="bi bi-mic-fill "> </ i >
16+ </ div >
17+ </ div >
18+
19+ < div class ="timer-section ">
20+ < h3 id ="timer "> 00:00</ h3 >
21+ < h3 class ="mt-3 "> Вопрос № < span id ="question-number "> 1</ span > </ h3 >
22+ < p id ="question-text " class ="mt-2 ">
23+ Расскажите о своем опыте работы с Python.
24+ </ p >
25+ </ div >
26+
27+ < button id ="stop-btn " class ="btn btn-danger stop-btn "> Прервать сессию</ button >
28+ < script src ="{{ url_for('static', filename='js/interview.js') }} "> </ script >
29+ </ div >
30+ {% endblock %}
Original file line number Diff line number Diff line change 3232from app .routes .task_attempts import routes_task_attempts
3333from app .routes .version import routes_version
3434from app .routes .capacity import routes_capacity
35+ from app .routes .interview import routes_interview
3536from app .status import PassBackStatus , TrainingStatus
3637from app .training_manager import TrainingManager
3738from app .utils import ALLOWED_EXTENSIONS , DEFAULT_EXTENSION
5758app .register_blueprint (routes_task_attempts )
5859app .register_blueprint (routes_version )
5960app .register_blueprint (routes_capacity )
61+ app .register_blueprint (routes_interview )
6062
6163logger = get_root_logger (service_name = 'web' )
6264
You can’t perform that action at this time.
0 commit comments