Skip to content

Commit 6bd14ae

Browse files
committed
Merge branch 'next' into experimental
2 parents fe07e97 + d4911e2 commit 6bd14ae

File tree

6 files changed

+140
-14
lines changed

6 files changed

+140
-14
lines changed

src/assets/heart.png

616 Bytes
Loading

src/assets/kofi_s_tag_white.webp

2.61 KB
Loading

src/assets/logo_white_stroke.webp

10.7 KB
Loading

src/minecraft/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// @ts-ignore
2+
import fontUrl from '../assets/MinecraftFull.ttf'
3+
4+
if ([...document.fonts.keys()].filter(v => v.family === 'MinecraftFull').length === 0) {
5+
void new FontFace('MinecraftFull', fontUrl as Buffer, {}).load().then(font => {
6+
document.fonts.add(font)
7+
})
8+
}
9+
10+
export const PIXEL_FILTER =
11+
'url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxmaWx0ZXIgaWQ9ImZpbHRlciIgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj48ZmVDb21wb25lbnRUcmFuc2Zlcj48ZmVGdW5jUiB0eXBlPSJpZGVudGl0eSIvPjxmZUZ1bmNHIHR5cGU9ImlkZW50aXR5Ii8+PGZlRnVuY0IgdHlwZT0iaWRlbnRpdHkiLz48ZmVGdW5jQSB0eXBlPSJkaXNjcmV0ZSIgdGFibGVWYWx1ZXM9IjAgMSIvPjwvZmVDb21wb25lbnRUcmFuc2Zlcj48L2ZpbHRlcj48L3N2Zz4=#filter)'
12+
13+
export const FONT = '16px MinecraftFull'
14+
115
export * from './entities'
216
export * from './items'
317
export * from './util'

src/outliner/textDisplay.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
// @ts-ignore
2-
import fontUrl from '../assets/MinecraftFull.ttf'
31
import { createAction } from '../util/moddingTools'
42
import * as events from '../events'
53
import { ajModelFormat } from '../modelFormat'
64
import { JsonText } from '../minecraft'
75

8-
const PIXEL_FILTER =
9-
'url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxmaWx0ZXIgaWQ9ImZpbHRlciIgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj48ZmVDb21wb25lbnRUcmFuc2Zlcj48ZmVGdW5jUiB0eXBlPSJpZGVudGl0eSIvPjxmZUZ1bmNHIHR5cGU9ImlkZW50aXR5Ii8+PGZlRnVuY0IgdHlwZT0iaWRlbnRpdHkiLz48ZmVGdW5jQSB0eXBlPSJkaXNjcmV0ZSIgdGFibGVWYWx1ZXM9IjAgMSIvPjwvZmVDb21wb25lbnRUcmFuc2Zlcj48L2ZpbHRlcj48L3N2Zz4=#filter)'
10-
11-
const FONT = '16px MinecraftFull'
12-
136
const DEFAULT_TEXT = 'The quick brown fox jumps over the lazy dog.'
147
const SIZE_DIVISOR = 4.75
158

16-
if ([...document.fonts.keys()].filter(v => v.family === 'MinecraftFull').length === 0) {
17-
void new FontFace('MinecraftFull', fontUrl as Buffer, {}).load().then(font => {
18-
document.fonts.add(font)
19-
})
20-
}
21-
229
events.LOAD.subscribe(() => {
2310
console.log('Animated Java loaded!')
2411
class TextDisplayElement extends OutlinerElement {

src/ui/components/projectSettings.svelte

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1+
<script lang="ts" context="module">
2+
localStorage.setItem('animated_java_settings_support_me_popup', 'true')
3+
</script>
4+
15
<script lang="ts">
2-
import { onDestroy } from 'svelte'
6+
import { onDestroy, onMount } from 'svelte'
37
import { fly } from '../util/accessability'
48
import { AnimatedJavaExporter } from '../../exporter'
59
import { projectSettingStructure } from '../../projectSettings'
610
import * as AJ from '../../settings'
711
import { translate } from '../../util/translation'
812
import FancyHeader from './fancyHeader.svelte'
913
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'
1020
1121
let settingArray = Object.values(Project!.animated_java_settings!) as AJ.Setting<any>[]
1222
console.log('Project Settings', settings, projectSettingStructure)
@@ -35,8 +45,56 @@
3545
function getSettingArray(exporter: AnimatedJavaExporter): any {
3646
return Project!.animated_java_exporter_settings![exporter.id]
3747
}
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+
}
3865
</script>
3966

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+
4098
<div class="dialog-content">
4199
{#each projectSettingStructure as el}
42100
<AJUINode {el} {settingArray} />
@@ -59,6 +117,73 @@
59117
</div>
60118

61119
<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+
62187
div.dialog-content {
63188
overflow-y: scroll;
64189
max-height: 700px;

0 commit comments

Comments
 (0)