In this video, we will create an awesome text effect CSS only. This video on how to clip image on text using -webkit-background-clip. For a preview click on Demo If you want to get the complete source code in a zip file then click the "Fork me on GitHub" button below that will redirect you to my GitHub account where you found all my source code files. Copy Code(select code part and copy using "CTRL + C" or using R Click to mouse)🡇 HTML <! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" > < meta http-equiv = "X-UA-Compatible" content = "IE=edge" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < title >How to clip image on text</ title > <!-- style.css --> < link rel = "stylesheet" href = "style.css" > </ head > < body >
In this video, we will create a text to speech converter using javascript.
For a preview click on Demo
If you want to get the complete source code in a zip file then click the "Fork me on GitHub" button below that will redirect you to my GitHub account where you found all my source code files.
Copy Code(select code part and copy using "CTRL + C" or using R Click to mouse)🡇
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text To Speach Converter</title>
<!-- style.css -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<input type="text" placeholder="Enter text to speech...">
<button>Speech</button>
<!-- JavaScript -->
<script src="main.js"></script>
</body>
</html>
CSS
*{
margin: 0;
padding: 0;
}
body{
min-height: 100vh;
background-color: #001727;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
input{
font-size: 3em;
color: #f1f1f1;
background: transparent;
border: none;
border-bottom: 3px solid #f1f1f1;
padding: 10px;
outline: none;
}
button{
color: #001727;
background-color: #f1f1f1;
outline: none;
font-size: 30px;
margin-top: 30px;
padding: 15px 30px;
border-radius: 10px;
border: 1px solid #f1f1f1;
cursor: pointer;
transition: 0.3s;
}
button:active{
background-color: transparent;
color: #f1f1f1;
}
JavaScript
let btn = document.querySelector("button");
let userText = document.querySelector("input");
let msg = new SpeechSynthesisUtterance();
// when click on button
btn.addEventListener("click",()=>{
// when input value is blank
if(userText.value == ""){
msg.text = "Please type text that you wanna speech";
} else{
msg.text = userText.value;
}
window.speechSynthesis.speak(msg);
});
Fork me on GitHub
Click on download zip to download complete source in zip file.
Subscribe to me on YouTube
Like & Comment on my video on YouTube & press the bell icon to get notification first.
Follow me on Instagram
Comment down any query if you have.
Comments
Post a Comment
If you have any doubts please let me know.