Skip to content

Instantly share code, notes, and snippets.

@kckustomac
Created July 3, 2024 02:43
Show Gist options
  • Save kckustomac/9afb34812235bebca78a8b953df5b141 to your computer and use it in GitHub Desktop.
Save kckustomac/9afb34812235bebca78a8b953df5b141 to your computer and use it in GitHub Desktop.
Command Line Textarea

Command Line Textarea

Replicate the ubuntu terminal and applied on the textarea

A Pen by Jao on CodePen.

License.

<div class="wrapper">
<div class="cmd">
<div class="title-bar">ubuntu@ubuntu: ~</div>
<div class="tool-bar">
<ul>
<li><a href="#">File</a></li>
<li><a href="#">Edit</a></li><li><a href="#">View</a></li>
</ul>
</div>
<textarea class="textarea">Type something here...</textarea>
</div>
</div>
body{
font-family: arial;
}
.wrapper{
width: 800px;
height: 100vh;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
}
.cmd{
position: relative;
display: block;
height: 300px;
width: 100%;
border: 1px solid #000000;
border-radius: 4px;
overflow: hidden;
box-shadow: 0px 8px 18px #4b1d3f;
}
/*
* 1. Set position
* 2. Set dimension
* 3. Style
*/
.title-bar{
/* 1 */
position: absolute;
top: 0;
left: 0;
right: 0;
/* 2 */
width: 100%;
height: 40px;
/* 3 */
display: block;
color: #FFFFFF;
line-height: 40px;
font-weight: 600;
background-color: #242424;
text-align: center;
}
.tool-bar{
position: absolute;
top: 40px;
left: 0;
right: 0;
display: block;
width: 100%;
height: 30px;
line-height: 30px;
background-color: #242424;
}
.tool-bar ul{
list-style-type: none;
margin: 0px;
padding: 0px;
}
.tool-bar ul li{
display: inline-block;
margin: 0;
padding: 0;
}
.tool-bar ul li a{
padding: 0px 6px;
text-decoration: none;
color: #FFFFFF;
}
.tool-bar ul li a:hover{
text-decoration: underline;
}
.textarea{
position: relative;
top: 70px;
padding: 12px;
resize: none;
width: 100%;
height: calc(100% - 70px);
background-color: #4b1d3f;
border: none;
color: #FFFFFF;
margin: 0px;
font-size: 1.1rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment