|
| 1 | +<script lang="ts" context="module"> |
| 2 | + localStorage.setItem('animated_java_settings_support_me_popup', 'true') |
| 3 | +</script> |
| 4 | + |
1 | 5 | <script lang="ts"> |
2 | | - import { onDestroy } from 'svelte' |
| 6 | + import { onDestroy, onMount } from 'svelte' |
3 | 7 | import { fly } from '../util/accessability' |
4 | 8 | import { AnimatedJavaExporter } from '../../exporter' |
5 | 9 | import { projectSettingStructure } from '../../projectSettings' |
6 | 10 | import * as AJ from '../../settings' |
7 | 11 | import { translate } from '../../util/translation' |
8 | 12 | import FancyHeader from './fancyHeader.svelte' |
9 | 13 | import AJUINode from './settingNode.svelte' |
| 14 | + // @ts-ignore |
| 15 | + import kofiButton from '../../assets/kofi_s_tag_white.webp' |
| 16 | + // @ts-ignore |
| 17 | + import heart from '../../assets/heart.png' |
| 18 | + import { text } from 'stream/consumers' |
| 19 | + // import { PIXEL_FILTER } from '../../minecraft' |
10 | 20 |
|
11 | 21 | let settingArray = Object.values(Project!.animated_java_settings!) as AJ.Setting<any>[] |
12 | 22 | console.log('Project Settings', settings, projectSettingStructure) |
|
35 | 45 | function getSettingArray(exporter: AnimatedJavaExporter): any { |
36 | 46 | return Project!.animated_java_exporter_settings![exporter.id] |
37 | 47 | } |
| 48 | +
|
| 49 | + let xButtonHovered = false |
| 50 | + let showSupportMePopup = false |
| 51 | +
|
| 52 | + function clickSupportMeXButton() { |
| 53 | + localStorage.setItem('animated_java_settings_support_me_popup', 'false') |
| 54 | + showSupportMePopup = false |
| 55 | + } |
| 56 | +
|
| 57 | + requestAnimationFrame(() => { |
| 58 | + showSupportMePopup = |
| 59 | + localStorage.getItem('animated_java_settings_support_me_popup') !== 'false' |
| 60 | + }) |
| 61 | +
|
| 62 | + function clickSupportMebutton() { |
| 63 | + Blockbench.openLink('https://ko-fi.com/snavesutit') |
| 64 | + } |
38 | 65 | </script> |
39 | 66 |
|
| 67 | +{#if showSupportMePopup} |
| 68 | + <div class="support-me-popup" transition:$fly|local={{ duration: 500, opacity: 0, y: 25 }}> |
| 69 | + <div class="support-me-popup-sub-container"> |
| 70 | + <div |
| 71 | + style="display:flex; flex-direction: row; align-items: center; padding-top: 8px; margin-left: 16px; margin-right: 16px;" |
| 72 | + > |
| 73 | + <img src={heart} alt="heart" class="heart" /> |
| 74 | + <p>Animated Java?</p> |
| 75 | + </div> |
| 76 | + <div class="support-me-button-container"> |
| 77 | + <!-- svelte-ignore a11y-click-events-have-key-events --> |
| 78 | + <img |
| 79 | + class="support-me-button" |
| 80 | + src={kofiButton} |
| 81 | + alt="Ko-fi Button" |
| 82 | + on:click={clickSupportMebutton} |
| 83 | + /> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + <!-- svelte-ignore a11y-click-events-have-key-events --> |
| 87 | + <span |
| 88 | + class="material-icons x-button" |
| 89 | + on:mouseenter={() => (xButtonHovered = true)} |
| 90 | + on:mouseleave={() => (xButtonHovered = false)} |
| 91 | + on:click={clickSupportMeXButton} |
| 92 | + > |
| 93 | + {xButtonHovered ? 'mood_bad' : 'close'} |
| 94 | + </span> |
| 95 | + </div> |
| 96 | +{/if} |
| 97 | + |
40 | 98 | <div class="dialog-content"> |
41 | 99 | {#each projectSettingStructure as el} |
42 | 100 | <AJUINode {el} {settingArray} /> |
|
59 | 117 | </div> |
60 | 118 |
|
61 | 119 | <style> |
| 120 | + /* .material-symbols-outlined { |
| 121 | + font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48; |
| 122 | + } */ |
| 123 | + .support-me-popup { |
| 124 | + position: absolute; |
| 125 | + white-space: nowrap; |
| 126 | + left: 100%; |
| 127 | + top: 30px; |
| 128 | + background: #00aced; |
| 129 | + border-radius: 0px 8px 8px 0px; |
| 130 | + display: flex; |
| 131 | + } |
| 132 | +
|
| 133 | + .support-me-popup-sub-container { |
| 134 | + display: flex; |
| 135 | + flex-direction: column; |
| 136 | + align-items: center; |
| 137 | + } |
| 138 | +
|
| 139 | + .support-me-popup-sub-container > * > p { |
| 140 | + font-family: 'MinecraftFull'; |
| 141 | + font-size: 16px; |
| 142 | + color: white; |
| 143 | + /* filter: var(--filter); */ |
| 144 | + padding-left: 8px; |
| 145 | + margin: 0px; |
| 146 | + } |
| 147 | +
|
| 148 | + .heart { |
| 149 | + display: flex; |
| 150 | + align-items: center; |
| 151 | + /* color: #f15e5f; */ |
| 152 | + width: 21px; |
| 153 | + height: 21px; |
| 154 | + transition: transform 0.1s ease-in-out; |
| 155 | + } |
| 156 | +
|
| 157 | + .heart:hover { |
| 158 | + transform: scale(1.25); |
| 159 | + } |
| 160 | +
|
| 161 | + .x-button { |
| 162 | + margin-right: 4px; |
| 163 | + margin-top: 2px; |
| 164 | + color: black; |
| 165 | + height: fit-content; |
| 166 | + font-size: 24px; |
| 167 | + } |
| 168 | +
|
| 169 | + .support-me-button-container { |
| 170 | + display: flex; |
| 171 | + flex-direction: row; |
| 172 | + align-items: center; |
| 173 | + padding: 10px; |
| 174 | + } |
| 175 | +
|
| 176 | + .support-me-button { |
| 177 | + width: 100%; |
| 178 | + image-rendering: auto; |
| 179 | + transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out; |
| 180 | + border-radius: 8px; |
| 181 | + } |
| 182 | + .support-me-button:hover { |
| 183 | + transform: scale(1.05); |
| 184 | + box-shadow: 0px 0px 10px 0px white; |
| 185 | + } |
| 186 | +
|
62 | 187 | div.dialog-content { |
63 | 188 | overflow-y: scroll; |
64 | 189 | max-height: 700px; |
|
0 commit comments