Skip to content

Commit cebaf49

Browse files
authored
fix: text shaodw copy code to clipboard and updating default values (#336)
* feat: adding tooltip when hover on Go Back icon * updating default values for text shadow * adding text shadow code to copy to clipboard
1 parent 29b8210 commit cebaf49

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,9 @@ <h2>
602602
</span>
603603
<input
604604
type="range"
605-
max="50"
605+
max="20"
606606
min="-20"
607-
value="5"
607+
value="2"
608608
id="text-shadow-h-offset"
609609
class="text-shadow-inputs"
610610
/>
@@ -617,9 +617,9 @@ <h2>
617617
</span>
618618
<input
619619
type="range"
620-
max="50"
620+
max="20"
621621
min="-20"
622-
value="10"
622+
value="2"
623623
id="text-shadow-v-offset"
624624
class="text-shadow-inputs"
625625
/>
@@ -634,9 +634,9 @@ <h2>
634634
</span>
635635
<input
636636
type="range"
637-
max="100"
637+
max="25"
638638
min="0"
639-
value="18"
639+
value="4"
640640
id="text-shadow-blur"
641641
class="text-shadow-inputs"
642642
/>

src/lib/general.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ function actOnGenerator(attribute: string, outputElement: HTMLElement) {
9595
}
9696
`;
9797
break;
98+
case 'text-shadow':
99+
element = outputElement.style;
100+
console.log('element: ', element.textShadow);
101+
codeToCopy = `
102+
div {
103+
text-shadow: ${element.textShadow};
104+
}
105+
`;
106+
break;
98107
}
99108

100109
copy(codeToCopy);

src/style.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,37 @@ input[type='number']::-webkit-outer-spin-button {
575575
display: block;
576576
}
577577

578+
.go-back-icon span.tooltip {
579+
position: relative;
580+
bottom: -20px;
581+
right: 40px;
582+
padding: 5px;
583+
width: 50px;
584+
margin-top: 35px;
585+
margin-right: -50px;
586+
font-size: 15px;
587+
text-align: center;
588+
color: var(--input-color);
589+
background-color: var(--text-color);
590+
border-radius: 5px;
591+
display: none;
592+
}
593+
594+
.go-back-icon .tooltip::before {
595+
content: '';
596+
position: absolute;
597+
top: -15%;
598+
left: 8%;
599+
margin-top: -5px;
600+
border-width: 12px;
601+
border-style: solid;
602+
border-color: transparent var(--text-color) transparent transparent;
603+
}
604+
605+
.go-back-icon:hover .tooltip {
606+
display: block;
607+
}
608+
578609
.output {
579610
width: var(--generator-width);
580611
height: 300px;

0 commit comments

Comments
 (0)