-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
92 lines (84 loc) · 4.09 KB
/
index.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!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">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" />
<title>VindieText</title>
<style>
label.btn svg path {
fill: #fff;
}
label.btn:hover svg path {
fill: #000;
}
.editor {
height: 450px;
min-height: 300px;
overflow-y: auto;
box-shadow: 0 1rem 3rem rgba(0,0,0,0.3)!important;
}
.editor:focus-visible{
border-color: #3178ffa6!important;
outline: none;
}
.color-fix{
margin-top: 2px;
height: 18px;
}
body{
background-color:#adb5bd;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row bg-secondary py-4">
<div class="col text-center">
<button onclick="document.execCommand('bold',false,null);" class="btn btn-outline-light" id="boldBtn">
<i class="fa-solid fa-bold"></i>
</button>
<button onclick="document.execCommand('italic',false,null);" class="btn btn-outline-light" id="italicBtn">
<i class="fa-solid fa-italic"></i>
</button>
<button onclick="document.execCommand('underline',false,null);" class="btn btn-outline-light" id="underlineBtn">
<i class="fa-solid fa-underline"></i>
</button>
<label for="txtColorBtn" class="btn btn-outline-light">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
<path fill-opacity=".36" d="M2 20h20c1.1 0 2 .9 2 2s-.9 2-2 2H2c-1.1 0-2-.9-2-2s.9-2 2-2z" />
<path
d="M10.63 3.93L6.06 15.58c-.27.68.23 1.42.97 1.42.43 0 .82-.27.98-.68L8.87 14h6.25l.87 2.32c.15.41.54.68.98.68.73 0 1.24-.74.97-1.42L13.37 3.93C13.14 3.37 12.6 3 12 3c-.6 0-1.15.37-1.37.93zM9.62 12L12 5.67 14.38 12H9.62z" />
</svg>
<input onchange="document.execCommand('foreColor',false,this.value);" type="color" name="txtColorBtn" id="txtColorBtn" class="color-fix">
</label>
<button onclick="document.getElementById('textContainer').style.textAlign='left';" class="btn btn-outline-light" id="lAlignBtn">
<i class="fa-solid fa-align-left"></i>
</button>
<button onclick="document.getElementById('textContainer').style.textAlign='center';" class="btn btn-outline-light" id="cAlignBtn">
<i class="fa-solid fa-align-center"></i>
</button>
<button onclick="document.getElementById('textContainer').style.textAlign='right';" class="btn btn-outline-light" id="rAlignBtn">
<i class="fa-solid fa-align-right"></i>
</button>
<button onclick="document.getElementById('textContainer').style.textAlign='justify';" class="btn btn-outline-light" id="justifyBtn">
<i class="fa-solid fa-align-justify"></i>
</button>
<button onclick="document.execCommand('undo',false,null);" class="btn btn-outline-light" id="undoBtn">
<i class="fa-solid fa-rotate-left"></i>
</button>
<button onclick="document.execCommand('redo',false,null);" class="btn btn-outline-light" id="redoBtn">
<i class="fa-solid fa-rotate-right"></i>
</button>
</div>
</div>
<div class="row">
<div class="col-8 mx-auto my-3 border border-3 editor rounded rounded-3 bg-light"
contenteditable="true" id="textContainer">
</div>
</div>
</div>
</body>
</html>