Skip to content

Commit 1aabeaa

Browse files
dynamic building done
1 parent b76e9ed commit 1aabeaa

File tree

8 files changed

+19
-72
lines changed

8 files changed

+19
-72
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dist/
55
*-safe.*
66
temp/
77
local/
8+
src/index.html
9+
src/pic.jpeg

build.js

-65
This file was deleted.

local/sample-scroll.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
22

3-
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
3+
4+
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"scripts": {
1212
"watch:parcel": "parcel src/index.html",
1313
"build:parcel": "parcel build src/index.html",
14-
"gen-index": "node build.js",
15-
"watch": "npm-run-all gen-index watch:parcel",
16-
"build": "npm-run-all gen-index build:parcel"
14+
"init-index-local": "node builder/init.js --local",
15+
"init-index-remote": "node builder/init.js --remote",
16+
"watch": "npm-run-all init-index-local watch:parcel",
17+
"build": "npm-run-all init-index-remote build:parcel"
1718
},
1819
"repository": {
1920
"type": "git",

src/BdayPic.jpeg

-30.4 KB
Binary file not shown.

src/js/animation.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ export const animate = function () {
140140
return;
141141
}
142142

143+
//This value is stored in the --readTime css variable of root element and is calculated dynamically at build time.
144+
const readTime =
145+
parseInt(
146+
getComputedStyle(document.documentElement).getPropertyValue(
147+
"--readTime"
148+
)
149+
) + 5;
150+
143151
frames[1].style.display = "flex";
144152

145153
setTimeout(() => {
@@ -156,14 +164,14 @@ export const animate = function () {
156164
setTimeout(() => {
157165
msgWindow.classList.add("fade-in");
158166
msgWindow.style.opacity = "0";
159-
}, 88000);
167+
}, readTime * 1000);
160168

161169
setTimeout(() => {
162170
frames[1].style.display = "none";
163171
frames[0].style.display = "flex";
164172
frames[0].classList.add("appear");
165173
frames[0].style.opacity = "1";
166-
}, 91000);
174+
}, (readTime + 3) * 1000);
167175
}
168176
});
169177
};

src/scss/_components.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
border-style: dotted;
9898
border-radius: 50%;
9999

100-
background-image: url(../BdayPic.jpeg);
100+
background-image: url(../pic.jpeg);
101101
background-position: top;
102102
background-repeat: no-repeat;
103103
background-size: cover;

template.html src/template.html

File renamed without changes.

0 commit comments

Comments
 (0)