Skip to content

Commit

Permalink
Merge pull request #1 from psemsari/codespace-psemsari-stunning-space…
Browse files Browse the repository at this point in the history
…-pancake-957gpg5vr9cgw6

fix: better visibility of text and better structure
  • Loading branch information
psemsari committed May 1, 2023
2 parents b5ed975 + 57c5f85 commit 0407c9d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 32 deletions.
13 changes: 10 additions & 3 deletions src/Anim.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ function Anim() {
renderOnAddRemove: false,
selection: false
});
canvas.setHeight(document.body.clientHeight);
canvas.setWidth(document.body.clientWidth);
const appheader = document.getElementsByClassName('App-header')[0]
canvas.setHeight(appheader.offsetHeight);
canvas.setWidth(appheader.offsetWidth);
fabric.Object.prototype.transparentCorners = false;
fabric.Object.prototype.objectCaching = true;

Expand All @@ -32,7 +33,7 @@ function Anim() {
fabric.loadSVGFromURL('https://api.iconify.design/fluent-emoji/party-popper.svg', function(objects, options) {
var obj = fabric.util.groupSVGElements(objects, options);

for (let i = 0; i < 300; i++)
for (let i = 0; i < 100; i++)
{
obj.clone((clone) => {
clone.scale = Math.ceil(Math.random() * 3) + 5
Expand All @@ -49,6 +50,12 @@ function Anim() {
update()
});

window.onresize = () => {
const appheader = document.getElementsByClassName('App-header')[0]
canvas.setHeight(appheader.offsetHeight);
canvas.setWidth(appheader.offsetWidth);
}

}

export default Anim;
30 changes: 15 additions & 15 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
.App {
text-align: center;
overflow: hidden;
}

.App-header {
background-color: #9c0000;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
z-index: -1;
width: 100vw;
height: 100vh;
}

.isFerie {
background-color: #009c1f !important;
}

#c {
}

#block {
position: absolute;
top: 0;
left: 0;
z-index: 0;
width: 100vw;
height: 100vh;
width: 100%;
height: 100%;
background: linear-gradient(180deg, rgba(255,255,255,0) 30%, rgba(0,0,0,0.7185574058725053) 100%);
display: flex;
align-items: center;
justify-content: center;
}

#text {
z-index: 1;
color: white;
text-align: center;
/* background: linear-gradient(to bottom, transparent 0%, black 100%); */
}
31 changes: 17 additions & 14 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ function compare(dates, actual) {
{
const date = new Date(day)
if (date === actual)
return {day: dates[day]}
return {day: dates[day]}
return {day: dates[day]}
}
return {day: null}
}
Expand All @@ -34,7 +33,23 @@ const Header = ({day}) => {
if (day.day)
return (
<header className="App-header isFerie">
<div id="block">
<div id="text">
<h2>
Est ce un jour férié ?
</h2>
<h1>
<IsFerie day={day}></IsFerie>
</h1>
</div>
</div>
<Canva></Canva>
</header>
)

return (
<header className="App-header">
<div id="block">
<div id="text">
<h2>
Est ce un jour férié ?
Expand All @@ -43,18 +58,6 @@ const Header = ({day}) => {
<IsFerie day={day}></IsFerie>
</h1>
</div>
</header>
)

return (
<header className="App-header">
<div id="text">
<h2>
Est ce un jour férié ?
</h2>
<h1>
<IsFerie day={day}></IsFerie>
</h1>
</div>
</header>
)
Expand Down

0 comments on commit 0407c9d

Please sign in to comment.