flyer v2 + correct night colors

main
Dorian 3 years ago
parent 3447053632
commit a2ebcf60e4

@ -6,18 +6,18 @@ status: hidden
<!--[en]--> <!--[en]-->
Walking when all the colours have disappeared from the forest is a special experience. Walking when all the colours have disappeared from the forest is a special experience.
You tune in to other senses. You discover silence, but you also notice movements and sounds that are absent during the day. <br/> You tune in to other senses. You discover silence, but you also notice movements and sounds that are absent during the day.
Moreover, when you walk during the most intense and important moments of the lunar cycle, you can transform your intentions. Moreover, when you walk during the most intense and important moments of the lunar cycle, you can transform your intentions.
That is what these walks invite you to do. That is what these walks invite you to do.
<!--[fr]--> <!--[fr]-->
Se promener lorsque toutes les couleurs ont disparu de la forêt est une expérience particulière. Se promener lorsque toutes les couleurs ont disparu de la forêt est une expérience particulière.
Vous êtes à l'écoute dautres sens. Vous découvrez le silence, mais vous remarquez aussi des mouvements et des sons qui sont absents pendant la journée. <br/> Vous êtes à l'écoute dautres sens. Vous découvrez le silence, mais vous remarquez aussi des mouvements et des sons qui sont absents pendant la journée.
De plus, lorsque vous marchez pendant les moments les plus intenses et les plus importants du cycle lunaire, vous pouvez transformer vos intentions. C'est à cela que vous invitent ces marches. De plus, lorsque vous marchez pendant les moments les plus intenses et les plus importants du cycle lunaire, vous pouvez transformer vos intentions. C'est à cela que vous invitent ces marches.
<!--[nl]--> <!--[nl]-->
Wandelen wanneer alle kleurtjes uit het bos verdwenen zijn, is een bijzondere ervaring. Wandelen wanneer alle kleurtjes uit het bos verdwenen zijn, is een bijzondere ervaring.
Je stelt in op andere zintuigen. Je ontdekt de stilte, maar je merkt ook bewegingen en geluiden op die overdag afwezig zijn. <br/> Je stelt in op andere zintuigen. Je ontdekt de stilte, maar je merkt ook bewegingen en geluiden op die overdag afwezig zijn.
Wanneer je bovendien wandelt tijdens de meest intense en belangrijke momenten van de maancyclus, kan je je intenties transformeren. Dat is waartoe deze wandelingen je uitnodigen. Wanneer je bovendien wandelt tijdens de meest intense en belangrijke momenten van de maancyclus, kan je je intenties transformeren. Dat is waartoe deze wandelingen je uitnodigen.

@ -2,6 +2,7 @@
/* RESET /* RESET
===================================================== */ ===================================================== */
body{ body{
background: white; background: white;
color: black; color: black;
@ -24,21 +25,21 @@ body > section.grid-display {
max-width: none; max-width: none;
} }
a, a:visited {
color: currentColor;
text-decoration-thickness: 0.04em;
}
/* VARIABLES /* VARIABLES
===================================================== */ ===================================================== */
:root{ :root{
/* big -> bigger but mono big stay the same */
--fs-big: 5rem;
--fs-mono-big: 2.4rem;
/* reduce a bit the lh for print */ /* reduce a bit the lh for print */
--lh: 1.3rem; --lh: 1.3rem;
/* 3 lang paysage */
--fs-big: 5rem; --fs-big: 5rem;
/* --fs-big: 4.6rem; */
/* 3 langs paysage */ --fs-mono-big: 2.4rem;
--fs-main: 11pt; --fs-main: 11pt;
/* /*
@ -47,15 +48,42 @@ body > section.grid-display {
*/ */
/* variable for flyer */ /* variable for flyer */
--margin: 1cm; --bleeds: 5mm;
--bleeds-print: 3mm;
--margin: 0.8cm;
/* A5 */ /* A5 */
--page-w: 210mm; --page-inner-w: 210mm;
--page-h: 148mm; --page-inner-h: 148mm;
--page-w: calc(var(--page-inner-w) + calc(var(--bleeds) * 2));
--page-h: calc(var(--page-inner-h) + calc(var(--bleeds) * 2));
}
html{
font-size: var(--fs-main);
} }
/* PRINT LAYOUT /* PRINT LAYOUT
===================================================== */ ===================================================== */
.container{
position: relative;
}
.layer{
position: absolute;
inset: 0;
}
.bleeds{
position: absolute;
inset: calc(-1 * var(--bleeds-print));
}
.pad{
padding: var(--lh) var(--margin);
}
.page{ .page{
width: var(--page-w); width: var(--page-w);
height: var(--page-h); height: var(--page-h);
@ -70,13 +98,16 @@ body > section.grid-display {
page-break-inside: avoid; page-break-inside: avoid;
} }
.container{ .page > .page-content{
position: relative; position: relative;
box-sizing: border-box;
margin: var(--bleeds);
top: var(--bleeds);
margin-top: 0;
width: var(--page-inner-w);
height: var(--page-inner-h);
} }
.layer{
position: absolute;
inset: 0;
}
.page-rotate{ .page-rotate{
width: var(--page-h); width: var(--page-h);
height: var(--page-w); height: var(--page-w);
@ -87,6 +118,100 @@ body > section.grid-display {
transform: rotate(90deg); transform: rotate(90deg);
} }
/* crops mark */
:root{
--trsp: rgba(0,0,0,0);
}
.page::after{
content: '';
position: absolute;
inset: 0;
background:
linear-gradient(
to right,
var(--trsp) 0,
var(--trsp) calc(var(--bleeds) - 1px),
white calc(var(--bleeds) - 1px),
white var(--bleeds),
black var(--bleeds),
black calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--page-w) - var(--bleeds) - 1px),
black calc(var(--page-w) - var(--bleeds) - 1px),
black calc(var(--page-w) - var(--bleeds)),
white calc(var(--page-w) - var(--bleeds)),
white calc(var(--page-w) - var(--bleeds) + 1px),
var(--trsp) calc(var(--page-w) - var(--bleeds) + 1px),
var(--trsp) 100%
),
linear-gradient(
to right,
var(--trsp) 0,
var(--trsp) calc(var(--bleeds) - 1px),
white calc(var(--bleeds) - 1px),
white var(--bleeds),
black var(--bleeds),
black calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--page-w) - var(--bleeds) - 1px),
black calc(var(--page-w) - var(--bleeds) - 1px),
black calc(var(--page-w) - var(--bleeds)),
white calc(var(--page-w) - var(--bleeds)),
white calc(var(--page-w) - var(--bleeds) + 1px),
var(--trsp) calc(var(--page-w) - var(--bleeds) + 1px),
var(--trsp) 100%
),
linear-gradient(
to bottom,
var(--trsp) 0,
var(--trsp) calc(var(--bleeds) - 1px),
white calc(var(--bleeds) - 1px),
white var(--bleeds),
black var(--bleeds),
black calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--page-h) - var(--bleeds) - 1px),
black calc(var(--page-h) - var(--bleeds) - 1px),
black calc(var(--page-h) - var(--bleeds)),
white calc(var(--page-h) - var(--bleeds)),
white calc(var(--page-h) - var(--bleeds) + 1px),
var(--trsp) calc(var(--page-h) - var(--bleeds) + 1px),
var(--trsp) 100%
),
linear-gradient(
to bottom,
var(--trsp) 0,
var(--trsp) calc(var(--bleeds) - 1px),
white calc(var(--bleeds) - 1px),
white var(--bleeds),
black var(--bleeds),
black calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--bleeds) + 1px),
var(--trsp) calc(var(--page-h) - var(--bleeds) - 1px),
black calc(var(--page-h) - var(--bleeds) - 1px),
black calc(var(--page-h) - var(--bleeds)),
white calc(var(--page-h) - var(--bleeds)),
white calc(var(--page-h) - var(--bleeds) + 1px),
var(--trsp) calc(var(--page-h) - var(--bleeds) + 1px),
var(--trsp) 100%
)
;
background-size:
100% calc(var(--bleeds) - 1mm),
100% calc(var(--bleeds) - 1mm),
calc(var(--bleeds) - 1mm) 100%,
calc(var(--bleeds) - 1mm) 100%;
background-position:
0% 0%,
0% 100%,
0% 0%,
100% 0%;
background-repeat: no-repeat;
pointer-events: none;
}
@media only screen { @media only screen {
body{ body{
background-color: whitesmoke; background-color: whitesmoke;
@ -96,37 +221,41 @@ body > section.grid-display {
outline: 1px yellowgreen solid; outline: 1px yellowgreen solid;
background: white; background: white;
} }
.page-content::after{
content: '';
position: absolute;
inset: 0;
outline: 1px green solid;
pointer-events: none;
}
} }
/* COMPOSITION
/* RECTO
===================================================== */ ===================================================== */
html{ .recto__title{
font-size: var(--fs-main); /* padding-top: var(--lh); */
position: relative;
} }
.recto__title h2{
.flyer h2{ line-height: 0.95;
line-height: 1;
display: inline-block; display: inline-block;
/* text-transform: uppercase; */
} }
.flyer h2:nth-of-type(3){ .recto__title h2:nth-of-type(3){
margin-left: calc(var(--lh) * 2); margin-left: calc(var(--lh) * 3);
} }
.new-moon-slanted-fvs,
.full-moon-slanted-fvs{
text-transform: none !important;
}
.recto__text{ .recto__text{
padding: var(--margin);
display: grid; display: grid;
grid-template-rows: 1fr min-content min-content; grid-template-rows: min-content 1fr min-content;
} gap: calc(var(--lh) * 2);
.verso__text{
padding: var(--margin);
display: flex;
flex-direction: column;
justify-content: flex-end;
} }
.recto__langs{ .recto__langs{
@ -142,134 +271,113 @@ html{
margin: 0; margin: 0;
} }
footer{ .recto__footer{
margin: calc(var(--lh) * 1) 0 calc(var(--lh) * 0.5);
display: flex; display: flex;
/* justify-content: space-between; */ justify-content: space-between;
align-items: baseline; color: white;
gap: calc(var(--lh) * 2);
/* 3 langs paysage */
margin: calc(var(--lh) * 0.5) 0 calc(var(--lh) * 0);
} }
.verso footer{ .recto__back{
/* color: white; */ background: linear-gradient(to top,
black calc(var(--bleeds-print) + var(--lh)),
white calc(var(--bleeds-print) + calc(var(--lh) * 3))
);
} }
/* GRID DRAWING /* VERSO
===================================================== */ ===================================================== */
.grid-cell{ .verso{
width: 100%; color: white;
height: 100%;
position: relative;
} }
.element-wrapper{
position: absolute;
inset: 0;
transform-origin: center center; .verso__back{
background: black;
width: 100%; background: linear-gradient(to top,
height: 100%; white calc(var(--bleeds-print) + var(--lh)),
black calc(var(--bleeds-print) + calc(var(--lh) * 3))
);
} }
/* added */ .calendar-content{
padding: calc(var(--lh) / 2) 0;
}
.drawing-back{ .verso__calendar{
background: display: grid;
radial-gradient(circle closest-side, white, white 50%, transparent calc(100% - var(--margin))), grid-template-rows: min-content 1fr min-content;
linear-gradient(to bottom, white, black); }
/* background-blend-mode: difference; */ .verso__footer{
color: black;
} }
/* .drawing-cirlce{ /* --- calendar */
background: linear-gradient(white, black); .flyer-cal-entry{
} */ display: flex;
justify-content: space-between;
align-items: baseline;
height: var(--lh);
}
.drawing-grid{ .flyer-cal-entry .day {
box-sizing: border-box; width: 10ch;
overflow: hidden; }
width: 100%; .flyer-cal-entry .phase-name {
height: 100%; width: 10ch;
position: absolute; }
inset: 0; .flyer-cal-entry > *{
/* outline: 1px solid white; */
}
.cal-entry__time{
margin-right: 10em;
}
/* --- moon drawing */
/* mix-blend-mode: difference; */ .cal-entry__moon {
width: 3rem;
margin-right: 2em;
} }
.leaf{ .moon-drawing {
--s: 80%; width: 1em;
height: 1em;
border-radius: 100%;
position: relative;
top: 0.2em;
}
.fullmoon .moon-drawing{
background: white;
}
.newmoon .moon-drawing{
border: 0.12em dotted white;
box-sizing: border-box; box-sizing: border-box;
width: var(--s); overflow: visible;
height: var(--s);
border-radius: 0 100% 0 50% / 0 50% 0 100%;
background: black;
/* border: var(--border);
background: white; */
} }
/* SVG DRAWING /* SVG DRAWING
===================================================== */ ===================================================== */
.verso{ .recto__drawing svg{
/* background-color: lightgrey; */
}
.svg-layer{
padding: var(--margin);
padding-bottom: calc( var(--margin) * 2);
}
.svg-layer svg{
display: block; display: block;
margin: 0 auto; margin: 0 auto;
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 85%;
position: absolute;
right: 11.0%;
top: 0.7cm;
} }
.svg-layer path{ .recto__drawing path{
fill: none; fill: none;
stroke: black; stroke: white;
vector-effect: non-scaling-stroke; vector-effect: non-scaling-stroke;
stroke-width: var(--border-width); stroke-width: 0.5px;
/* stroke-dasharray: 4; */ /* stroke-dasharray: 4; */
}
.new-full-drawing{
/* padding: var(--margin);
display: grid;
grid-template-rows: 1fr 1fr;
gap: var(--margin); */
} }
.new-full-drawing > *{
border-radius: 50%;
width: 5cm;
height: 5cm;
position: absolute;
}
.new-moon-drawing{
top: 5cm;
left: 5cm;
box-sizing: border-box;
border-style: dotted;
border-width: 0.25cm;
border-color: rgba(0,0,0,0.5);
/* background-color: white;
background: linear-gradient(to left, white, transparent); */
}
.full-moon-drawing{
top: 12cm;
left: 7cm;
background-color: white; .flyer-cal-entry > *{
background: linear-gradient(to bottom, black, transparent 75%); background-color: black;
} }

@ -51,14 +51,14 @@ body{
body.night{ body.night{
/* slitghly cyan moon reflection, low contrast */ /* slitghly cyan moon reflection, low contrast */
--clr-text: hsl(160, 6%, 86%); --clr-text: hsl(160, 6%, 92%);
--clr-soft-text: rgba(255,255,255,0.35); --clr-soft-text: rgba(255,255,255,0.35);
--clr-header: hsl(320, 4%, 12%); --clr-header: hsl(320, 4%, 12%);
--clr-header: black; --clr-header: black;
/* night -- grey purple */ /* night -- grey purple */
/* --clr-soft: hsl(290, 10%, 38%); */ --clr-soft: hsl(290, 10%, 38%);
--clr-back: hsl(252, 30%, 18%); --clr-back: hsl(252, 34%, 14%);
} }

@ -1,282 +0,0 @@
/*
bug fix past / confirmed in both dark and light time
make sure it fit on iphone 5
make whole transition in size
add (open) button
add a [now] indicator on the timeline
decide if we leave or not the illumination level
homogenize time notation (19h30 & 8:05:30pm)
*/
/* CALENDAR SECTIONS
============================================================================ */
.calendar-box {
display: grid;
align-items: last baseline;
grid-template-columns: repeat(4, auto) 1fr;
grid-template-rows: auto auto;
gap: calc(var(--pad) * 1) calc(var(--pad) * 4);
padding: calc(var(--pad) * 2) 0;
border-bottom: var(--border);
position: relative;
}
.calendar-box .phase-name {
/* has to have fixed width so both phase name have same width */
width: 4.8em;
}
.calendar-box>.reservation-wrapper {
flex-grow: 1;
}
/* --- date --- */
#calendar-section .day-in-full {
display: block;
font-size: var(--fs-big);
margin-bottom: -0.15em;
}
#calendar-section .number-date {
/* mono */
font-family: 'Inconsolata', monospace;
font-variation-settings: 'wght'220, 'wdth'120;
font-size: calc(var(--fs-mono) * 2.4);
line-height: 1;
/* classic */
/* font-size: var(--fs-big);
line-height: 1; */
}
.number-date span:not(:last-of-type)::after {
content: ".";
margin: 0 -0.2em;
}
/* --- moon drawing --- */
.moon-drawing {
--size: 0.8em;
--illumination: 1;
font-size: var(--fs-title);
display: block;
margin: auto;
width: var(--size);
height: var(--size);
background-color: rgba(255, 255, 255, var(--illumination));
border-radius: 100%;
}
/* --- phase name --- */
h2.phase-name {
line-height: 0.76;
text-transform: capitalize;
}
/* --- reservation link --- */
/* basic */
.reservation-wrapper {
font-size: var(--fs-big);
text-align: right;
white-space: nowrap;
}
.reservation-wrapper a {
text-transform: capitalize;
text-decoration: none;
}
.calendar-box:not(.confirmed) .reservation-wrapper {
display: none;
}
/* blue if confirmed */
.confirmed .reservation-wrapper {
color: midnightblue;
}
/* underline if confirmed and not past (=has href)*/
.confirmed .reservation-wrapper a[href] {
color: midnightblue;
}
.confirmed .reservation-wrapper a[href] span:nth-of-type(2) {
text-decoration: underline;
text-decoration-thickness: var(--border-width);
}
/* grey if past */
.past .reservation-wrapper {
color: grey;
}
.past .reservation-wrapper a {
color: grey;
}
/* --- secondary info --- */
.moon-event-time {
padding-left: 0.2em;
}
.sun {
font-size: 1.75em;
vertical-align: initial;
margin-right: 0.14em;
position: relative;
top: 0.18em;
line-height: 0;
}
.api-info-wrapper {
display: contents;
}
.sunset {
grid-column: 4 / span 2;
}
.moon-event-time {
grid-column: 1 / span 1;
}
.distance {
grid-column: 3 / span 1;
}
.illumination {
display: none;
}
/* --- past & confirmed --- */
/* the past & confirmed must be visible without opening on mobile!! */
.confirmed .date-wrapper,
.confirmed .phase-name-wrapper {
color: midnightblue;
}
.past .date-wrapper,
.past .phase-name-wrapper {
color: grey;
}
/* .last-past:after {
content: "\27A4";
display: block;
background: var(--c-light);
position: absolute;
top: 100%;
grid-column: 2 / span 1;
} */
/* loading-holder */
.loading-holder {
margin: calc(var(--pad) * 2) 0;
animation: glowing 1s infinite alternate;
}
@keyframes glowing {
from {
color: var(--c-dark);
}
to {
color: white;
}
}
/* FOOTER
============================================================================ */
.calendar > footer{
text-align: center;
grid-column: 1 / span 2;
margin-bottom: calc(var(--pad) * 2);
}
/* MOBILE
============================================================================ */
@media only screen and (max-width: 1050px) {
.calendar-box {
gap: calc(var(--pad) * 1) calc(var(--pad) * 2);
}
}
@media only screen and (max-width: 850px) {
.calendar-box {
grid-template-columns: 1fr auto 1fr;
grid-template-rows: auto auto auto;
gap: 0 calc(var(--pad) * 2);
}
.calendar-box:not(.confirmed) {
grid-template-rows: auto auto;
}
/* --- typo adjustments --- */
.moon-drawing {
--size: 1em;
}
.date-wrapper .number-date {
font-variation-settings: 'wght'250, 'wdth'120;
font-size: calc(var(--fs-mono) * 2.5);
}
/* --- open / close mobile mechanism --- */
/* the open close button */
.date-wrapper,
.phase-name-wrapper,
.moon-drawing {
cursor: pointer;
}
/* hidding in mobile - when click --> .open */
.calendar-box.open {
gap: calc(var(--pad) * 2);
}
.to-hide-on-mob {
display: none;
}
/* walk info placement */
.open.confirmed .walk-info-wrapper {
display: block;
grid-column-end: span 3;
}
.open.confirmed .reservation-wrapper {
display: block;
padding-right: calc(var(--pad) * 1);
grid-column: -2 / -1;
grid-row: -2 / -1;
}
/* api-info placement */
.open .api-info-wrapper {
grid-column-end: span 2;
display: flex;
flex-wrap: wrap;
}
.api-info-wrapper>* {
flex-basis: 100%;
padding: 0;
}
.sunset {
order: 1;
}
.moon-event-time {
order: 2;
}
.illumination {
order: 3;
}
.distance {
order: 4;
}
}
@media only screen and (max-width: 600px) {}

@ -13,17 +13,6 @@
// so we have to use luxon to parse the string as CET, and convert it to a proper date object // so we have to use luxon to parse the string as CET, and convert it to a proper date object
// then we can print this object back according to where the walk happens // then we can print this object back according to where the walk happens
// test zone for other date
// first new moon of 2000 according to:
// https://www.calendar-12.com/moon_phases/2000
// let now = new Date(Date.parse('06 Jan 2000 19:14:00 GMT+1'));
// let now = new Date(Date.parse('13 Jan 2000 05:41:00 GMT+1'));
// let now = new Date(Date.parse('21 Jan 2000 05:41:00 GMT+1'));
let now = new Date();
let months_ahead = window.walk_calendar["months_ahead"];
let month_to_get = now;
let queue = [];
// UTILITIES // UTILITIES
// ========================================================================== // ==========================================================================
@ -205,6 +194,77 @@ function writeTimezone(){
} }
function addDateToFlyer(date, moon){
// given a moon state object from the API,
// fill in the template and add it to the calendar
// --- data we need from the yaml
let lat = window.walk_calendar["latitude"];
let long = window.walk_calendar["longitude"];
let timezone = window.walk_calendar["timezone"];
let contact_mail = window.walk_calendar["reservation_mail"];
// --- converting the date to walk timezone
date = date.setZone(timezone);
// --- clone template
let template = $('#cal-entry__template').html();
let $cal_entry = $($.parseHTML(template));
// --- get suncalc sun object
let walk_sunset = getSunStateFromDate(date, lat, long, timezone)[1];
// --- formating the info
let phase_name = moon.phaseName;
let phase = moon.isPhaseLimit === 1 ? 0 : 0.5;
// API is missing dutch phase name
if (window.current_local == "nl-be"){
phase_name = translatePhaseDutch(phase_name);
}
// convert those two luxon dates in 'timezone' to human readable strings
// whith 'timezone' indicated
let walk_sunset_time = format_luxon_date(walk_sunset);
let formated_date = format_luxon_date(date);
// let time_id = date.toUnixInteger();
let time_id =formated_date['date'].split(".").join("-");
// --- filling the info
$cal_entry.attr("id", time_id);
// --- PHASENAME
$cal_entry.find(".phase-name").html(phase_name);
// --- EVENT
$cal_entry.find(".day").html(formated_date['day']);
$cal_entry.find(".date").html(formated_date['date']);
// --- SECONDARY INFO ---
$cal_entry.find(".sunset-time").html(walk_sunset_time['time']);
$cal_entry.find(".moon-time").html(formated_date['time']);
// --- MAIL ---
$(".mail").html(contact_mail);
let uri = "mailto:" + contact_mail;
$(".mail").attr("href", uri);
// --- updating the font
updateAxis($cal_entry, phase);
if(phase === 0){
$cal_entry.addClass("newmoon");
}
else{
$cal_entry.addClass("fullmoon");
}
let moon_shift = mapValue(parseInt(formated_date['time'].substring(0,2)), 0, 24, 0, 100);
$cal_entry.find('.moon-drawing').css("left", moon_shift+"%");
// --- append to body
$('.calendar-content').append($cal_entry);
}
// PROCESSING API RESPONSE // PROCESSING API RESPONSE
// ========================================================================== // ==========================================================================
@ -259,7 +319,12 @@ function processMonthResponse(response){
// console.log(dateTimeISO); // console.log(dateTimeISO);
// console.log(date.zoneName); // console.log(date.zoneName);
addDateToCalendar(date, moon); if(! window.is_flyer){
addDateToCalendar(date, moon);
}
else{
addDateToFlyer(date, moon);
}
} }
} }
} }
@ -333,11 +398,10 @@ function processQueue() {
function createCalendar(months_ahead){ function createCalendar(months_ahead){
let new_month = now; let new_month = now;
let lang = window.current_local.substring(0,2);
for (var i = 0; i < months_ahead; i++) { for (var i = 0; i < months_ahead; i++) {
let lang = window.current_local.substring(0,2);
// config to send to the API // config to send to the API
let config_month = { let config_month = {
lang : lang, lang : lang,
@ -352,12 +416,3 @@ function createCalendar(months_ahead){
new_month = nextMonth(new_month); new_month = nextMonth(new_month);
} }
} }
$(document).ready(function(){
createCalendar(months_ahead);
writeTimezone();
});

@ -1,261 +0,0 @@
class Grid{
constructor(id, cell_size, mode = "STRETCH"){
this.id = id;
this.$grid = $("#"+id);
if (Array.isArray(cell_size)){
this.cell_width = cell_size[0];
this.cell_height = cell_size[1];
} else{
this.cell_width = cell_size;
this.cell_height = cell_size;
}
this.columns = 0;
this.rows = 0;
const possible_mode = ["STRETCH", "FIXED", "SPACE"];
if(possible_mode.includes(mode)){
this.mode = mode;
}
// this.init_css();
this.elements = [];
this.distribute = function(i,j){
// default distribution if there is more than one element
let index = j;
let choose = (index+(i%this.elements.length))%this.elements.length;
return choose;
}
this.mouvements = [];
}
init_css(){
// get the new element because pagedjs changed it
this.$grid = $("#"+this.id);
// compute number of cell that can fit horizontaly and verticaly
this.columns = String(Math.floor(this.$grid.width() / this.cell_width));
this.rows = String(Math.floor(this.$grid.height() / this.cell_height));
console.log(this.$grid.width(), this.$grid.height());
console.log("col-row-size", this.columns, this.rows, "(" + this.cell_width + "px", this.cell_width + "px" + ")");
// init css grid
this.$grid.css("display", "grid");
if(this.mode == "STRETCH" || this.mode == "SPACE"){
this.$grid.css("grid-template-columns", "repeat("+ this.columns +", 1fr");
this.$grid.css("grid-template-rows", "repeat("+ this.rows +", 1fr");
} else{
this.$grid.css("grid-template-columns", "repeat("+ this.columns +", "+ this.cell_width + "px");
this.$grid.css("grid-template-rows", "repeat("+ this.rows +", "+ this.cell_height + "px");
}
}
addElement(element_template){
this.elements.push(element_template);
}
addMouvement(grid_mouvement){
this.mouvements.push(grid_mouvement);
}
draw(){
// fill all the grid with it's element
this.init_css();
for (var i = 0; i < this.rows; i++) {
for (var j = 0; j < this.columns; j++) {
// pick the element we are going to draw
let pick = this.distribute(i,j);
let element_html = "";
if(pick >= 0){
element_html = this.elements[pick].html;
}
// a clone
let $el = $(element_html);
// wrapp it in a cell
let $cell = $("<div>").addClass("grid-cell");
let $wrapper = $("<div>").addClass("element-wrapper");
//so we can chain transform on it
// $wrapper.css("transform-origin", "center center");
// $wrapper.css("transform", "translate(-50%, -50%)");
if(this.mode == "SPACE"){
$wrapper.css("width", this.cell_width);
$wrapper.css("height", this.cell_height);
}
$cell.append($wrapper.append($el));
// iterate over all mouvement and apply them to the clone
this.mouvements.forEach( function(mvt){
mvt.apply($cell,i,j);
});
// get a clone with mouvement applied
// let $el = this.element_template.draw(i,j);
this.$grid.append($cell);
}
}
}
}
class GridElement{
// a template of grid element to clone into the grid
constructor(id){
//get html content string
// let content = $("#"+id).html();
// wrapp it in a cell
// let $cell = $("<div>").addClass("grid-cell");
// let $wrapper = $("<div>").addClass("element-wrapper");
// $cell.append($wrapper.append(content));
//
// this.html = $("<div>").append($cell).html().trim();
this.html = $("#"+id).html();
// this.mouvements = [];
}
// addMouvement(grid_mouvement){
// this.mouvements.push(grid_mouvement);
// }
// draw(i, j){
// // return the DOM element according to it's template and an i,j parameter
//
// // a clone
// let $new_el = $(this.html);
//
// // iterate over all mouvement and apply them to the clone
// this.mouvements.forEach( function(mvt){
// mvt.apply($new_el,i,j);
// });
//
// return $new_el;
// }
}
class GridMouvement{
constructor(css_property, eval_function, selector=".element-wrapper"){
this.selector = selector;
this.property = css_property;
this.evaluate = eval_function;
}
apply($element, i, j){
// apply the mouvement to an element according to it's i, j position
// on the grid
let $search = $("<div>").append($element);
let $affected_by_mvt = $search.find(this.selector);
let css = this.evaluate(i,j);
if(this.property == "transform"){
let current_transform = $affected_by_mvt.css("transform");
css = current_transform + " " + css;
}
$affected_by_mvt.css(this.property, css);
}
}
// default mouvements
function map_range(value, in_min, in_max, out_min, out_max) {
return (value - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
const sym2HH = new GridMouvement("transform", function(i,j){
let scaleY = 1;
if(j%2==1){ scaleY = -1; }
let transform = "scaleY("+scaleY+")";
return transform;
});
const sym2VV = new GridMouvement("transform", function(i,j){
let scaleX = 1;
if(i%2==1){ scaleX = -1; }
let transform = "scaleX("+scaleX+")";
return transform;
});
const sym4 = new GridMouvement("transform", function(i,j){
let scaleX = 1;
let scaleY = 1;
if(i%2==1){ scaleX = -1; }
if(j%2==1){ scaleY = -1; }
let transform = "scaleX("+scaleX+") scaleY("+scaleY+")";
return transform;
});
const sym4alt = new GridMouvement("transform", function(i,j){
let scaleX = 1;
let scaleY = 1;
if(i%2==1){ scaleY = -1; }
if(j%2==1){ scaleX = -1; }
let transform = "scaleX("+scaleX+") scaleY("+scaleY+")";
return transform;
});
const line_shift = new GridMouvement("transform", function(i,j){
let translate = "";
if(i%2==1){
translate = "translateX(-25%)";
}
if(i%2==0){
translate = "translateX(+25%)";
}
return translate;
});
const shrink = new GridMouvement("transform", function(i,j){
let factor = j/(mygrid.columns);
return "scale("+factor+")";
});
const rotation = new GridMouvement("transform", function(i,j){
let angle = String((j/(mygrid.columns-1))*360)+"deg";
let rotate = "rotate("+angle+")";
return rotate;
});
const random_rot = new GridMouvement("transform", function(i,j){
let angle = Math.random()*360;
let rotate = "rotate("+angle+"deg)";
return rotate;
});
const random_color = new GridMouvement("background", function(i,j){
let hue = map_range(Math.random(),0,1,30,100);
let color = "hsl("+hue+",70%,50%)";
return color;
}, ".leaves");
const scattered = new GridMouvement("transform", function(i,j){
let maxdecal = 120;
let decalx = (Math.random()*maxdecal) - (maxdecal/2);
let decaly = (Math.random()*maxdecal) - (maxdecal/2);
let transform = "translate("+decalx+"%, "+decaly+"%)";
return transform;
});
const diagonal_fontsize = new GridMouvement("font-size", function(i,j){
let x = j/(mygrid.columns-1);
let y = i/(mygrid.rows-1);
let fontsize = Math.max(Math.abs(x-y) * 10, 1);
return fontsize+"em";
});

@ -4,10 +4,6 @@
{{ super() }} {{ super() }}
<link rel="stylesheet" type="text/css" href="{{ THEME_STATIC_DIR }}/css/flyer.css" /> <link rel="stylesheet" type="text/css" href="{{ THEME_STATIC_DIR }}/css/flyer.css" />
<!-- GRID DRAWING
------------------------------------------------------------------- -->
<script src="{{ THEME_STATIC_DIR }}/js/tools/css-grid-drawing.js"></script>
{% endblock %} {% endblock %}
{% block scroll_content %} {% block scroll_content %}
@ -15,108 +11,127 @@
<article class="flyer"> <article class="flyer">
<div class="page recto"> <div class="page recto">
<div class="layer recto__text"> <div class="page-content">
<div class="layer recto__back bleeds"></div>
<div class="layer recto__text pad">
<header> <header class="recto__title">
<h2 class="phase-name font-big new-moon-fvs">New moon&nbsp;</h2> <h2 class="phase-name font-big new-moon-fvs">New moon&nbsp;</h2>
<h2 class="font-big new-moon-slanted-fvs">walks</h2> <h2 class="font-big new-moon-slanted-fvs">walks</h2>
<h2 class="phase-name font-big full-moon-fvs">Full moon&nbsp;</h2> <h2 class="phase-name font-big full-moon-fvs">Full moon&nbsp;</h2>
<h2 class="font-big full-moon-slanted-fvs">walks</h2> <h2 class="font-big full-moon-slanted-fvs">walks</h2>
</header>
<main class="text-content recto__langs"> {#<div class="layer recto__drawing">
<div class="recto__lang"> {% include 'inline-svg/bouleau-feuilles-big-1-export.svg' %}
<p class="font-up">en</p> </div>#}
<div class="progressive-fvs"> </header>
{{ page.sections["en"] }}
<main class="text-content recto__langs">
<div class="recto__lang">
<p class="font-up">en</p>
<div class="progressive-fvs">
{{ page.sections["en"] }}
</div>
</div> </div>
</div> <div class="recto__lang">
<div class="recto__lang"> <p class="font-up">fr</p>
<p class="font-up">fr</p> <div class="progressive-fvs">
<div class="progressive-fvs"> {{ page.sections["fr"] }}
{{ page.sections["fr"] }} </div>
</div> </div>
</div> <div class="recto__lang">
<div class="recto__lang"> <p class="font-up">nl</p>
<p class="font-up">nl</p> <div class="progressive-fvs">
<div class="progressive-fvs"> {{ page.sections["nl"] }}
{{ page.sections["nl"] }} </div>
</div> </div>
</div> </main>
</main>
<footer> <footer class="recto__footer">
<a class="mono-big" href="http://moonwalks.be">moonwalks.be</a> <p class="mono">
<p class="mono"> walks calendar at <a href="http://moonwalks.be">moonwalks.be</a>
an initiative by Anaïs Berck </p>
</p> <p class="mono">
</footer> an initiative by Anaïs Berck
</p>
</footer>
</div>
</div> </div>
</div> </div>
<div class="page verso"> <div class="page verso">
<div class="page-content">
<div class="layer verso__back bleeds"></div>
<div class="page-rotate"> <div class="layer recto__drawing">
{% include 'inline-svg/bouleau-feuilles-big-1-export.svg' %}
<!-- <div class="layer drawing-back">
</div> </div>
<div id="verso-drawing" class="layer drawing-grid">
</div> -->
<div class="layer svg-layer"> <div class="layer verso__calendar pad">
{% include 'inline-svg/bouleau.svg' %} <header class="date-time-info mono">
</div> Dates and times are given in <span class="timezone"></span>
<div class="layer new-full-drawing"> </header>
<div class="new-moon-drawing"></div> <div class="calendar-content">
<div class="full-moon-drawing"></div> <template id="cal-entry__template">
</div> <div class="flyer-cal-entry">
<div class="date mono"></div>
<div id="verso-drawing" class="layer verso__text"> <div class="day"></div>
<footer class="mono-big">
<a href="http://moonwalks.be">moonwalks.be</a>
<p class="mono">
an initiative by Anaïs Berck
</p>
</footer>
</div>
</div> <div class="cal-entry__moon">
<div class="moon-drawing"></div>
</div>
<h2 class="phase-name"></h2>
<div class="cal-entry__time mono">
<span class="moon-time"></span>
</div>
<div class="cal-entry__data mono">
sunset <span class="sunset-time"></span>
</div>
</div>
</template>
</div>
<footer class="verso__footer">
<!-- <p class="mono">
walks calendar at <a href="http://moonwalks.be">moonwalks.be</a>
</p> -->
<!-- <p class="mono">
reservations at <a class="mail"></a>
</p> -->
</footer>
</div>
</div>
</div> </div>
</article> </article>
<template id="leaf-element"> <!-- <template id="leaf-element">
<div class="leaf"> <div class="leaf">
</div> </div>
</template> </template>
<script> <template id="moon-element">
// ___ GRID INIT ___ <div class="moon">
const CELL_SIZE = [80,80]; </div>
const GRID_ID = "verso-drawing"; </template> -->
mygrid = new Grid(GRID_ID, CELL_SIZE, "STRETCH");
// ___ ELEMENT INIT ___
myelement = new GridElement("leaf-element");
mygrid.addElement(myelement);
// ___ CUSTOM MOUVEMENT ___
mygrid.addMouvement(random_rot);
mygrid.addMouvement(scattered);
//mygrid.draw();
</script>
{% endblock %} {% endblock %}
{% block js_body %} {% block js_body %}
{{ super() }} {{ super() }}
<script> <script>
// progressive text
let prog_fvs = document.getElementsByClassName("progressive-fvs"); let prog_fvs = document.getElementsByClassName("progressive-fvs");
for (let div of prog_fvs) { for (let div of prog_fvs) {
@ -134,10 +149,25 @@
let i = 0; let i = 0;
for (let prog_span of prog_spans){ for (let prog_span of prog_spans){
let value = (i / (prog_spans.length - 1)) / 2; let value = (i / (prog_spans.length - 1)) / 2;
console.log(value); //console.log(value);
updateAxis($(prog_span), value, secondAxis=false); updateAxis($(prog_span), value, secondAxis=false);
i = i + 1; i = i + 1;
} }
} }
</script> </script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/moon-calendar.js"></script>
<script>
let now = new Date();
let months_ahead = 12;
let month_to_get = now;
let queue = [];
window.is_flyer = true;
$(document).ready(function(){
createCalendar(months_ahead);
writeTimezone();
});
</script>
{% endblock %} {% endblock %}

@ -18,16 +18,8 @@
<div class="text-content moon-phased-typo about-box"> <div class="text-content moon-phased-typo about-box">
{{ page.sections["intro"] }} {{ page.sections["intro"] }}
</div> </div>
<div class="text-content bio-box"> <div class="text-content moon-phased-typo bio-box">
{#<div class="bio-box__leaves">
{% include 'inline-svg/bouleau.svg' %}
</div>#}
{#<div class="bio-box__text moon-phased-typo">
</div>#}
{{ page.sections["bio"] }} {{ page.sections["bio"] }}
</div> </div>
</section> </section>
@ -45,4 +37,26 @@
{% block js_body %} {% block js_body %}
{{ super() }} {{ super() }}
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/moon-calendar.js"></script> <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/moon-calendar.js"></script>
<script>
// test zone for other date
// first new moon of 2000 according to:
// https://www.calendar-12.com/moon_phases/2000
// let now = new Date(Date.parse('06 Jan 2000 19:14:00 GMT+1'));
// let now = new Date(Date.parse('13 Jan 2000 05:41:00 GMT+1'));
// let now = new Date(Date.parse('21 Jan 2000 05:41:00 GMT+1'));
let now = new Date();
let months_ahead = window.walk_calendar["months_ahead"];
let month_to_get = now;
let queue = [];
$(document).ready(function(){
createCalendar(months_ahead);
writeTimezone();
});
</script>
{% endblock %} {% endblock %}

Loading…
Cancel
Save