html
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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Recherche Google</title>
<link href="https://fonts.googleapis.com/css2?family=Handlee&display=swap" rel="stylesheet"> <!-- style de police -->
<!-- style de la page -->
<style>
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
font-family: 'Handlee', sans-serif;
background-color: #lightblue;
color: #lightblue;
overflow: hidden;
transition: background-color 0.3s, color 0.3s ease;
overflow-y: auto;
}
::-webkit-scrollbar {
width: 11px;
}
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#scrollToTop {
position: fixed;
bottom: 10px;
right: 10px;
padding: 10px 10px;
background-color: #0F40C6;
color: black;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 10px;
display: none;
}
#scrollToTop:hover {
background-color: whitesmoke ;
}
Enter to Rename, Shift+Enter to Preview
js
js
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
/* Créé par Elpadre */
document.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {
button.click();
}
});
const scrollToTopButton = document.getElementById('scrollToTop');
window.addEventListener('scroll', function () {
if (window.scrollY > 500) {
scrollToTopButton.style.display = 'block';
} else {
scrollToTopButton.style.display = 'none';
}
});
scrollToTopButton.addEventListener('click', function () {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Exécuter