<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Untitled</title>
<link rel="canonical" href="https://codepen.io/superhuman2/pen/MYwGExQ">
<style>
p {
border: solid;
inline-size: 89%;
transition-property: inline-size;
transition-duration: 3s;
@starting-style {
inline-size: 33%;
}
}
</style>
</head>
<body>
<p id="foo">This is a test</p>
<script id="rendered-js" >
(async function () {
for (let i = 0; i < 4; i++) {
await new Promise(res => setTimeout(function () {
foo.toggleAttribute('hidden');
res();
}, 5000));
}
})()
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Untitled</title>
<link rel="canonical" href="https://codepen.io/superhuman2/pen/MYwGExQ">
<style>
p {
border: solid;
inline-size: 89%;
transition-property: inline-size;
transition-duration: 3s;
@starting-style {
inline-size: 33%;
}
}
</style>
</head>
<body>
<p id="foo">This is a test</p>
<script id="rendered-js" >
(async function () {
for (let i = 0; i < 4; i++) {
await new Promise(res => setTimeout(function () {
foo.toggleAttribute('hidden');
res();
}, 5000));
}
})()
</script>
</body>
</html>