|
<!DOCTYPE html> |
|
<html lang="fr"> |
|
<head> |
|
<meta charset="utf-8" /> |
|
<title>Lettre</title> |
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css"> |
|
<link rel="stylesheet" href="paper.css"> |
|
<!-- https://github.com/cognitom/paper-css --> |
|
<link rel='stylesheet' href="https://fonts.googleapis.com/css?family=Gentium+Basic:400,400i,700,700i&subset=latin-ext"> |
|
<style> |
|
/* Attention les marges affichées dans le navigateur ne sont pas précises. En revanche, durant l'exportation au format Pdf, les marges sont parfaitement respectées. */ |
|
/* Layout */ |
|
@page { |
|
size: A4; |
|
} |
|
@media screen { |
|
header, footer { |
|
background: #efefef; |
|
} |
|
} |
|
.first-page, .map { |
|
display: flex; |
|
flex-direction: column; |
|
} |
|
header { |
|
order: 1; |
|
} |
|
.content { |
|
order: 2; |
|
} |
|
footer { |
|
order: 3; |
|
} |
|
.first-page header { |
|
display: flex; |
|
flex-direction: row; |
|
height: 100mm; |
|
} |
|
.from { |
|
flex-grow: 0; |
|
flex-shrink: 0; |
|
flex-basis: 90mm; |
|
} |
|
.to { |
|
flex-grow: 1; |
|
flex-shrink: 0; |
|
flex-basis: auto; |
|
padding-top: 30mm; |
|
} |
|
.first-page .content { |
|
flex-grow: 1; |
|
flex-shrink: 0; |
|
flex-basis: auto; |
|
} |
|
.first-page footer { |
|
flex-grow: auto; |
|
flex-shrink: 0; |
|
flex-basis: auto; |
|
} |
|
.map header { |
|
font-size: smaller; |
|
} |
|
.map .content { |
|
flex-grow: 1; |
|
flex-shrink: 0; |
|
flex-basis: 0; |
|
} |
|
.pull-left { |
|
padding-left: 90mm; |
|
} |
|
.pull-top { |
|
padding-top: 50mm; |
|
} |
|
header .ornament { |
|
float: left; |
|
} |
|
footer .ornament { |
|
float: right; |
|
} |
|
/* Typography */ |
|
body { |
|
font-family: 'Gentium Basic'; |
|
font-size: 12pt; |
|
} |
|
strong { |
|
font-family: 'Gentium Basic'; |
|
font-weight: 700; |
|
} |
|
em { |
|
font-family: 'Gentium Basic'; |
|
font-variant: italic; |
|
} |
|
em strong { |
|
font-family: 'Gentium Basic'; |
|
font-style: italic; |
|
font-weight: 700; |
|
} |
|
.content { |
|
hyphens: auto; |
|
line-height: 1.618; |
|
text-align: justify; |
|
} |
|
.to { |
|
font-family: 'Gentium Basic'; |
|
font-weight: 700; |
|
} |
|
q { |
|
quotes: "\00AB\A0" "\A0\00BB" "\201C" "\201D" "\2018" "\2019"; |
|
} |
|
q:before { |
|
content: open-quote; |
|
} |
|
q:after { |
|
content: close-quote; |
|
} |
|
</style> |
|
</head> |
|
<body class="A4"> |
|
<section id="front" class="sheet padding-20mm first-page"> |
|
<header> |
|
<div id="sender" class="from"> |
|
<span id="author">Nom Prénom</span><br> |
|
Adresse 1<br> |
|
Adresse 2<br> |
|
Code Postal Localité<br> |
|
Pays |
|
</div> |
|
<div id="receiver" class="to"> |
|
Nom Prénom<br> |
|
Adresse 1<br> |
|
Adresse 2<br> |
|
Code Postal Localité<br> |
|
Pays |
|
</div> |
|
</header> |
|
<div class="content"> |
|
<p id="location-time" class="pull-left">Localité, le <span id="time">1er juillet 2016</span></p> |
|
<p>Appelation,</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
</div> |
|
</section> |
|
<section class="sheet padding-20mm map"> |
|
<div class="content"> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
</div> |
|
</section> |
|
<section class="sheet padding-20mm map"> |
|
<div class="content"> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum magna tortor, sed elementum nulla auctor et. Phasellus posuere mollis nibh, quis semper lacus auctor quis. Cras id lectus eget dolor aliquet placerat. Mauris varius commodo arcu, sit amet cursus nisl feugiat non. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ullamcorper varius lacinia. In varius lacus eget metus consectetur efficitur. In a accumsan nibh. Vestibulum feugiat ullamcorper risus nec semper. Nulla at condimentum sem. Ut auctor lorem non mauris interdum imperdiet.</p> |
|
<p id="signature" class="pull-left pull-top"></p> |
|
</div> |
|
</section> |
|
<script> |
|
var typography = true; |
|
var time = document.getElementById('time').textContent; |
|
var author = document.getElementById('author').textContent; |
|
var listPages = document.querySelectorAll('section.map'); |
|
for (var i = 0; i < listPages.length; i++) { |
|
var target = i + 2; |
|
var total = listPages.length + 1; |
|
var storeIds = 'map-' + target; |
|
listPages[i].setAttribute('id', storeIds); |
|
var header = document.createElement('header'); |
|
header.setAttribute('id', 'header-' + target); |
|
listPages[i].appendChild(header); |
|
var span = document.createElement('span'); |
|
span.setAttribute('class', 'ornament'); |
|
var ornament = '\u2026\u00A0\u002F\u00A0' + target; |
|
ornament += '\u00A0'; |
|
ornament += '\u2013'; |
|
ornament += '\u00A0'; |
|
ornament += 'De'; |
|
ornament += '\u00A0'; |
|
ornament += author.toUpperCase(); |
|
ornament += '\u00A0'; |
|
ornament += '\u2013'; |
|
ornament += '\u00A0'; |
|
ornament += time; |
|
var contentOrnament = document.createTextNode(ornament); |
|
span.appendChild(contentOrnament); |
|
header.appendChild(span); |
|
if (target < total) { |
|
var footer = document.createElement('footer'); |
|
footer.setAttribute('id', 'footer-' + target); |
|
listPages[i].appendChild(footer); |
|
var span = document.createElement('span'); |
|
span.setAttribute('class', 'ornament'); |
|
var ornament = '\u2026\u00A0\u002F\u00A0\u2026'; |
|
var contentOrnament = document.createTextNode(ornament); |
|
span.appendChild(contentOrnament); |
|
footer.appendChild(span); |
|
} |
|
var hasPages = true; |
|
} |
|
if (hasPages) { |
|
var target = 1; |
|
var footer = document.createElement('footer'); |
|
footer.setAttribute('id', 'footer-' + target); |
|
document.getElementById('front').appendChild(footer); |
|
var span = document.createElement('span'); |
|
span.setAttribute('class', 'ornament'); |
|
var ornament = '\u2026\u00A0\u002F\u00A0\u2026'; |
|
var contentOrnament = document.createTextNode(ornament); |
|
span.appendChild(contentOrnament); |
|
footer.appendChild(span); |
|
} |
|
if (document.getElementById('signature')) { |
|
var signature = author.toUpperCase(); |
|
var contentSignature = document.createTextNode(signature); |
|
document.getElementById('signature').appendChild(contentSignature); |
|
} |
|
if (typography) { |
|
/* Attention aux caractères réservés ! à savoir '. $ ^ { [ ( | ) * + ? \ ' */ |
|
document.body.innerHTML = document.body.innerHTML |
|
.replace(/'/g, '\u2019') |
|
.replace(/ : /g, '\u00A0\u003A\u0020') |
|
.replace(/ ; /g, '\u202F\u003B\u0020') |
|
.replace(/ !/g, '\u202F\u0021') |
|
.replace(/ %/g, '\u202F\u0025') |
|
.replace(/ ‰/g, '\u202F\u2030') |
|
.replace(/ \?/g, '\u202F\u003F') |
|
.replace(/\.\.\./g, '\u2026') |
|
; |
|
} |
|
</script> |
|
</body> |
|
</html> |