Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
archivarius
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andrey Kuvshinov
archivarius
Commits
8d2af68c
Commit
8d2af68c
authored
Oct 06, 2024
by
AK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add searchform
parent
2648a6e8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
155 additions
and
15 deletions
+155
-15
speech.js
frontend/js/speech.js
+19
-0
main.js
frontend/main.js
+8
-0
main.css
frontend/styles/main.css
+33
-2
search.css
frontend/styles/search.css
+51
-0
main.php
main.php
+18
-12
searchform.php
partials/searchform.php
+12
-0
tpl_functions.php
tpl_functions.php
+14
-1
No files found.
frontend/js/speech.js
0 → 100644
View file @
8d2af68c
const
searchInput
=
document
.
getElementById
(
'searchInput'
);
const
micBtn
=
document
.
getElementById
(
'micBtn'
);
const
recognition
=
new
(
window
.
SpeechRecognition
||
window
.
webkitSpeechRecognition
)();
recognition
.
lang
=
'ru-RU'
;
// Установите язык распознавания
recognition
.
interimResults
=
false
;
micBtn
.
addEventListener
(
'click'
,
()
=>
{
recognition
.
start
();
});
recognition
.
addEventListener
(
'result'
,
(
event
)
=>
{
const
transcript
=
event
.
results
[
0
][
0
].
transcript
;
searchInput
.
value
=
transcript
;
});
recognition
.
addEventListener
(
'end'
,
()
=>
{
recognition
.
stop
();
});
\ No newline at end of file
frontend/main.js
View file @
8d2af68c
...
...
@@ -3,6 +3,14 @@ import './styles/fonts.css'
import
'./styles/reset.css'
import
'./styles/main.css'
import
'./styles/tabs.css'
import
'./styles/search.css'
//import './styles/fontawesone.css'
import
'./js/speech.js'
...
...
frontend/styles/main.css
View file @
8d2af68c
...
...
@@ -19,12 +19,20 @@ body {
}
header
{
display
:
flex
;
background
:
var
(
--widget-bg
,
#fff
);
color
:
#333333
;
padding
:
10px
20px
;
}
.header-inner
{
display
:
flex
;
gap
:
10%
;
align-items
:
center
;
max-width
:
1440px
;
margin
:
0
auto
;
}
header
h1
{
margin
:
0
;
font-size
:
1.3rem
;
...
...
@@ -44,13 +52,30 @@ header a:hover {
}
.container
{
margin
:
0
auto
;
width
:
1440px
;
}
.logo
{
display
:
flex
;
gap
:
8px
;
align-items
:
center
;
}
.logo-title
{
font-family
:
Vezitsa
;
font-size
:
1.8rem
;
}
.logo-img
{
width
:
80px
;
cursor
:
pointer
;
}
.wikilink1
{
font-size
:
1.3rem
;
}
.footer_logo
{
...
...
@@ -122,7 +147,7 @@ a:hover {
margin
:
10px
auto
0
;
/* Отступ сверху и центровка */
}
p
{
.section_highlight_wrapper
p
{
margin-top
:
12px
;
}
...
...
@@ -146,8 +171,14 @@ footer p {
/* Адаптивный дизайн для мобильных устройств */
@media
(
max-width
:
768px
)
{
body
{
max-width
:
100%
;
}
main
{
flex-direction
:
column
;
padding
:
12px
;
max-width
:
100%
;
}
aside
{
...
...
frontend/styles/search.css
0 → 100644
View file @
8d2af68c
/* Общий контейнер для поиска */
.search-wrapper
{
position
:
relative
;
display
:
flex
;
align-items
:
center
;
width
:
100%
;
max-width
:
400px
;
}
/* Стиль поля ввода */
.search-wrapper
input
[
type
=
"text"
]
{
width
:
100%
;
padding
:
10px
40px
10px
40px
;
/* Отступы для иконок */
font-size
:
16px
;
border
:
1px
solid
#ccc
;
border-radius
:
25px
;
outline
:
none
;
}
/* Стили для кнопок-иконок */
.icon-button
{
position
:
absolute
;
background
:
none
;
border
:
none
;
cursor
:
pointer
;
font-size
:
18px
;
padding
:
10px
;
}
/* Иконка микрофона (слева) */
.mic-btn
{
left
:
10px
;
color
:
#666
;
}
/* Иконка лупы (справа) */
.search-btn
{
right
:
10px
;
color
:
#666
;
}
/* Стили при наведении на иконки */
.icon-button
:hover
{
color
:
#000
;
}
/* Увеличение иконки при нажатии */
.icon-button
:active
{
transform
:
scale
(
0.9
);
}
</
style
>
\ No newline at end of file
main.php
View file @
8d2af68c
<?php
if
(
!
defined
(
'DOKU_INC'
))
die
();
// Прямая доступность запрещена
// Включаем стандартные DokuWiki функции
...
...
@@ -10,30 +11,35 @@ include_once('tpl_functions.php');
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1"
/>
<?php
tpl_metaheaders
()
?>
<title>
<?php
tpl_pagetitle
();
?>
[
<?php
echo
strip_tags
(
$conf
[
'title'
]);
?>
]
</title>
<?php
tpl_metaheaders
();
?>
<?=
$frontend_str
?>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
/>
</head>
<body>
<header
id=
"dokuwiki__header"
>
<div
class=
"logo-img"
><img
src=
"/lib/tpl/ak/frontend/assets/imgs/logo.png"
/></div>
<div
class=
"logo"
><a
href=
"
<?php
echo
wl
();
?>
"
>
Библиотека Архивариус
</a></div>
<div
class=
"header-inner"
>
<nav>
<?php
tpl_searchform
();
// Форма поиска ?>
<div
class=
"header-inner"
>
<div
class=
"logo"
>
<div
class=
"logo-img"
><a
href=
"
<?php
echo
wl
();
?>
"
><img
src=
"/lib/tpl/ak/frontend/assets/imgs/logo.png"
/></a></div>
<div
class=
"logo-title"
><a
href=
"
<?php
echo
wl
();
?>
"
>
Библиотека Архивариус
</a></div>
</div>
<?
include
(
'partials/searchform.php'
);
?>
<nav>
<?php
if
(
isset
(
$_SERVER
[
'REMOTE_USER'
]))
:
?>
<a
class=
"button"
href=
"
<?php
echo
wl
(
''
,
[
'do'
=>
'admin'
]);
?>
"
>
Админка
</a>
<a
class=
"button"
href=
"
<?php
echo
wl
(
''
,
[
'do'
=>
'logout'
]);
wl
(
'doku.php?id=start&do=logout'
);
?>
"
>
Выйти
</a>
<?php
else
:
?>
<a
class=
"button"
href=
"
<?php
echo
wl
(
'doku.php?id=start&do=login'
);
?>
"
>
Войти
</a>
<?php
endif
;
?>
<a
class=
"button"
href=
"
<?php
echo
wl
(
''
,
[
'do'
=>
'admin'
]);
?>
"
>
Админка
</a>
<a
class=
"button"
href=
"
<?php
echo
wl
(
''
,
[
'do'
=>
'logout'
]);
wl
(
'doku.php?id=start&do=logout'
);
?>
"
>
Выйти
</a>
<?php
else
:
?>
<a
class=
"button"
href=
"
<?php
echo
wl
(
'doku.php?id=start&do=login'
);
?>
"
>
Войти
</a>
<?php
endif
;
?>
</nav>
</div>
</header>
<main
class=
"wrapper"
>
<main
class=
"wrapper container"
>
<section
class=
"content"
>
<?php
tpl_content
();
// Основной контент ?>
</
section
>
...
...
partials/searchform.php
0 → 100644
View file @
8d2af68c
<form
action=
"
<?php
echo
wl
();
?>
"
method=
"get"
id=
"search-form"
>
<div
class=
"search-wrapper"
>
<input
type=
"hidden"
name=
"do"
value=
"search"
/>
<input
type=
"text"
id=
"searchInput"
name=
"id"
placeholder=
"Введите запрос..."
/>
<button
type=
"button"
id=
"micBtn"
class=
"icon-button mic-btn"
>
<i
class=
"fas fa-microphone"
></i>
</button>
<button
type=
"submit"
class=
"icon-button search-btn"
>
<i
class=
"fa fa-search"
></i>
</button>
</div>
</form>
\ No newline at end of file
tpl_functions.php
View file @
8d2af68c
...
...
@@ -33,7 +33,20 @@ if ( defined('VITE_ENV') && VITE_ENV === 'dev' ) {
function
tpl_main_page
()
{
global
$INFO
;
// Здесь вы можете определить HTML структуру для главной страницы
echo
'<h1>Добро пожаловать на главную страницу</h1>'
;
// Вы можете получить содержимое, если нужно
echo
tpl_content
();
// Здесь можете добавить свой контент или функционал
}
//include_once 'tpl/functions.php';
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment