Skip to content

Commit d166d00

Browse files
committed
❤️ Ko-Fi popup
1 parent 2629130 commit d166d00

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed

src/components/blueprintSettingsDialog.svelte

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212
import FileSelect from './dialogItems/fileSelect.svelte'
1313
import FolderSelect from './dialogItems/folderSelect.svelte'
1414
import CodeInput from './dialogItems/codeInput.svelte'
15+
16+
import HeartIcon from '../assets/heart.png'
17+
import KoFiImage from '../assets/kofi_s_tag_white.webp'
18+
19+
import fontUrl from '../assets/MinecraftFull.ttf'
20+
if (![...document.fonts.keys()].some(v => v.family === 'MinecraftFull')) {
21+
void new FontFace('MinecraftFull', fontUrl, {}).load().then(font => {
22+
document.fonts.add(font)
23+
})
24+
}
25+
26+
localStorage.setItem('animated_java_settings_support_me_popup', 'true')
1527
</script>
1628

1729
<script lang="ts">
@@ -328,6 +340,13 @@
328340
return { type: 'success', message: '' }
329341
}
330342
}
343+
344+
let showSupportMePopup =
345+
localStorage.getItem('animated_java_settings_support_me_popup') === 'true'
346+
function clickSupportMeXButton() {
347+
localStorage.setItem('animated_java_settings_support_me_popup', 'false')
348+
showSupportMePopup = false
349+
}
331350
</script>
332351

333352
<div>
@@ -590,7 +609,127 @@
590609
{/if}
591610
</div>
592611

612+
{#if showSupportMePopup}
613+
<div class="ko-fi-popup-container">
614+
<div class="ko-fi-popup">
615+
<div class="title">
616+
<img class="heart" src={HeartIcon} alt="❤️" />
617+
<span>Animated Java?</span>
618+
<!-- svelte-ignore a11y-click-events-have-key-events -->
619+
<i class="material-icons icon" on:click={clickSupportMeXButton}>close</i>
620+
</div>
621+
<a href="https://ko-fi.com/snavesutit" class="ko-fi-button">
622+
<img src={KoFiImage} alt="" />
623+
</a>
624+
</div>
625+
<div class="shadow" />
626+
</div>
627+
{/if}
628+
593629
<style>
630+
i {
631+
cursor: pointer;
632+
transition:
633+
transform 0.2s ease 0s,
634+
color 0.2s ease 0s;
635+
text-shadow: 1.5px 1.5px 0px rgba(0, 0, 0, 0.25);
636+
}
637+
i:hover {
638+
transform: scale(1.25);
639+
color: var(--color-error);
640+
}
641+
642+
.ko-fi-popup-container {
643+
position: absolute;
644+
top: 30px;
645+
right: -23.8vw;
646+
font-family: 'MinecraftFull';
647+
font-size: 20px;
648+
display: flex;
649+
align-items: center;
650+
justify-content: center;
651+
flex-direction: column;
652+
color: white;
653+
overflow: hidden;
654+
}
655+
.ko-fi-popup {
656+
position: relative;
657+
display: flex;
658+
align-items: center;
659+
justify-content: center;
660+
flex-direction: column;
661+
padding: 8px;
662+
padding-right: 0px;
663+
664+
background-color: #00aced;
665+
border-radius: 0 8px 8px 0;
666+
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
667+
animation: slideIn 0.75s;
668+
}
669+
.heart {
670+
width: 28px;
671+
height: 28px;
672+
animation: beat 2s ease infinite;
673+
}
674+
@keyframes beat {
675+
0% {
676+
transform: scale(1);
677+
}
678+
10% {
679+
transform: scale(1.2);
680+
}
681+
20% {
682+
transform: scale(1);
683+
}
684+
}
685+
.ko-fi-popup span {
686+
text-shadow: 2.4px 2.4px 0px rgba(0, 0, 0, 0.25);
687+
}
688+
.ko-fi-button img {
689+
width: 100%;
690+
image-rendering: auto;
691+
border-radius: 12px;
692+
}
693+
.ko-fi-button {
694+
width: 18vw;
695+
margin-right: 1vw;
696+
margin-top: 1vw;
697+
transition: transform 0.2s ease;
698+
}
699+
.ko-fi-button:hover {
700+
transform: scale(1.05);
701+
transition: transform 0.2s ease;
702+
}
703+
.ko-fi-popup .title {
704+
display: flex;
705+
justify-content: center;
706+
gap: 0.75rem;
707+
}
708+
.shadow {
709+
position: absolute;
710+
top: 0;
711+
left: 0;
712+
height: 100%;
713+
background: linear-gradient(90deg, #00000066, #00000000);
714+
width: 0px;
715+
}
716+
@keyframes slideIn {
717+
0% {
718+
right: 23.8vw;
719+
}
720+
100% {
721+
right: 0px;
722+
}
723+
}
724+
@keyframes slideInPanel {
725+
0% {
726+
right: 0vw;
727+
}
728+
100% {
729+
right: -23.8vw;
730+
}
731+
}
732+
594733
:global(.dialog_wrapper .dialog_content) {
595734
overflow-y: auto !important;
596735
}

src/global.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ declare module '*.png' {
55
export = value
66
}
77

8+
declare module '*.ttf' {
9+
const value: string
10+
export = value
11+
}
12+
813
declare module '*.gif' {
914
const value: string
1015
export = value

0 commit comments

Comments
 (0)