-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
145 lines (120 loc) · 5.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!--
FEITO POR: https://github.com/LucasATS
INSPIRADO EM https://cachemonet.com/ (As imagens, gifs e o audio foram extraídas desse site)
Os textos foram extraídos desse site https://www.42frases.com.br/frases-curtas-e-engracadas/
-->
<html lang="pt-br">
<head>
<!-- Config -->
<meta charset="UTF-8">
<title>🎲 Aleatório 🎲</title>
<meta name="theme-color" content="#D089FF">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- SEO -->
<!-- Primary Meta Tags -->
<meta name="title" content="🎲 Aleatório 🎲">
<meta name="description" content="Um site divertido feito em react usando gifs aleatórios.">
<meta name="keywords" content="LucasATS, react, aleatório, frases, open, source, brazil, gifs, divertido">
<meta name="robots" content="index, follow">
<meta name="language" content="Portuguese">
<meta name="author" content="LucasATS">
<meta name="thumbnail" content="https://raw.githubusercontent.com/LucasATS/SiteAleatorio/main/src/preview-low.png">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://lucasats.github.io/SiteAleatorio/">
<meta property="og:title" content="🎲 Aleatório 🎲">
<meta property="og:description" content="Um site divertido feito em react usando gifs aleatórios.">
<meta property="og:image" content="https://raw.githubusercontent.com/LucasATS/SiteAleatorio/main/src/preview-low.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://lucasats.github.io/SiteAleatorio/">
<meta property="twitter:title" content="🎲 Aleatório 🎲">
<meta property="twitter:description" content="Um site divertido feito em react usando gifs aleatórios.">
<meta property="twitter:image" content="https://raw.githubusercontent.com/LucasATS/SiteAleatorio/main/src/preview-low.png">
<!-- FAVICON -->
<link rel="shortcut icon" href="./src/favicon.png" type="image/x-icon">
<!-- React Online -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<!-- Offine -->
<script src="./app.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-KK9GMMP0VJ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-KK9GMMP0VJ');
</script>
<!-- VISITE MINHA PÁGINA NO GITHUB :D -->
<style>
@media only screen and (orientation: portrait) { .github-img { width: 60px !important; } }
.carimbo-github-img { width: 60px; border-radius: 360px; }
.carimbo-github-link{ position: fixed; right: 20px; bottom: 20px; z-index: 10; }
</style>
<a title="Visite minha página no github"
href="https://github.com/LucasATS/SiteAleatorio#-site-aleat%C3%B3rio-"
class="carimbo-github-link">
<img class="carimbo-github-img" src="./src/github_icon.svg">
</a>
<!-- CLIQUE NA TELA -->
<div id="box-click" onclick="AvisoClickNaTela(false);" class="box-click">
<img style="width: 60px; border-radius: 360px;" src="./src/click.svg">
<p>CLIQUE NA TELA 😁</p>
</div>
<div id="root"></div>
<script type="text/babel">
const lenBackImg = (linksImgFore.length - 1);
const lenForeImg = (linksImgFore.length - 1);
const lenTexto = (frases.length - 1);
function DivImagem(props) {
let classe = props.classe;
let imagem = props.imagem;
const estilo = { backgroundImage: `url(${imagem})`, };
return (<div class={classe} style={estilo}></div>);
}
function App(props) {
const [textos, setTextos] = React.useState(frases);
const [Random, setRandom] = React.useState({
texto: Aleatorio(lenTexto),
back: Aleatorio(lenBackImg),
fore: Aleatorio(lenForeImg),
});
const Mudar = () => {
MusicPlay();
setRandom({
texto: Aleatorio(lenTexto),
back: Aleatorio(lenBackImg),
fore: Aleatorio(lenForeImg),
});
AvisoClickNaTela(false);
console.log(linksImgBack[Random.back], linksImgFore[Random.fore], textos[Random.texto])
};
// Faz o site atualizar as imagens automaticamente sem precisar ficar só clicando
// porém sem perder a função de clicar para atualizar.
React.useEffect(() => {
const interval = setInterval(() => {
Mudar();
}, 5000);
return () => clearInterval(interval);
});
return (<>
<DivImagem classe="backImg" imagem={linksImgBack[Random.back]} />
<DivImagem classe="foreImg" imagem={linksImgFore[Random.fore]} />
<h3 title="CLICA AÍ" class="texto" onClick={() => Mudar()}><b>{textos[Random.texto]}</b></h3>
</>);
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
</script>
<!-- MUSICA -->
<video id="music">
<source src="./src/windowdipper.mp3" type="audio/mpeg">
</video>
</body>
</html>