diff options
| author | s1n <[email protected]> | 2019-07-30 08:54:01 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-07-30 08:54:01 -0700 |
| commit | a1531490c041b4af0ba434cfa4017d7cf0de789e (patch) | |
| tree | 0ac6764cf9d5a4058cab3ca97327f7a333bbb7f2 /js | |
| parent | add favicon.png (diff) | |
| download | s1n.pw-admin-a1531490c041b4af0ba434cfa4017d7cf0de789e.tar.xz s1n.pw-admin-a1531490c041b4af0ba434cfa4017d7cf0de789e.zip | |
Add random seed generator, random colour generator
Diffstat (limited to 'js')
| -rw-r--r-- | js/app.js | 68 |
1 files changed, 34 insertions, 34 deletions
@@ -1,5 +1,5 @@ // LOADER ANIM
-$(window).on("load",function(){
+$(window).on("load", function () {
$(".loader-wrapper").fadeOut("slow");
})
@@ -11,10 +11,11 @@ var pattern = Trianglify({ height: window.innerHeight, // White: #fdfbfb, Salmon: #cc3300
width: window.innerWidth,
x_colors: ['#040404', '#f9f9f9', '#fffff4', '#fbf7f5', '#d55454'], // Cappuccino: ['#854442', '#3c2f2f', '#fff4e6', '#be9b7b', '#4b3832']
- y_colors: ['#f9f1f1', '#f9f9f9', '#fffff4', '#fbf7f5', '#f9f1f1'],
+ y_colors: ['#f9f1f1', '#f9f9f9', '#fffff4', '#fbf7f5', '#f9f1f1'], // Random colour generator: "#"+((1<<24)*Math.random()|0).toString(16)
variance: 10,
- seed: '666',
- cell_size: 160});
+ seed: Number.parseInt(Math.floor(Math.random() * 100)), // Random seed generator: Number.parseInt(Math.floor(Math.random() * 100))
+ cell_size: 160
+});
// // canvas
// document.body.appendChild(pattern.canvas())
@@ -35,56 +36,55 @@ $('.title-wrapper').css('width', window.innerWidth); $('.title-wrapper').css('height', window.innerHeight);
-var time = 10,
- $paths = $('body').find('svg').find('path'),
+var time = 10,
+ $paths = $('body').find('svg').find('path'),
pathCollection = $paths.get(),
- count = $paths.length;
+ count = $paths.length;
console.log(count);
-pathCollection.sort(function() {
- return Math.random()*10 > 5 ? 1 : -1;
+pathCollection.sort(function () {
+ return Math.random() * 10 > 5 ? 1 : -1;
});
-function showText(){
-var title = $('h1'),
- subtitle = $('h2');
+function showText() {
+ var title = $('h1'),
+ subtitle = $('h2');
-title.removeClass('hidden');
-setTimeout( function(){
- subtitle.removeClass('hidden');
-}, 500);
+ title.removeClass('hidden');
+ setTimeout(function () {
+ subtitle.removeClass('hidden');
+ }, 500);
}
-setTimeout( function(){
-$.each(pathCollection,function(i,el) {
- var $path = $(this);
- setTimeout( function(){
+setTimeout(function () {
+ $.each(pathCollection, function (i, el) {
+ var $path = $(this);
+ setTimeout(function () {
- $path.css('opacity','1');
- }, time)
- time += 10;
+ $path.css('opacity', '1');
+ }, time)
+ time += 10;
- if (i+1 === count) {
- setTimeout( function(){
- showText();
- }, 2000);
-}
+ if (i + 1 === count) {
+ setTimeout(function () {
+ showText();
+ }, 2000);
+ }
-});
+ });
}, 2000);
// LOADER ANIMATION END FOR WINDOW LOAD
-$(window).on("load",function(){
+$(window).on("load", function () {
$(".loader-wrapper").fadeOut("slow");
})
// HONESTLY I HAVE NO IDEA WHAT THIS IS BUT IT WAS IN THE ORIGINAL SRC
(async () => {
- if( navigator.webdriver || document.visibilityState === 'prerender' || !location.hostname )
- {
+ if (navigator.webdriver || document.visibilityState === 'prerender' || !location.hostname) {
return;
}
- document.querySelector( 'a[href="/cdn-cgi/l/email-protection"]' ).href = `\x6dailto:hi\x40${location.hostname}`;
-})();
\ No newline at end of file + document.querySelector('a[href="/cdn-cgi/l/email-protection"]').href = `\x6dailto:hi\x40${location.hostname}`;
+})();
|