Serg4451D commited on
Commit
aaf72ed
·
verified ·
1 Parent(s): aa69fbc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +59 -66
index.html CHANGED
@@ -1,71 +1,64 @@
1
- import React, { useState } from 'react';
2
- import { Search } from 'lucide-react';
3
- import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
 
 
 
 
 
 
 
 
 
4
 
5
- const YouTubeSearch = () => {
6
- const [searchQuery, setSearchQuery] = useState('');
7
- const [selectedVideo, setSelectedVideo] = useState(null);
8
-
9
- const handleSearch = (e) => {
10
- e.preventDefault();
11
- if (searchQuery.trim()) {
12
- // Формируем URL для поиска на YouTube
13
- const searchUrl = `https://www.youtube.com/results?search_query=${encodeURIComponent(searchQuery)}`;
14
- window.open(searchUrl, '_blank');
15
- }
16
- };
17
 
18
- return (
19
- <div className="max-w-4xl mx-auto p-4">
20
- <Card className="mb-6">
21
- <CardHeader>
22
- <CardTitle className="text-2xl font-bold text-center">YouTube Поиск</CardTitle>
23
- </CardHeader>
24
- <CardContent>
25
- <form onSubmit={handleSearch} className="flex gap-2">
26
- <input
27
- type="text"
28
- value={searchQuery}
29
- onChange={(e) => setSearchQuery(e.target.value)}
30
- placeholder="Что вы хотите найти?"
31
- className="flex-1 px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
32
- />
33
- <button
34
- type="submit"
35
- className="px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 flex items-center gap-2"
36
- >
37
- <Search size={20} />
38
- Поиск
39
- </button>
40
- </form>
41
- </CardContent>
42
- </Card>
43
 
44
- {selectedVideo && (
45
- <Card className="mt-6">
46
- <CardContent className="p-4">
47
- <div className="relative w-full pt-[56.25%]">
48
- <iframe
49
- className="absolute top-0 left-0 w-full h-full"
50
- src={`https://www.youtube.com/embed/${selectedVideo}`}
51
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
52
- allowFullScreen
53
- ></iframe>
54
- </div>
55
- </CardContent>
56
- </Card>
57
- )}
58
 
59
- <div className="mt-4 text-sm text-gray-600">
60
- <p>Советы по поиску:</p>
61
- <ul className="list-disc pl-5 mt-2">
62
- <li>Используйте ключевые слова для более точного поиска</li>
63
- <li>Добавляйте год для поиска видео за определенный период</li>
64
- <li>Используйте кавычки для поиска точной фразы</li>
65
- </ul>
66
- </div>
67
- </div>
68
- );
69
- };
70
 
71
- export default YouTubeSearch;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>YouTube</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
 
14
+ html, body {
15
+ height: 100%;
16
+ width: 100%;
17
+ overflow: hidden;
18
+ }
 
 
 
 
 
 
 
19
 
20
+ .youtube-container {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ border: none;
27
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ .youtube-frame {
30
+ width: 100%;
31
+ height: 100%;
32
+ border: none;
33
+ }
 
 
 
 
 
 
 
 
 
34
 
35
+ .loading-message {
36
+ position: fixed;
37
+ top: 50%;
38
+ left: 50%;
39
+ transform: translate(-50%, -50%);
40
+ font-family: Arial, sans-serif;
41
+ font-size: 18px;
42
+ color: #333;
43
+ display: none;
44
+ }
 
45
 
46
+ .youtube-frame:not(:loaded) + .loading-message {
47
+ display: block;
48
+ }
49
+ </style>
50
+ </head>
51
+ <body>
52
+ <div class="youtube-container">
53
+ <iframe
54
+ class="youtube-frame"
55
+ src="https://www.youtube.com"
56
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
57
+ allowfullscreen
58
+ ></iframe>
59
+ <div class="loading-message">
60
+ Загрузка YouTube...
61
+ </div>
62
+ </div>
63
+ </body>
64
+ </html>