Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
72f7d47
Revert "📤 Move important TODOs to pull request"
hejny Aug 14, 2023
2af299e
Restyled by whitespace
restyled-commits Aug 14, 2023
ba5722e
Merge pull request #41 from hejny/restyled/feature/recommendation-system
hejny Aug 14, 2023
89c2845
Merge branch 'main' into feature/recommendation-system
hejny Aug 14, 2023
ccc4dbd
Restyled by clang-format
restyled-commits Aug 14, 2023
e38dfeb
Restyled by prettier
restyled-commits Aug 14, 2023
68eeceb
Restyled by whitespace
restyled-commits Aug 14, 2023
b296519
Revert "📤 Move important TODOs to pull request"
hejny Aug 14, 2023
60651c3
Merge pull request #43 from hejny/restyled/feature/recommendation-system
hejny Aug 15, 2023
1e636a2
Restyled by clang-format
restyled-commits Aug 15, 2023
776decd
Restyled by prettier
restyled-commits Aug 15, 2023
0d6bb1a
Merge pull request #45 from hejny/restyled/feature/recommendation-system
hejny Aug 15, 2023
ff854c5
Restyled by clang-format
restyled-commits Aug 15, 2023
f0aab42
Restyled by prettier
restyled-commits Aug 15, 2023
def215f
Merge pull request #48 from hejny/restyled/feature/recommendation-system
hejny Aug 15, 2023
afb460f
Restyled by clang-format
restyled-commits Aug 15, 2023
68edb4b
Restyled by prettier
restyled-commits Aug 15, 2023
e80bd48
Merge pull request #49 from hejny/restyled/feature/recommendation-system
hejny Aug 15, 2023
4a525b4
Restyled by clang-format
restyled-commits Aug 15, 2023
e61ad92
Restyled by prettier
restyled-commits Aug 15, 2023
f539b91
Merge pull request #51 from hejny/restyled/feature/recommendation-system
hejny Aug 15, 2023
d4b3db7
Merge branch 'feature/recommendation-system' of https://github.com/he…
hejny Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 48 additions & 44 deletions public/handwritten/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ⚠ Warning: This is just a javascript copy of /src/components/HandwrittenText/utils/handwriteText.ts
// ⚠ Warning: This is just a javascript copy of
// /src/components/HandwrittenText/utils/handwriteText.ts

function handwriteText(options) {
function getElement(elementId) {
Expand Down Expand Up @@ -593,21 +594,20 @@ function handwriteText(options) {
var canvasElement = getElement('canvas');

/*
var styleSelectElement = getElement('select-style');
var biasSliderElement = getElement('bias-slider');
var speedSliderElement = getElement('speed-slider');
var widthSliderElement = getElement('width-slider');
var styleSelectElement = getElement('select-style');
var biasSliderElement = getElement('bias-slider');
var speedSliderElement = getElement('speed-slider');
var widthSliderElement = getElement('width-slider');

widthSliderElement.oninput = () =>
((r) => {
for (; canvasElement.lastChild; ) canvasElement.removeChild(canvasElement.lastChild);
if (K(r) != 0) {
const e = options.width; /*parseFloat(widthSliderElement.value)* /
const a = z(r);
for (let l = 0; l < K(a); l++) (r = a[l]), K(r) < 2 || q(r, t, e);
}
})(tr);
*/
widthSliderElement.oninput = () =>
((r) => {
for (; canvasElement.lastChild; )
canvasElement.removeChild(canvasElement.lastChild); if (K(r) != 0) { const e =
options.width; /*parseFloat(widthSliderElement.value)* / const a = z(r); for
(let l = 0; l < K(a); l++) (r = a[l]), K(r) < 2 || q(r, t, e);
}
})(tr);
*/

let ur;
let fr;
Expand All @@ -624,7 +624,8 @@ function handwriteText(options) {
}, 200);
})();

// --------------------------------------- Press [Write!] button ---------------------------------------
// --------------------------------------- Press [Write!] button
// ---------------------------------------

fetch(ur)
.then((res) => {
Expand Down Expand Up @@ -689,12 +690,13 @@ function handwriteText(options) {
handleWriteClick();

/*
getElement('draw-button').addEventListener('mousedown', handleWriteClick);
getElement('text-input').addEventListener('keydown', (event) => {
return event.keyCode === 13 ? handleWriteClick() : 1;
});
getElement('loading-indicator').remove();
*/
getElement('draw-button').addEventListener('mousedown',
handleWriteClick);
getElement('text-input').addEventListener('keydown', (event) => {
return event.keyCode === 13 ? handleWriteClick() : 1;
});
getElement('loading-indicator').remove();
*/
}
};
return init(), at;
Expand All @@ -703,27 +705,29 @@ function handwriteText(options) {
});

/*
// --------------------------------------- Saving ---------------------------------------
// --------------------------------------- Saving
---------------------------------------

getElement('save-button').addEventListener('click', () => {
const r = getElement('canvas').getBBox();
const width = [hr(r.x - 3), hr(r.y - 3), hr(r.width + 6), hr(r.height + 6)].join(' ');
const svgElement = getElement('canvas');
svgElement.setAttribute('viewBox', width);
const extremeSvg = new XMLSerializer().serializeToString(svgElement);
svgElement.removeAttribute('viewBox');
const popOutActionElement = window.document.createElement('a');
popOutActionElement.setAttribute('href', `data:image/svg+xml;base64,${window.btoa(extremeSvg)}`);
popOutActionElement.setAttribute(
'download',
`${Z.toString()
.toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^\w\-]+/g, '')
.replace(/\-\-+/g, '-')
.trim()}.svg`,
);
popOutActionElement.click();
});
*/
getElement('save-button').addEventListener('click', () => {
const r = getElement('canvas').getBBox();
const width = [hr(r.x - 3), hr(r.y - 3), hr(r.width + 6), hr(r.height +
6)].join(' '); const svgElement = getElement('canvas');
svgElement.setAttribute('viewBox', width);
const extremeSvg = new XMLSerializer().serializeToString(svgElement);
svgElement.removeAttribute('viewBox');
const popOutActionElement = window.document.createElement('a');
popOutActionElement.setAttribute('href',
`data:image/svg+xml;base64,${window.btoa(extremeSvg)}`);
popOutActionElement.setAttribute(
'download',
`${Z.toString()
.toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^\w\-]+/g, '')
.replace(/\-\-+/g, '-')
.trim()}.svg`,
);
popOutActionElement.click();
});
*/
}
5 changes: 3 additions & 2 deletions public/visual-testing/common.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// TODO: Do not show the Next.js errors in the iframes (they are not relevant in this case)
// TODO: Do not show the Next.js errors in the iframes (they are not relevant in
// this case)
window.document.querySelectorAll('iframe').forEach((iframeElement) => {
function hideNextjsErrors() {
const iframeDocument = iframeElement.contentDocument;
iframeDocument.body.innerHTML =
iframeDocument.body.innerHTML +
`
`
<style>
body{
overflow: auto !important;
Expand Down
4 changes: 2 additions & 2 deletions src/components/AiComponents/AiComponentsRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function AiComponentsRoot(props: AiComponentsRootProps) {
if (componentElement.getAttribute('data-ai-activated')) {
continue;
}

const componentType = componentElement.getAttribute('data-ai-component');


Expand All @@ -91,7 +91,7 @@ export function AiComponentsRoot(props: AiComponentsRootProps) {
case '${componentType}':
console.info(\`🌟 Activating \${componentType} component\`, componentElement);
(${
activate.toString() /* <- TODO: Is there some option to:
activate.toString() /* <- TODO: Is there some option to:
- Use non-minified code (disable/bypass minification in just one file/function)
- OR just Put a real name on the function
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ export class RandomWallpaperManager {
}

public async getRandomWallpaper(): Promise<IWallpaperInStorage> {
// TODO: !!!! Change to WallpaperTimelineManager.getNextWallpaper

const randomWallpaper = await this.prefetchingRandomWallpapers.shift(/* <- TODO: DO here a Promise.race */);

// console.log('currentWallpaperId', currentWallpaperId);
Expand Down
1 change: 1 addition & 0 deletions src/components/ControlPanel/RandomWallpaper/TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: !!!! Rename ACRY from random to recommended
2 changes: 1 addition & 1 deletion src/components/ExportPreviewModal/ExportPreviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function ExportPreviewModal(props: ExportPreviewModalProps) {
if(isLinked){
continue;
}

const href = linkElement.getAttribute('href');

if(href.startsWith('blob:')){
Expand Down
2 changes: 1 addition & 1 deletion src/components/Hint/Hint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function Hint(props: HintProps) {
};
hintTarget.addEventListener('click', hintTargetClickHandler);

/*
/*
element.addEventListener('mouseenter', () => {
hintContainer.style.opacity = '1';
});
Expand Down
3 changes: 2 additions & 1 deletion src/pages/api/recommend-wallpaper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ export default async function recommendWallpaperHandler(
.select(
`
createdAt,
Wallpaper( * )
Wallpaper( * )
`,
)
.eq('author', author)
.eq('likedStatus', likedStatus)
.order('createdAt', { ascending: false })
// <- TODO: !!!! [🤺][🧠] Take ONLY current reactions NOT overwritten ones
.limit(10 /* <- TODO: [🤺] Tweak this number */);

const likeness = likedStatusToLikeness(likedStatus);
Expand Down
1 change: 1 addition & 0 deletions src/recommendation/wallpaperToVector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export function wallpaperToVector(wallpaper: IWallpaper): IWallpaperVector {
}

/**
* TODO: [🧠] !!!! Implement propperly - take more dimensions than just the primary color of the wallpaper
* TODO: [🤺] Optimize
*/
Loading