Skip to content

Commit

Permalink
better image compression & spread out image change
Browse files Browse the repository at this point in the history
  • Loading branch information
yourWaifu committed Feb 16, 2021
1 parent dec835a commit 2040bb9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,27 @@ class Background extends React.Component {
handleLoaded() {
console.log(this.state.imageURL);
if (this.state.imageURL === "img/Untitled.jpg") {
this.setState((state: BackgroundState, props) => {
return new BackgroundState("img/UntitledHigh.jpg", state.blur);
});
} else if (this.state.imageURL === "img/UntitledHigh.jpg") {
this.setState((state, props) => {
window.setTimeout(() => {
this.setState((state: BackgroundState, props) => {
return new BackgroundState("img/360-degree_Panorama_of_the_Southern_Sky_edit.jpg", state.blur);
return new BackgroundState("img/UntitledHigh.webp", state.blur);
});
}, 1000);
} else if (this.state.imageURL === "img/UntitledHigh.webp") {
window.setTimeout(()=> {
this.setState((state, props) => {
window.setTimeout(()=> {
this.setState((state: BackgroundState, props) => {
return new BackgroundState("img/360-degree_Panorama_of_the_Southern_Sky_edit.webp", state.blur);
});
})
return new BackgroundState(this.state.imageURL, false);
});
return new BackgroundState(this.state.imageURL, false);
});
} else {
this.setState((state: BackgroundState, props) => {
return new BackgroundState("img/360-degree_Panorama_of_the_Southern_Sky_edit1high.jpg", state.blur);
window.setTimeout(()=> {
this.setState((state: BackgroundState, props) => {
return new BackgroundState("img/360-degree_Panorama_of_the_Southern_Sky_edit1high.webp", state.blur);
});
});
}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed static/img/UntitledHigh.jpg
Binary file not shown.
Binary file added static/img/UntitledHigh.webp
Binary file not shown.

0 comments on commit 2040bb9

Please sign in to comment.