'Is there a way to use font awesome in marp slides?
Everything is in the question. I wonder if there is a easy way to include font-awesome icons/character into a slide deck using marp ? For example using an inline and local marp directive ?
On a more general point of view, is there an easy way to add arrows or things like that in the presentation?
Solution 1:[1]
I once managed to get icons included using the following line of code, which needs to be placed after the </style>-tag.
<script src="https://kit.fontawesome.com/8b20b734d0.js" crossorigin="anonymous"></script>
FA-Icons can then be included in your markdown text using :fa-flag: for instance.
However, with the latest version of font awesome and/or marp-cli, this solution stoped working – at least for me, but it might help others.
Solution 2:[2]
Why are you using window.location?
Use:
window.location.href = "level-1.html"
Solution 3:[3]
The following code will use form as well. It is getting redirected when correct password is given
<!DOCTYPE html>
<html>
<head>
<title>Level 2</title>
<meta charset="UTF-8">
<link rel="icon" href="../msc/icon/nhicode.ico">
<script type="text/javascript">
function isValid(){
var password = document.getElementById('password').value;
if (password === "a")
{
setTimeout(() => {
window.location.replace("https://www.google.com");
});
alert(":)");
}
else
{alert('Mauvais mot de passe !')}
}
</script>
</head>
<body id="fond">
<div id="banner"> <!--Bandeau-->
Accueil
</div>
<hr style="height:40pt; visibility:hidden;" />
<div id="contenu"> <!--Enigme-->
Sans moi, Paris serait pris. Qui suis-je ? Je suis également présent dans vos apophtegme à 7.11% par mot. Bonne chance !
</div>
<br><br>
<div id="mdp"> <!--Input réponse-->
<form name="PasswordField">
Mot de passe (1 lettre):
<input type="password" id="password" name="password" placeholder="Mot de passe...">
<input type="submit" value="Niveau suivant" onclick="isValid()">
</form>
</div>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Stefan Zander |
| Solution 2 | wcyat |
| Solution 3 | Vignesh |
