Spaces:
Running
for example the snippet is in this form without spaces
Browse filesclass User { constructor(name, email) { this.name = name; this.email = email; this.score = 0; } login() { console.log(this.name, 'just logged in'); return this; } logout() { console.log(this.name, 'just logged out'); return this; } updateScore() { this.score++; console.log(this.name, 'score is now', this.score); return this; } } const user1 = new User('Alice', 'alice@example.com'); user1.login().updateScore().updateScore().logout();
make the form of the paragraph like this example here instead
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeFlow Typing Challenge</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-900 text-gray-100 min-h-screen">
<custom-header></custom-header>
|
@@ -3,99 +3,99 @@
|
|
| 3 |
const codeSnippets = {
|
| 4 |
html: [
|
| 5 |
`<!DOCTYPE html>
|
| 6 |
-
<html>
|
| 7 |
<head>
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
</head>
|
| 11 |
<body>
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
</body>
|
| 31 |
</html>`
|
| 32 |
-
|
| 33 |
-
|
| 34 |
javascript: [
|
| 35 |
`class User {
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
}
|
| 58 |
|
| 59 |
const user1 = new User('Alice', 'alice@example.com');
|
| 60 |
user1.login().updateScore().updateScore().logout();`
|
| 61 |
-
|
| 62 |
-
|
| 63 |
css: [
|
| 64 |
`.card-container {
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
}
|
| 70 |
|
| 71 |
.card {
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
}
|
| 77 |
|
| 78 |
.card:hover {
|
| 79 |
-
|
| 80 |
}
|
| 81 |
|
| 82 |
.card img {
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
}
|
| 88 |
|
| 89 |
.card-content {
|
| 90 |
-
|
| 91 |
}
|
| 92 |
|
| 93 |
@media (max-width: 768px) {
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
}`
|
| 98 |
-
|
| 99 |
};
|
| 100 |
// Get all snippets as one array for "all languages" option
|
| 101 |
function getAllSnippets() {
|
|
|
|
| 3 |
const codeSnippets = {
|
| 4 |
html: [
|
| 5 |
`<!DOCTYPE html>
|
| 6 |
+
<html lang="en">
|
| 7 |
<head>
|
| 8 |
+
<meta charset="UTF-8">
|
| 9 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 10 |
+
<title>My Portfolio</title>
|
| 11 |
+
<link rel="stylesheet" href="styles.css">
|
| 12 |
</head>
|
| 13 |
<body>
|
| 14 |
+
<header>
|
| 15 |
+
<nav>
|
| 16 |
+
<ul>
|
| 17 |
+
<li><a href="#home">Home</a></li>
|
| 18 |
+
<li><a href="#projects">Projects</a></li>
|
| 19 |
+
<li><a href="#contact">Contact</a></li>
|
| 20 |
+
</ul>
|
| 21 |
+
</nav>
|
| 22 |
+
</header>
|
| 23 |
+
<main>
|
| 24 |
+
<section id="home">
|
| 25 |
+
<h1>Welcome to My Portfolio</h1>
|
| 26 |
+
<p>I build amazing web experiences</p>
|
| 27 |
+
</section>
|
| 28 |
+
</main>
|
| 29 |
+
<footer>
|
| 30 |
+
<p>© ${new Date().getFullYear()}</p>
|
| 31 |
+
</footer>
|
| 32 |
</body>
|
| 33 |
</html>`
|
| 34 |
+
],
|
|
|
|
| 35 |
javascript: [
|
| 36 |
`class User {
|
| 37 |
+
constructor(name, email) {
|
| 38 |
+
this.name = name;
|
| 39 |
+
this.email = email;
|
| 40 |
+
this.score = 0;
|
| 41 |
+
}
|
| 42 |
|
| 43 |
+
login() {
|
| 44 |
+
console.log(this.name, 'just logged in');
|
| 45 |
+
return this;
|
| 46 |
+
}
|
| 47 |
|
| 48 |
+
logout() {
|
| 49 |
+
console.log(this.name, 'just logged out');
|
| 50 |
+
return this;
|
| 51 |
+
}
|
| 52 |
|
| 53 |
+
updateScore() {
|
| 54 |
+
this.score++;
|
| 55 |
+
console.log(this.name, 'score is now', this.score);
|
| 56 |
+
return this;
|
| 57 |
+
}
|
| 58 |
}
|
| 59 |
|
| 60 |
const user1 = new User('Alice', 'alice@example.com');
|
| 61 |
user1.login().updateScore().updateScore().logout();`
|
| 62 |
+
],
|
|
|
|
| 63 |
css: [
|
| 64 |
`.card-container {
|
| 65 |
+
display: grid;
|
| 66 |
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
| 67 |
+
gap: 2rem;
|
| 68 |
+
padding: 2rem;
|
| 69 |
}
|
| 70 |
|
| 71 |
.card {
|
| 72 |
+
background: white;
|
| 73 |
+
border-radius: 8px;
|
| 74 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 75 |
+
transition: transform 0.3s ease;
|
| 76 |
}
|
| 77 |
|
| 78 |
.card:hover {
|
| 79 |
+
transform: translateY(-5px);
|
| 80 |
}
|
| 81 |
|
| 82 |
.card img {
|
| 83 |
+
width: 100%;
|
| 84 |
+
height: 200px;
|
| 85 |
+
object-fit: cover;
|
| 86 |
+
border-radius: 8px 8px 0 0;
|
| 87 |
}
|
| 88 |
|
| 89 |
.card-content {
|
| 90 |
+
padding: 1.5rem;
|
| 91 |
}
|
| 92 |
|
| 93 |
@media (max-width: 768px) {
|
| 94 |
+
.card-container {
|
| 95 |
+
grid-template-columns: 1fr;
|
| 96 |
+
}
|
| 97 |
}`
|
| 98 |
+
]
|
| 99 |
};
|
| 100 |
// Get all snippets as one array for "all languages" option
|
| 101 |
function getAllSnippets() {
|