File tree 1 file changed +54
-0
lines changed
1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > CF Pages Branch Converter</ title >
7
+ < style >
8
+ .wrapper {
9
+ height : 100dvh ;
10
+ width : 100% ;
11
+ display : flex;
12
+ align-items : center;
13
+ justify-content : center;
14
+ flex-direction : column;
15
+ gap : 2rem ;
16
+ text-align : center;
17
+ font-family : sans-serif;
18
+ color : rgb (17 , 24 , 39 );
19
+ }
20
+
21
+ input {
22
+ padding : 0.25rem 0.5rem ;
23
+ border-radius : 4px ;
24
+ border : 1px solid black;
25
+ width : 100% ;
26
+ }
27
+
28
+ # result {
29
+ font-weight : bold;
30
+ }
31
+ </ style >
32
+ </ head >
33
+ < body >
34
+
35
+ < div class ="wrapper ">
36
+ < div >
37
+ < h1 > Paste Branch</ h1 >
38
+ < input type ="text " id ="branch " oninput ="convert(this.value) " onchange ="convert(this.value) " />
39
+ </ div >
40
+
41
+ < div id ="result "> </ div >
42
+ < button type ="button " onclick ="copy() "> Copy</ button >
43
+
44
+ < script >
45
+ function convert ( val ) {
46
+ result . innerText = val . replaceAll ( / [ ^ a - z A - Z \d ] / g, '-' ) . toLowerCase ( ) ;
47
+ }
48
+
49
+ function copy ( ) {
50
+ navigator . clipboard . writeText ( result . innerText )
51
+ }
52
+ </ script >
53
+ </ div >
54
+ </ html >
You can’t perform that action at this time.
0 commit comments