From 0cd1d502c7ed407f55579ebff05cb1673eab23c7 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Sat, 31 Dec 2022 16:04:35 -0800 Subject: [PATCH] Initial commit --- DSEG14ClassicMini-Regular.woff | Bin 0 -> 7924 bytes LICENSE.txt | 118 +++++++++++++++++++++++++++++++++ fireworks.js | 6 ++ index.html | 20 ++++++ main.js | 69 +++++++++++++++++++ style.css | 68 +++++++++++++++++++ 6 files changed, 281 insertions(+) create mode 100644 DSEG14ClassicMini-Regular.woff create mode 100644 LICENSE.txt create mode 100644 fireworks.js create mode 100644 index.html create mode 100644 main.js create mode 100644 style.css diff --git a/DSEG14ClassicMini-Regular.woff b/DSEG14ClassicMini-Regular.woff new file mode 100644 index 0000000000000000000000000000000000000000..3444c9d394e87c01ee339489da97133d3450c678 GIT binary patch literal 7924 zcmZ8`WmFtI*X^K%;?7W@xD|JYLUDJ7;tcNY?(XjH?!~3JyA~}j#hv+h-uv%nt(}v- zbF!2C%Q|sY5EoZaRaF20h;IQ%fRCnn`_VD}H~RmZsJJ)@0DzMO03b{O0QhQ?#s|dW z;;M2VYrQ^l3IBs%+2xkR4>9o%4gA6J|EJ>suoYC8SOEa2|1_x&=xeE(av510*Z~08 zRUdrzV=ll@DWT2G*x(}v3gJUz{{Sbl8MxW(L;TSAKRC$;DB$N|(9Eoz+&=b5`{1At z-0Js`RaqOjefU9Xe{lH!L01uAV_RJ5I~qtnMd{62E9K0pEq z0kFDd8R>%o0du06HvAie)3!Is{+Um3lKTNev+g9%OGVT~5HuEM=4`k~M`mXKA5bfa zXhr{9qp$DN*V~K!+v*==1|lkJ3iKnR5rzkZU%?##0Ez&BE&%Xfo`JeyR&VcEZ{Nc2 zrci(X{7)img8Iy0u%W)bp}w(+9~3MS0`#1=3O*_`4YL*42Wns3Un)<$t{+c02O6Cf z8o(KkEb?(!x2)ekyU_0IJ6dbR^E-*LL1_7h`IQ$e6NIK};#^Oc=A8Yc~7<8H4f zB@{{8ySqf&1uSF8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HHJw@qRv#5rqqRL_wuJVuz8UIM3^TKA5f(1|^7ry!=>Plw1p5Jq;W6NGNhV Cm1VU6 literal 0 HcmV?d00001 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..18754e1 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,118 @@ +Code +==== + +Code for fireworks animation copyright (c) 2022 Vitalij Ryndin +Other code copyright (c) 2022 Samuel Sloniker + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Font +==== + +The font is DSEG14 Classic Mini Regular. + +Copyright (c) 2017, keshikan (http://www.keshikan.net), with Reserved Font Name +"DSEG". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide development +of collaborative font projects, to support the font creation efforts of +academic and linguistic communities, and to provide a free and open framework +in which fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The fonts, +including any derivative works, can be bundled, embedded, redistributed and/or +sold with any software provided that any reserved names are not used by +derivative works. The fonts and derivatives, however, cannot be released under +any other type of license. The requirement for fonts to remain under this +license does not apply to any document created using the fonts or their +derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright Holder(s) +under this license and clearly marked as such. This may include source files, +build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the copyright +statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, or +substituting -- in part or in whole -- any of the components of the Original +Version, by changing formats or by porting the Font Software to a new +environment. + +"Author" refers to any designer, engineer, programmer, technical writer or +other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining a copy of +the Font Software, to use, study, copy, merge, embed, modify, redistribute, and +sell modified and unmodified copies of the Font Software, subject to the +following conditions: + +1) Neither the Font Software nor any of its individual components, in Original +or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy contains +the above copyright notice and this license. These can be included either as +stand-alone text files, human-readable headers or in the appropriate +machine-readable metadata fields within text or binary files as long as those +fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font Name(s) +unless explicit written permission is granted by the corresponding Copyright +Holder. This restriction only applies to the primary font name as presented to +the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software +shall not be used to promote, endorse or advertise any Modified Version, except +to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) +or with their explicit written permission. + +5) The Font Software, modified or unmodified, in part or in whole, must be +distributed entirely under this license, and must not be distributed under any +other license. The requirement for fonts to remain under this license does not +apply to any document created using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fireworks.js b/fireworks.js new file mode 100644 index 0000000..08bbe58 --- /dev/null +++ b/fireworks.js @@ -0,0 +1,6 @@ +/*! + * fireworks-js 1.4.1 by Vitalij Ryndin (https://crashmax.ru) + * https://fireworks.js.org + * License MIT + */ +!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{var s=i();for(var e in s)("object"==typeof exports?exports:t)[e]=s[e]}}(this,(function(){return(()=>{"use strict";var t={511:(t,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Explosion=void 0;var e=s(909);i.Explosion=class{constructor(t){var{x:i,y:s,ctx:n,hue:h,gravity:o,friction:a,brightness:r,flickering:c,lineWidth:_,explosionLength:d}=t;for(this._coordinates=[],this._alpha=1,this._x=i,this._y=s,this._ctx=n,this._gravity=o,this._friction=a,this._flickering=c,this._lineWidth=_,this._explosionLength=d;this._explosionLength--;)this._coordinates.push([i,s]);this._angle=(0,e.randomFloat)(0,2*Math.PI),this._speed=(0,e.randomInt)(1,10),this._hue=(0,e.randomInt)(h-20,h+20),this._brightness=(0,e.randomInt)(r.min,r.max),this._decay=(0,e.randomFloat)(r.decay.min,r.decay.max)}update(t){this._coordinates.pop(),this._coordinates.unshift([this._x,this._y]),this._speed*=this._friction,this._x+=Math.cos(this._angle)*this._speed,this._y+=Math.sin(this._angle)*this._speed+this._gravity,this._alpha-=this._decay,this._alpha<=this._decay&&t()}draw(){var t=this._coordinates.length-1;this._ctx.beginPath(),this._ctx.lineWidth=this._lineWidth,this._ctx.fillStyle=(0,e.hsla)(this._hue,this._brightness,this._alpha),this._ctx.moveTo(this._coordinates[t][0],this._coordinates[t][1]),this._ctx.lineTo(this._x,this._y),this._ctx.strokeStyle=(0,e.hsla)(this._hue,this._flickering?(0,e.randomFloat)(0,this._brightness):this._brightness,this._alpha),this._ctx.stroke()}}},909:(t,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.hsla=i.getDistance=i.randomInt=i.randomFloat=void 0,i.randomFloat=function(t,i){return Math.random()*(i-t)+t},i.randomInt=function(t,i){return Math.floor(t+Math.random()*(i+1-t))},i.getDistance=function(t,i,s,e){var n=Math.pow;return Math.sqrt(n(t-s,2)+n(i-e,2))},i.hsla=function(t,i){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return"hsla(".concat(t,", 100%, ").concat(i,"%, ").concat(s,")")}},449:function(t,i,s){var e=this&&this.__awaiter||function(t,i,s,e){return new(s||(s=Promise))((function(n,h){function o(t){try{r(e.next(t))}catch(t){h(t)}}function a(t){try{r(e.throw(t))}catch(t){h(t)}}function r(t){var i;t.done?n(t.value):(i=t.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}r((e=e.apply(t,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:!0}),i.Sound=void 0;var n=s(909);i.Sound=class{constructor(t){this._buffer=[],this.onInit=!0,this.options=Object.assign({enabled:!1,files:["explosion0.mp3","explosion1.mp3","explosion2.mp3"],volume:{min:4,max:8}},t),this.init()}init(){this.onInit&&this.options.enabled&&(this.onInit=!1,this._audioContext=new(window.AudioContext||window.webkitAudioContext),this.load())}load(){return e(this,void 0,void 0,(function*(){for(var t of this.options.files){var i=yield(yield fetch(t)).arrayBuffer();this._audioContext.decodeAudioData(i).then((t=>{this._buffer.push(t)})).catch((t=>{throw t}))}}))}play(){if(this.options.enabled&&this._buffer.length){var t=this._audioContext.createBufferSource(),i=this._buffer[(0,n.randomInt)(0,this._buffer.length-1)],s=this._audioContext.createGain();t.buffer=i,s.gain.value=(0,n.randomFloat)(this.options.volume.min/100,this.options.volume.max/100),s.connect(this._audioContext.destination),t.connect(s),t.start(0)}else this.init()}}},668:(t,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Trace=void 0;var e=s(909);i.Trace=class{constructor(t){var{x:i,y:s,dx:n,dy:h,ctx:o,hue:a,speed:r,traceLength:c,acceleration:_}=t;for(this._coordinates=[],this._currentDistance=0,this._x=i,this._y=s,this._sx=i,this._sy=s,this._dx=n,this._dy=h,this._ctx=o,this._hue=a,this._speed=r,this._traceLength=c,this._acceleration=_,this._totalDistance=(0,e.getDistance)(i,s,n,h);this._traceLength--;)this._coordinates.push([i,s]);this._angle=Math.atan2(h-s,n-i),this._brightness=(0,e.randomInt)(50,70)}update(t){this._coordinates.pop(),this._coordinates.unshift([this._x,this._y]),this._speed*=this._acceleration;var i=Math.cos(this._angle)*this._speed,s=Math.sin(this._angle)*this._speed;this._currentDistance=(0,e.getDistance)(this._sx,this._sy,this._x+i,this._y+s),this._currentDistance>=this._totalDistance?t(this._dx,this._dy,this._hue):(this._x+=i,this._y+=s)}draw(){var t=this._coordinates.length-1;this._ctx.beginPath(),this._ctx.moveTo(this._coordinates[t][0],this._coordinates[t][1]),this._ctx.lineTo(this._x,this._y),this._ctx.strokeStyle=(0,e.hsla)(this._hue,this._brightness),this._ctx.stroke()}}}},i={};function s(e){var n=i[e];if(void 0!==n)return n.exports;var h=i[e]={exports:{}};return t[e].call(h.exports,h,h.exports,s),h.exports}var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.Fireworks=void 0;var i=s(668),n=s(449),h=s(511),o=s(909);t.Fireworks=class{constructor(t){var{autoresize:i=!0,boundaries:s,brightness:e,delay:h,hue:o,mouse:a,sound:r,rocketsPoint:c,lineWidth:_,lineStyle:d="round",flickering:l=50,trace:u=3,traceSpeed:m=10,intensity:p=30,explosion:x=5,gravity:v=1.5,opacity:g=.5,particles:f=50,friction:y=.95,acceleration:b=1.05}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._tick=0,this._timestamp=performance.now(),this._version="1.4.1",this._running=!1,this._m=!1,t instanceof HTMLCanvasElement?(this._container=t,this._canvas=t):(this._container=t,this._canvas=document.createElement("canvas"),this._container.appendChild(this._canvas)),this._ctx=this._canvas.getContext("2d"),this._sound=new n.Sound(r),this.setSize(),this.setBoundaries(Object.assign({visible:!1,x:50,y:50},s)),this.autoresize=i,this.trace=u,this.explosion=x,this.gravity=v,this.opacity=g,this.particles=f,this.friction=y,this.acceleration=b,this.flickering=l,this.intensity=p,this.traceSpeed=m,this.lineStyle=d,this.hue=Object.assign({min:0,max:360},o),this.rocketsPoint=Object.assign({min:50,max:50},c),this.lineWidth=Object.assign({explosion:{min:1,max:3},trace:{min:1,max:2}},_),this.mouse=Object.assign({click:!1,move:!1,max:1},a),this.delay=Object.assign({min:15,max:30},h),this.brightness=Object.assign({min:50,max:80,decay:{min:.015,max:.03}},e),this.autoresize&&window.addEventListener("resize",(()=>this.windowResize())),this._canvas.addEventListener("mousedown",(t=>{this.mouseDown(t)})),this._canvas.addEventListener("mouseup",(t=>{this.mouseUp(t)})),this._canvas.addEventListener("mousemove",(t=>{this.mouseMove(t)}))}get isRunning(){return this._running}get version(){return this._version}start(){this._running||(this._running=!0,this.clear(),this.render())}stop(){this._running&&(this._running=!1,this.clear())}unmount(){window.removeEventListener("resize",this.windowResize),this._canvas.removeEventListener("mousedown",this.mouseDown),this._canvas.removeEventListener("mouseup",this.mouseUp),this._canvas.removeEventListener("mousemove",this.mouseMove)}pause(){this._running=!this._running,this._running&&this.render()}clear(){this._ctx&&(this._traces=[],this._explosions=[],this._ctx.clearRect(0,0,this._width,this._height))}setOptions(t){for(var[i,s]of Object.entries(t)){var e=Object.prototype.hasOwnProperty.call(this,i);if("function"==typeof this[i])throw new Error("You cannot change the methods of the class!");e&&("object"==typeof this[i]?Object.assign(this[i],s):this[i]=s),"sound"===i&&Object.assign(this._sound.options,s)}}setSize(){var{width:t=(this._container instanceof HTMLCanvasElement?this._canvas.width:this._container.clientWidth),height:i=(this._container instanceof HTMLCanvasElement?this._canvas.height:this._container.clientHeight)}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._width=t,this._height=i,this._canvas.width=t,this._canvas.height=i,this.setBoundaries({width:t,height:i})}setBoundaries(t){this.boundaries=Object.assign(Object.assign({},this.boundaries),t)}useMouse(t,i){(this.mouse.click||this.mouse.move)&&(this._mx=t.pageX-this._canvas.offsetLeft,this._my=t.pageY-this._canvas.offsetTop,this._m=i)}windowResize(){this.setSize()}mouseDown(t){this.useMouse(t,this.mouse.click)}mouseUp(t){this.useMouse(t,!1)}mouseMove(t){this.useMouse(t,this._m)}render(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._timestamp;if(this._ctx&&this._running){requestAnimationFrame((t=>this.render(t))),this._ctx.globalCompositeOperation="destination-out",this._ctx.fillStyle="rgba(0, 0, 0, ".concat(this.opacity,")"),this._ctx.fillRect(0,0,this._width,this._height),this._ctx.globalCompositeOperation="lighter",this._ctx.lineCap=this.lineStyle,this._ctx.lineJoin="round",this.drawBoundaries(),this.initTrace(),this.drawTrace(),this.drawExplosion();var i=t-this._timestamp;this._timestamp=t,this._tick+=i*(this.intensity*Math.PI)/1e3}}drawBoundaries(){this.boundaries.visible&&(this._ctx.beginPath(),this._ctx.lineWidth=1,this._ctx.strokeStyle="red",this._ctx.rect(this.boundaries.x,this.boundaries.y,this.boundaries.width-2*this.boundaries.x,.5*this.boundaries.height),this._ctx.stroke())}initTrace(){this._ds=(0,o.randomInt)(this.delay.min,this.delay.max),(this._tick>this._ds||this._m&&this.mouse.max>this._traces.length)&&(this._traces.push(new i.Trace({x:this._width*(0,o.randomInt)(this.rocketsPoint.min,this.rocketsPoint.max)/100,y:this._height,dx:this._mx&&this.mouse.move||this._m?this._mx:(0,o.randomInt)(this.boundaries.x,this.boundaries.width-2*this.boundaries.x),dy:this._my&&this.mouse.move||this._m?this._my:(0,o.randomInt)(this.boundaries.y,.5*this.boundaries.height),ctx:this._ctx,hue:(0,o.randomInt)(this.hue.min,this.hue.max),speed:this.traceSpeed,acceleration:this.acceleration,traceLength:this.trace})),this._tick=0)}drawTrace(){var t=this._traces.length;for(this._ctx.lineWidth=(0,o.randomFloat)(this.lineWidth.trace.min,this.lineWidth.trace.max);t--;)this._traces[t].draw(),this._traces[t].update(((i,s,e)=>{this.initExplosion(i,s,e),this._sound.play(),this._traces.splice(t,1)}))}initExplosion(t,i,s){for(var e=this.particles;e--;)this._explosions.push(new h.Explosion({x:t,y:i,ctx:this._ctx,hue:s,friction:this.friction,gravity:this.gravity,flickering:(0,o.randomInt)(0,100)<=this.flickering,lineWidth:(0,o.randomFloat)(this.lineWidth.explosion.min,this.lineWidth.explosion.max),explosionLength:Math.round(this.explosion),brightness:this.brightness}))}drawExplosion(){for(var t=this._explosions.length;t--;)this._explosions[t].draw(),this._explosions[t].update((()=>{this._explosions.splice(t,1)}))}}})(),e})()})); \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..f380b46 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + New Year Coundown + + + + + + +
+

NEW YEAR COUNTDOWN

+

loading

+
+

Font (DSEG14 Classic Mini Regular) by Keshikan; effect that happens at midnight by Vitalij Ryndin; all other code by Samuel Sloniker. Click here for license information. This site is open-source.

+
+
+
+ + diff --git a/main.js b/main.js new file mode 100644 index 0000000..26d9b5c --- /dev/null +++ b/main.js @@ -0,0 +1,69 @@ +"use strict" + +/* + * Copyright (c) 2022 Samuel Sloniker + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +function format(number) { + return (number < 10)?("0" + String(number)):String(number) +} + +function adjust() { + let ce = document.querySelector("#countdown") + let cec = document.querySelector("#countdownbox") + let cet = document.querySelector("#countdowntext") + + let time = (newYear - new Date()) / 1000 + if (time <= 0) { + clearInterval(intervalID) + cet.innerHTML = "HAPPY NEW YEAR" + let fireworks = new Fireworks(document.querySelector("div#firepops"), { /* options */ }) + fireworks.start() + } else { + let days = Math.floor(time / (60 * 60 * 24)) + let hours = Math.floor(time / (60 * 60)) % 24 + let minutes = Math.floor(time / 60) % 60 + let seconds = Math.floor(time) % 60 + cet.textContent = (days?(format(days) + ":"):"") + + ((hours || days)?(format(hours) + ":"):"") + + ((minutes || hours || days)?(format(minutes) + ":"):"") + + format(seconds) + } + + let fontSize = 1 + ce.style.fontSize = String(fontSize - 1) + "px" + ce.style.fontSize = "1px" + while (ce.clientHeight <= cec.clientHeight && cec.scrollWidth <= document.documentElement.clientWidth && fontSize <= 180) { + fontSize += 1 + ce.style.fontSize = String(fontSize) + "px" + } + +} + +function main() { + window.newYear = new Date(new Date().getFullYear() + 1, 0, 1) + document.querySelector("h1#header").textContent = "NEW YEAR " + String(newYear.getFullYear()) + " COUNTDOWN" + window.intervalID = setInterval(adjust, 100) + window.addEventListener("resize", adjust) + adjust() +} + +window.onload = main diff --git a/style.css b/style.css new file mode 100644 index 0000000..c7d3895 --- /dev/null +++ b/style.css @@ -0,0 +1,68 @@ +@font-face { + font-family: "DSEG"; + src: url(DSEG14ClassicMini-Regular.woff); +} + +body { + background-color: #000; + text-align: center; + margin: 0 !important; + padding: 0 !important; + font-family: DSEG; + color: #0F0 +} + +div#container { + display: flex; + flex-flow: column; + height: 100vh; +} + +h1 { + font-size: 32pt; + flex: 0 1 auto; + margin-bottom: 0; +} + +div#countdownbox { + font-size: 20pt; + flex: 1 1 auto; + overflow: hidden; + align-items: center; + justify-content: center; + display: flex; +} + +p#countdown { + margin-top: 0; + margin-bottom: 0; + margin-left: 10px; + margin-right: 10px; +} + +div#creditbox { + font-size: 8pt; + padding-left: 4px; + padding-right: 4px; + flex: 0 1 auto; + z-index: 200; +} + +div#creditbox p.credits { + margin-top: 2px; + margin-bottom: 2px; + font-family: sans-serif; +} + +div#creditbox p.credits a { + color: #0F8; +} + +div#firepops { + position: absolute; + top: 0px; + left: 0px; + height: 100vh; + width: 100vw; + z-index: 100; +}