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>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Valentine's Day</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
</head>
<body>
<main>
<div class="prompt">
<form novalidate>
<h1>Welcome!</h1>
<div class="name">
<label for="name">Your name</label>
<input type="text" name="name" id="name" placeholder="Type here.." required />
<span></span>
</div>
<div class="lang">
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
17
18
19
20
21
22
23
24
25
26
27
28
:root {
--accent-color: #FF526E;
--accent-color-gradient: linear-gradient(135deg, #FF8D9F, #FF526E);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
color: #232324;
}
body * {
font-family: "IBM Plex Sans", serif;
font-weight: 400;
}
body[dir="rtl"] * {
font-family: "IBM Plex Sans Arabic", serif;
}
main {
height: 100dvh;
interpolate-size: allow-keywords;
overflow-x: clip;
display: grid;
place-items: center;
}
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
document.addEventListener('DOMContentLoaded', () => {
const form = document.querySelector('.prompt form');
const name = document.querySelector('#name');
const card = document.querySelector('.card');
const prompt = document.querySelector('.prompt');
if (!form || !name || !card || !prompt) {
console.error('One or more elements not found!');
return;
}
const no = [
{
text: "",
img_src: "https://i.postimg.cc/ZKzKdw6n/cat-01.gif"
},
{
text: {
ar: "أعدك بأنه سيكون لا يُنسى",
en: "I promise it will be unforgettable"
},
img_src: "https://i.postimg.cc/BnMqRskP/cat-02.gif"
},
{
text: {
ar: "فكر في الأمر مرة أخرى",
en: "Think about it again"
},
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run