updated api calls with copyright and routes
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"atlascode.bitbucket.enabled": true
|
||||||
|
}
|
||||||
@@ -70,7 +70,20 @@ const ApiResponse = async (req, res) => {
|
|||||||
ctx.textAlign = "left";
|
ctx.textAlign = "left";
|
||||||
ctx.font = "50px AmaticSC";
|
ctx.font = "50px AmaticSC";
|
||||||
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
||||||
ctx.fillText("WWW.GETAHEADCHRISTMAS.CO.UK", 40, 740);
|
var copyrightSymbol = 169; // 0xA9
|
||||||
|
var $now = new Date();
|
||||||
|
var $yearCount = $now.getFullYear();
|
||||||
|
ctx.fillText(
|
||||||
|
String.fromCharCode(copyrightSymbol) +
|
||||||
|
" " +
|
||||||
|
"WWW.GETAHEADCHRISTMAS.CO.UK " +
|
||||||
|
" " +
|
||||||
|
$yearCount,
|
||||||
|
40,
|
||||||
|
740
|
||||||
|
);
|
||||||
|
|
||||||
|
$yearCount;
|
||||||
|
|
||||||
console.log(ctx);
|
console.log(ctx);
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,18 @@ const ApiResponse = async (req, res) => {
|
|||||||
ctx.textAlign = "left";
|
ctx.textAlign = "left";
|
||||||
ctx.font = "50px AmaticSC";
|
ctx.font = "50px AmaticSC";
|
||||||
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
||||||
ctx.fillText("WWW.GETAHEADCHRISTMAS.CO.UK", 40, 740);
|
var copyrightSymbol = 169; // 0xA9
|
||||||
|
var $now = new Date();
|
||||||
|
var $yearCount = $now.getFullYear();
|
||||||
|
ctx.fillText(
|
||||||
|
String.fromCharCode(copyrightSymbol) +
|
||||||
|
" " +
|
||||||
|
"WWW.GETAHEADCHRISTMAS.CO.UK " +
|
||||||
|
" " +
|
||||||
|
$yearCount,
|
||||||
|
40,
|
||||||
|
740
|
||||||
|
);
|
||||||
console.log(ctx);
|
console.log(ctx);
|
||||||
|
|
||||||
const png = canvas.toBuffer("image/png");
|
const png = canvas.toBuffer("image/png");
|
||||||
|
|||||||
@@ -62,8 +62,18 @@ const ApiResponse = async (req, res) => {
|
|||||||
ctx.textAlign = "left";
|
ctx.textAlign = "left";
|
||||||
ctx.font = "50px AmaticSC";
|
ctx.font = "50px AmaticSC";
|
||||||
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
||||||
ctx.fillText("WWW.GETAHEADCHRISTMAS.CO.UK", 40, 740);
|
var copyrightSymbol = 169; // 0xA9
|
||||||
|
var $now = new Date();
|
||||||
|
var $yearCount = $now.getFullYear();
|
||||||
|
ctx.fillText(
|
||||||
|
String.fromCharCode(copyrightSymbol) +
|
||||||
|
" " +
|
||||||
|
"WWW.GETAHEADCHRISTMAS.CO.UK " +
|
||||||
|
" " +
|
||||||
|
$yearCount,
|
||||||
|
40,
|
||||||
|
740
|
||||||
|
);
|
||||||
console.log(ctx);
|
console.log(ctx);
|
||||||
|
|
||||||
const png = canvas.toBuffer("image/png");
|
const png = canvas.toBuffer("image/png");
|
||||||
|
|||||||
@@ -62,7 +62,18 @@ const ApiResponse = async (req, res) => {
|
|||||||
ctx.textAlign = "left";
|
ctx.textAlign = "left";
|
||||||
ctx.font = "50px AmaticSC";
|
ctx.font = "50px AmaticSC";
|
||||||
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
//ctx.strokeText("WWW.GETAHEADCHRISTMAS.CO.UK", x, y);
|
||||||
ctx.fillText("WWW.GETAHEADCHRISTMAS.CO.UK", 40, 740);
|
var copyrightSymbol = 169; // 0xA9
|
||||||
|
var $now = new Date();
|
||||||
|
var $yearCount = $now.getFullYear();
|
||||||
|
ctx.fillText(
|
||||||
|
String.fromCharCode(copyrightSymbol) +
|
||||||
|
" " +
|
||||||
|
"WWW.GETAHEADCHRISTMAS.CO.UK " +
|
||||||
|
" " +
|
||||||
|
$yearCount,
|
||||||
|
40,
|
||||||
|
740
|
||||||
|
);
|
||||||
|
|
||||||
console.log(ctx);
|
console.log(ctx);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import axios from "axios";
|
|||||||
const FourOhFour = (props) => {
|
const FourOhFour = (props) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
let numbDays = router.query.n;
|
let numbDays = router.query.days;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Image
|
<Image
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
// 404.js
|
||||||
|
|
||||||
|
import Image from "next/image";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
|
const FourOhFour = (props) => {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
let numbWeeks = router.query.weekstoday;
|
||||||
|
|
||||||
|
function addThousandsSeparator(e) {
|
||||||
|
return e.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
||||||
|
}
|
||||||
|
|
||||||
|
function countDownToChristmas() {
|
||||||
|
var $now = new Date();
|
||||||
|
var $yearCount = $now.getFullYear();
|
||||||
|
|
||||||
|
if ($now.getMonth() + 1 == 12 && $now.getDate() >= 25) {
|
||||||
|
$yearCount = $yearCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var $xmas = new Date($yearCount, 11, 25);
|
||||||
|
var $now_seconds = Math.round($now.getTime() / 1e3);
|
||||||
|
var $xmas_seconds = Math.round($xmas.getTime() / 1e3);
|
||||||
|
var $seconds_to_go = $xmas_seconds - $now_seconds;
|
||||||
|
var $minutes_to_go = Math.round($seconds_to_go / 60);
|
||||||
|
var $hours_to_go = ($minutes_to_go / 60).toFixed(1);
|
||||||
|
var $days_to_go = ($hours_to_go / 24 - 1).toFixed();
|
||||||
|
var $sleeps_to_go = parseInt($days_to_go) + 1;
|
||||||
|
var $weeks_to_go = ($minutes_to_go / 60 / 24 / 7).toFixed(2);
|
||||||
|
var $fortnights_to_go = ($minutes_to_go / 60 / 24 / 7 / 2).toFixed(2);
|
||||||
|
var $months_to_go = ($weeks_to_go / (52 / 12)).toFixed(2);
|
||||||
|
var $years_to_go = ($weeks_to_go / 52).toFixed(2);
|
||||||
|
|
||||||
|
return $days_to_go;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Image
|
||||||
|
src={"/api/days/" + countDownToChristmas()}
|
||||||
|
width="940"
|
||||||
|
height="788"
|
||||||
|
alt="weeks"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default FourOhFour;
|
||||||
@@ -6,7 +6,7 @@ import { useRouter } from "next/router";
|
|||||||
const FourOhFour = (props) => {
|
const FourOhFour = (props) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
let numbSleeps = router.query.n;
|
let numbSleeps = router.query.sleeps;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Image
|
<Image
|
||||||
@@ -6,7 +6,7 @@ import { useRouter } from "next/router";
|
|||||||
const FourOhFour = (props) => {
|
const FourOhFour = (props) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
let numbWeeks = router.query.n;
|
let numbWeeks = router.query.weeks;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Image
|
<Image
|
||||||
@@ -6,7 +6,7 @@ import { useRouter } from "next/router";
|
|||||||
const FourOhFour = (props) => {
|
const FourOhFour = (props) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
let numbWeeks = router.query.n;
|
let numbWeeks = router.query.weekstoday;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Image
|
<Image
|
||||||
Reference in New Issue
Block a user