Move source code from github into gitea

master
Patrik Janosdeak 3 years ago
parent 8b06c84646
commit c0a8af44c0

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

File diff suppressed because one or more lines are too long

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<title>N.E.B.E.</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.scss" type="text/css" media="screen">
</head>
<body>
<main>
<!-- Tags <aside> will not get rendered -->
<!-- For development, toggle preview by pressing "d" -->
<aside class="background">
<img src="background.jpg" alt="">
<img src="preview.jpg" class="development" alt="">
</aside>
<!-- Bleed marks wrapper -->
<div class="marks">
<!-- Slots -->
<article data-slot="headline" contenteditable="true">Kitty financial services</article>
<article data-slot="discount" contenteditable="true">20</article>
<article data-image-slot="image"><img src="../assets/product.svg" alt=""></article>
<article data-slot="name">Maneki-neko cat</article>
<article data-slot="description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fuga, ipsum!</article>
<div class="price-old-wrapper">
<img src="../assets/flag-blue.svg" class="ribbon" alt="">
<article data-slot="price_old" contenteditable="true">89</article>
<img src="../assets/line-blue.svg" class="line" alt="">
</div>
<div class="price-wrapper">
<img src="../assets/flag-orange.svg" class="ribbon" alt="">
<article data-slot="price" contenteditable="true">79</article>
</div>
</div>
</main>
<script src="https://cdn.nebe.app/store/utils/dist/fit.min.js"></script>
<script src="../assets/scripts.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

File diff suppressed because one or more lines are too long

@ -0,0 +1,152 @@
$leftMarks: 0mm;
$rightMarks: 0mm;
$topMarks: 0mm;
$bottomMarks: 0mm;
// Rozměry tiskoviny bez ořezek (stejné jako název složky)
$width: 210mm;
$height: 297mm;
@import '../assets/main';
@import '../assets/fonts';
article[data-slot="headline"] {
position: absolute;
width: 170mm;
height: 2.6em;
top: 23mm;
left: 20mm;
color: #22a875;
font-family: CallingCodeBold, sans-serif;
font-size: 54pt;
line-height: 52pt;
overflow: hidden;
}
article[data-slot="name"] {
position: absolute;
width: 107mm;
top: 223mm;
left: 14mm;
font-family: CallingCodeBold, sans-serif;
font-size: 21pt;
color: #4f46de;
}
article[data-slot="description"] {
position: absolute;
width: 107mm;
top: 235mm;
left: 14mm;
font-family: DINProRegular, sans-serif;
font-size: 11.4pt;
line-height: 19pt;
color: #1c0c3e;
overflow: hidden;
height: 6.7em;
}
article[data-slot="price_old"] {
position: relative;
color: #ffffff;
padding-left: 12mm;
font-family: DINProBold, sans-serif;
font-size: 20pt;
line-height: 1;
text-align: right;
white-space: nowrap;
overflow: hidden;
strong {
font-size: 37pt;
}
}
.price-old-wrapper {
position: absolute;
top: 208mm;
right: 2mm;
height: 16mm;
padding: 1.2mm 4mm 0 0;
img {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: left center;
}
}
.price-wrapper {
position: absolute;
top: 224mm;
right: 2mm;
padding: 2.5mm 5mm;
height: 31mm;
img {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: left center;
}
}
article[data-slot="price"] {
position: relative;
padding-left: 8mm;
color: #ffffff;
font-family: DINProBold, sans-serif;
font-size: 38pt;
line-height: 1;
text-align: right;
white-space: nowrap;
overflow: hidden;
strong {
font-size: 72pt;
}
small {
font-size: 20pt;
}
}
article[data-slot="discount"] {
position: absolute;
top: 80mm;
left: 150mm;
height: 39mm;
width: 45mm;
color: #FFFFFF;
font-family: DINProBold, sans-serif;
font-size: 59pt;
font-weight: bold;
text-align: center;
letter-spacing: -1mm;
}
article[data-image-slot="image"] {
position: absolute;
top: 70mm;
left: 30mm;
width: 145mm;
height: 145mm;
text-align: center;
vertical-align: center;
img {
object-fit: contain;
object-position: center center;
width: 100%;
height: 100%;
}
}

@ -1,2 +1,6 @@
# print
# Ukázková šablona pro tiskové kreativy
Při vyměně souborů `preview.pdf` a `background.pdf` je vždy potřeba přegenerovat
PNG náhledy příkazem `nebe convert-pdf`
Před prvním použitím je ale potřeba zadat tyto příkazy: `brew install graphicsmagick` a `brew install ghostscript`

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 140.5 44.5" style="enable-background:new 0 0 140.5 44.5;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4F46DE;}
</style>
<polygon class="st0" points="111.7,0 0,0 13.3,22.2 0,44.5 111.7,44.5 140.5,44.5 140.5,0 "/>
</svg>

After

Width:  |  Height:  |  Size: 508 B

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 140.5 44.5" style="enable-background:new 0 0 140.5 44.5;" xml:space="preserve">
<style type="text/css">
.st0{fill:url(#SVGID_1_);}
</style>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="0" y1="22.245" x2="140.47" y2="22.245">
<stop offset="3.810000e-02" style="stop-color:#F4953C"/>
<stop offset="1" style="stop-color:#FD7F24"/>
</linearGradient>
<polygon class="st0" points="111.7,0 0,0 13.3,22.2 0,44.5 111.7,44.5 140.5,44.5 140.5,0 "/>
</svg>

After

Width:  |  Height:  |  Size: 745 B

@ -0,0 +1,14 @@
@font-face {
font-family: DINProRegular;
src: url(https://cdn.nebe.app/demo/fonts/DINPro-Regular.ttf) format("truetype");
}
@font-face {
font-family: DINProBold;
src: url(https://cdn.nebe.app/demo/fonts/DINPro-Bold.ttf) format("truetype");
}
@font-face {
font-family: CallingCodeBold;
src: url(https://cdn.nebe.app/demo/fonts/callingcode-bold.otf) format("opentype");
}

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 140.5 44.5" style="enable-background:new 0 0 140.5 44.5;" xml:space="preserve">
<style type="text/css">
.st0{fill:#3A1F64;}
</style>
<path class="st0" d="M125.5,44.5L3.5,0H0l1.2,2.1l124.3,45.1V44.5z"/>
</svg>

After

Width:  |  Height:  |  Size: 485 B

@ -0,0 +1,109 @@
/**
* Tento soubor není potřeba upravovat
*/
/**
* Základní tiskové styly
*/
$totalWidth: $width + $leftMarks + $rightMarks;
$totalHeight: $height + $topMarks + $bottomMarks;
@page {
margin: 0;
padding: 0;
size: $totalWidth $totalHeight;
marks: none;
bleed: 0;
}
html {
-webkit-print-color-adjust: exact;
}
* {
box-sizing: border-box;
text-rendering: geometricprecision !important;
}
body, html {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}
/**
* Hlavní oblast obsahující sloty
*/
main {
position: relative;
top: 0;
left: 0;
overflow: hidden;
font-family: Arial, sans-serif;
width: $totalWidth;
height: $totalHeight;
html.is-development & {
outline: 1px solid blue;
}
}
/**
* Netisknutelné elementy (pozadí/náhled)
*/
aside {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
img {
width: $totalWidth;
height: $totalHeight;
display: block;
position: absolute;
top: 0;
left: 0;
}
img.development {
display: none;
html.is-development & {
display: block;
}
}
}
/**
* Dynamický slot
*/
article {
&.is-highlighted {
background-color: rgba(75, 168, 46, .8);
}
html.is-development & {
outline: 1px solid red;
background-color: rgba(255, 0, 0, .2);
display: block !important;
}
}
/**
* Ořezová oblast
*/
.marks {
position: absolute;
top: $topMarks;
left: $leftMarks;
width: $width;
height: $height;
html.is-development & {
outline: 1px solid green;
display: block !important;
}
}

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 354.68 418.12" style="enable-background:new 0 0 354.68 418.12;" xml:space="preserve">
<style type="text/css">
.st0{display:none;}
.st1{display:inline;fill:url(#SVGID_1_);}
.st2{display:inline;}
.st3{fill:#F4953C;}
.st4{fill:#FFA227;}
.st5{fill:#10E8A3;}
.st6{fill:#FFE77B;}
.st7{fill:#3789CA;}
.st8{fill:#4F46DE;}
.st9{fill:#3A1F64;}
.st10{fill:#FFFFFF;}
.st11{fill:#2A6E93;}
.st12{fill:none;stroke:#3A1F64;stroke-width:4.309;stroke-miterlimit:10;}
.st13{fill:#1C0C3E;}
.st14{fill:#010001;}
.st15{fill:url(#SVGID_2_);}
.st16{display:inline;fill:url(#SVGID_3_);}
.st17{clip-path:url(#SVGID_5_);fill:url(#SVGID_6_);}
.st18{clip-path:url(#SVGID_5_);fill:#3A1F64;}
.st19{display:inline;fill:none;stroke:#FFFFFF;stroke-width:10;stroke-miterlimit:10;}
.st20{display:inline;fill:url(#SVGID_7_);}
.st21{fill:url(#SVGID_8_);}
.st22{display:inline;fill:url(#SVGID_9_);}
.st23{clip-path:url(#SVGID_11_);fill:url(#SVGID_12_);}
.st24{clip-path:url(#SVGID_11_);fill:#3A1F64;}
.st25{display:inline;fill:#1E58A5;}
.st26{fill:#F59743;}
.st27{clip-path:url(#SVGID_14_);}
.st28{fill:none;stroke:#FFFFFF;stroke-width:6.4446;stroke-miterlimit:10;}
.st29{fill:none;stroke:#F59743;stroke-width:2.1482;stroke-miterlimit:10;}
.st30{display:inline;fill:#494DC7;}
.st31{fill:url(#SVGID_15_);}
.st32{fill:url(#SVGID_16_);}
.st33{clip-path:url(#SVGID_18_);fill:url(#SVGID_19_);}
.st34{clip-path:url(#SVGID_18_);fill:#3A1F64;}
.st35{fill:none;stroke:#FFFFFF;stroke-width:10;stroke-miterlimit:10;}
.st36{fill:#3A1B62;}
.st37{fill:url(#SVGID_20_);}
.st38{fill:url(#SVGID_21_);}
.st39{fill:#1C093D;}
.st40{fill:#614499;}
.st41{fill:#FFD651;}
.st42{fill:#4E3CDB;}
.st43{fill:none;stroke:#10E8A3;stroke-width:3.552;stroke-linecap:round;stroke-miterlimit:10;}
</style>
<g id="v1" class="st0">
</g>
<g id="v2" class="st0">
</g>
<g id="v3">
<g>
<g>
<path class="st5" d="M23.04,321.02c35.86,46.19,91.91,75.93,154.92,75.93c63.01,0,119.06-29.74,154.93-75.93H23.04z"/>
</g>
<g>
<path class="st36" d="M176.16,72.58c3.43-14.83,10.07-29.14,19.51-42.07c4.52-6.2,11.54-12.74,20.32-12.44
c6.51,0.22,12.05,4.43,14.6,9.37c2.55,4.94,2.62,10.48,2.25,15.84c-1.01,14.47-5.36,28.79-12.15,42.16
c1.02-0.17-1.09,0.17-0.07,0C206.35,82.35,190.42,75.65,176.16,72.58z"/>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="8723.5283" y1="464.9397" x2="8751.1611" y2="464.9397" gradientTransform="matrix(-0.9953 -0.097 -0.097 0.9953 8949.0518 434.0964)">
<stop offset="0.0381" style="stop-color:#F59743"/>
<stop offset="1" style="stop-color:#FE802C"/>
</linearGradient>
<path style="fill:url(#SVGID_1_);" d="M192.94,59.5c2.46-7.99,6.46-15.56,11.75-22.22c2.53-3.19,6.14-6.48,10.39-5.9
c3.15,0.43,5.63,3.01,6.61,5.85c0.98,2.84,0.71,5.89,0.24,8.82c-1.27,7.91-3.99,15.6-8.01,22.64c0.5-0.04-0.54,0.04-0.04,0
C207.11,66.31,199.72,61.87,192.94,59.5z"/>
</g>
<g>
<path class="st36" d="M178.25,72.58c-3.43-14.83-10.07-29.14-19.51-42.07c-4.52-6.2-11.54-12.4-20.32-12.1
c-6.51,0.22-12.05,4.43-14.6,9.37c-2.55,4.94-2.28,10.14-1.91,15.5c1.01,14.47,5.02,28.79,11.81,42.16
c-1.02-0.17,1.09,0.17,0.07,0C148.06,82.35,164,75.65,178.25,72.58z"/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="133.3684" y1="49.9485" x2="161.0011" y2="49.9485">
<stop offset="0.0381" style="stop-color:#F59743"/>
<stop offset="1" style="stop-color:#FE802C"/>
</linearGradient>
<path class="st15" d="M161,61.45c-1.68-8.2-4.92-16.11-9.54-23.26c-2.21-3.43-5.48-7.04-9.77-6.88c-3.18,0.12-5.9,2.45-7.14,5.18
c-1.25,2.73-1.28,5.79-1.1,8.75c0.49,8,2.46,15.91,5.78,23.31c-0.5-0.09,0.53,0.09,0.04,0C146.23,66.86,154.03,63.15,161,61.45z"
/>
</g>
<g>
<path class="st36" d="M287.84,288.53c-4.93-10.81-12.94-20.55-22.84-26.96c0.65-23.57,0.82-47.59-6.34-70.04
c-7.3-22.91-23.64-44.27-46.61-51.36h-65.52c-22.97,7.09-39.31,28.45-46.61,51.36c-7.26,22.78-6.98,47.18-6.31,71.08
c-9.19,6.39-16.62,15.68-21.29,25.91c-8.09,17.75-9,37.96-7.42,57.4h230.36C296.83,326.49,295.93,306.28,287.84,288.53z"/>
<path class="st39" d="M102.64,339.73c0-12.32,9.99-22.31,22.31-22.31s22.31,9.99,22.31,22.31l-7.04,6.2h-31.87L102.64,339.73z"/>
<path class="st39" d="M159.11,339.73c0-12.32,9.99-22.31,22.31-22.31c12.32,0,22.31,9.99,22.31,22.31l-3.42,6.2h-40.29
L159.11,339.73z"/>
<path class="st39" d="M215.62,339.73c0-12.32,9.99-22.31,22.31-22.31c12.32,0,22.31,9.99,22.31,22.31l-0.51,6.2h-44.11V339.73z"
/>
<g>
<path class="st39" d="M222.21,230.79c-11.38,14.1-15.5,37.27-12.45,55.13c-6.37-0.31-12.81,2.73-16.61,7.85
c-3.8,5.12-4.86,12.16-2.72,18.17h104.15c-1.21-8.08-3.34-15.97-6.74-23.43c-4.93-10.81-12.94-20.55-22.84-26.96
c0.46-16.65,0.67-33.54-1.76-49.93C247.5,213.33,232.08,218.56,222.21,230.79z"/>
<path class="st39" d="M167.38,293.78c-3.8-5.12-10.24-8.16-16.61-7.85c3.05-17.86-1.07-41.03-12.45-55.13
c-10.27-12.73-26.56-17.88-42.95-19.34c-2.52,16.79-2.24,34.1-1.76,51.16c-9.19,6.39-16.62,15.68-21.29,25.91
c-3.4,7.45-5.52,15.34-6.74,23.43H170.1C172.24,305.94,171.18,298.9,167.38,293.78z"/>
</g>
<g>
<path class="st26" d="M196.3,312.07c0-6.32,2.06-13.88,2.06-13.88s2.06,7.55,2.06,13.88H196.3z"/>
<path class="st26" d="M206,312.07c0-6.32,2.06-13.88,2.06-13.88s2.06,7.55,2.06,13.88H206z"/>
<path class="st26" d="M215.7,312.07c0-6.32,2.06-13.88,2.06-13.88s2.06,7.55,2.06,13.88H215.7z"/>
</g>
<g>
<path class="st26" d="M140.96,312.07c0-6.32,2.06-13.88,2.06-13.88s2.06,7.55,2.06,13.88H140.96z"/>
<path class="st26" d="M150.66,312.07c0-6.32,2.06-13.88,2.06-13.88s2.06,7.55,2.06,13.88H150.66z"/>
<path class="st26" d="M160.36,312.07c0-6.32,2.06-13.88,2.06-13.88s2.06,7.55,2.06,13.88H160.36z"/>
</g>
<path class="st40" d="M71.8,345.93c0-12.32,9.99-22.31,22.31-22.31s22.31,9.99,22.31,22.31H71.8z"/>
<path class="st40" d="M129.24,345.93c0-12.32,9.99-22.31,22.31-22.31s22.31,9.99,22.31,22.31H129.24z"/>
<path class="st40" d="M186.97,345.93c0-12.32,9.99-22.31,22.31-22.31c12.32,0,22.31,9.99,22.31,22.31H186.97z"/>
<path class="st40" d="M244.11,345.93c0-12.32,9.99-22.31,22.31-22.31c12.32,0,22.31,9.99,22.31,22.31H244.11z"/>
<ellipse transform="matrix(0.7892 -0.6142 0.6142 0.7892 -133.8508 156.8021)" class="st41" cx="161.48" cy="273.37" rx="32.55" ry="41.9"/>
<path class="st36" d="M142.1,176.41l-12.06,11.26c-5.1,4.76-5.38,12.77-0.61,17.87l12.22,13.09c2.04,2.19,4.68,3.73,7.59,4.43h0
c2.91,0.71,5.54,2.25,7.59,4.43l6.05,6.48c4.6,4.93,4.34,12.66-0.59,17.26l-17.6,16.43c-4.93,4.6-12.66,4.34-17.26-0.59
l-6.05-6.48c-2.04-2.19-3.4-4.92-3.9-7.87l0,0c-0.5-2.95-1.86-5.69-3.9-7.87l-18.22-19.52c-5.64-6.04-9.04-13.36-10.23-20.94
c-2.44-15.42,4.8-30.77,18.01-39.09l27.37-17.26L142.1,176.41z"/>
<g>
<path class="st26" d="M144.55,267.78c-4.31-4.63-7.95-11.56-7.95-11.56s6.65,4.13,10.96,8.76L144.55,267.78z"/>
<path class="st26" d="M151.65,261.17c-4.31-4.63-7.95-11.56-7.95-11.56s6.65,4.13,10.96,8.76L151.65,261.17z"/>
<path class="st26" d="M158.75,254.56c-4.31-4.63-7.95-11.56-7.95-11.56s6.65,4.13,10.96,8.76L158.75,254.56z"/>
</g>
</g>
<g>
<path class="st36" d="M326.54,189.32L326.54,189.32c1.64-2.5,2.52-5.43,2.52-8.42v-15.09c0-7-5.67-12.67-12.67-12.67h-23.16
c-7,0-12.67,5.67-12.67,12.67v5.53c0,2.99,0.88,5.92,2.52,8.42v0c1.64,2.5,2.52,5.43,2.52,8.42v-23.94h-48.84v36.03h55.03h10.56
c11.28,0,21.09,1.83,23.74-9.13L326.54,189.32z"/>
<g>
<path class="st26" d="M316.15,153.14c0,6.32-2.06,30.13-2.06,30.13s-2.06-23.8-2.06-30.13H316.15z"/>
<path class="st26" d="M306.44,153.14c0,6.32-2.06,30.13-2.06,30.13s-2.06-23.8-2.06-30.13H306.44z"/>
<path class="st26" d="M296.74,153.14c0,6.32-2.06,30.13-2.06,30.13s-2.06-23.8-2.06-30.13H296.74z"/>
</g>
</g>
<g>
<path class="st5" d="M133.37,161.23c5.92,28.7,20.34,52.14,55.77,62.56c18.73-15.22,29.16-35.91,30.52-62.56L161,154.36
L133.37,161.23z"/>
<path class="st42" d="M219.65,161.23c0,16.6-86.28,16.6-86.28,0l0-46.1h86.28L219.65,161.23z"/>
<path class="st36" d="M227.55,101.86c0,28.11-4.68,44.11-50.9,44.11s-50.9-16-50.9-44.11s4.68-51.58,50.9-51.58
S227.55,73.75,227.55,101.86z"/>
<circle class="st26" cx="178.25" cy="173.09" r="18.73"/>
</g>
<g>
<path class="st5" d="M174.71,116.74l-7.25-11.75c-0.94-1.52,0.16-3.49,1.95-3.49h14.5c1.79,0,2.89,1.97,1.95,3.49l-7.25,11.75
C177.71,118.18,175.6,118.18,174.71,116.74z"/>
<g>
<path class="st43" d="M176.66,107.29v9.74c0,2.83-1.13,5.55-3.13,7.55v0c-2,2-4.72,3.13-7.55,3.13h-5.73"/>
<path class="st43" d="M176.66,107.29v9.74c0,2.83,1.13,5.55,3.13,7.55v0c2,2,4.72,3.13,7.55,3.13h5.73"/>
</g>
</g>
<g>
<path class="st10" d="M219.65,87.85c0,0-8.34,8.99-18.63,8.99s-18.63-8.99-18.63-8.99s8.34-8.99,18.63-8.99
S219.65,87.85,219.65,87.85z"/>
<circle class="st36" cx="201.02" cy="87.85" r="6.11"/>
</g>
<g>
<path class="st10" d="M172.77,87.85c0,0-8.34,8.99-18.63,8.99s-18.63-8.99-18.63-8.99s8.34-8.99,18.63-8.99
S172.77,87.85,172.77,87.85z"/>
<circle class="st36" cx="154.13" cy="87.85" r="6.11"/>
</g>
</g>
</g>
<g id="mask">
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.1 KiB

@ -0,0 +1,60 @@
document.addEventListener('keydown', (event) => {
if (event.key.toLowerCase() === 'd') {
document.querySelector('html').classList.toggle('is-development');
}
});
window.LOAD_IMAGE = src => {
return new Promise((resolve, reject) => {
let img = new Image();
img.onload = () => resolve(img);
img.onerror = (error) => reject(error);
img.src = src;
});
};
window.FILL = async (inputs) => {
window.clickTag = inputs.url;
const textSlots = ['headline', 'price', 'price_old', 'discount', 'name', 'description'];
textSlots.forEach((slotName) => {
const slotElement = document.querySelector(`article[data-slot="${slotName}"]`);
if (slotElement) {
slotElement.innerHTML = inputs[slotName];
}
});
const imageEl = document.querySelector(`article[data-image-slot="image"]`);
const hasImage = inputs.image && inputs.image.indexOf('http') === 0;
if (hasImage) {
await window.LOAD_IMAGE(inputs.image);
imageEl.innerHTML = `<img src="${inputs.image}" alt="">`;
imageEl.style.display = 'block';
} else {
console.warn(`Nebylo definován obrázek`);
}
// Reformat old price
const priceOldEl = document.querySelector(`article[data-slot="price_old"]`);
const priceOld = priceOldEl.textContent.replace(/\D/g, '');
priceOldEl.innerHTML= `<strong>${parseInt(priceOld).toLocaleString('cs')}</strong> €`;
// Reformat price
const priceEl = document.querySelector(`article[data-slot="price"]`);
const price = priceEl.textContent.replace(/\D/g, '');
priceEl.innerHTML = `<small>only</small> <strong>${parseInt(price).toLocaleString('cs')}</strong> €`;
// Reformat discount
const discountEl = document.querySelector(`article[data-slot="discount"]`);
const discount = discountEl.textContent.replace(/\D/g, '');
discountEl.textContent = `-${parseInt(discount).toLocaleString('cs')}`;
// Headline
await window.FIT(document.querySelector('article[data-slot="headline"]'));
// Name
await window.FIT(document.querySelector('article[data-slot="name"]'));
};

@ -0,0 +1,8 @@
{
"name": "Demo Print",
"format": "print",
"description": "Template for creating print campaigns",
"tags": [
"Demo"
]
}

@ -0,0 +1,34 @@
{
"price_old": {
"label": "Old price",
"value": "89",
"prefill": true
},
"price": {
"label": "Price",
"value": "79",
"prefill": true
},
"discount": {
"label": "Discount",
"value": "20",
"prefill": true
},
"headline": {
"label": "Headline",
"value": "Kitty financial services"
},
"name": {
"label": "Name",
"value": "Maneki-neko cat"
},
"description": {
"label": "Description",
"value": "Dolor at venenatis convallis lorem curae id curae inceptos interdum sociosqu lobortis maecenas lobortis cras consectetur dictum mi nascetur nulla torquent integer fusce."
},
"image": {
"label": "Product image",
"value": "https://cdn.nebe.app/demo/products/cat.svg",
"type": "image"
}
}
Loading…
Cancel
Save