22.01.2022.1

This commit is contained in:
ульба 2022-01-22 11:17:42 +05:00
parent 9cf14ca4ac
commit bcef1536aa
106 changed files with 443 additions and 240 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.DS_Store .DS_Store
.idea .idea
*.pyc *.pyc
./MockupModule/generated/*
__pycache__ __pycache__

View File

@ -4,7 +4,7 @@ from importlib import import_module
from typing import List from typing import List
from PIL import Image from PIL import Image, ImageChops
from MockupModule import templates from MockupModule import templates
from MockupModule.utils import random_string from MockupModule.utils import random_string
@ -26,8 +26,7 @@ class MockupEngineer:
def screenshot_resize(self, screenshot: str, width: int, height: int) -> str: def screenshot_resize(self, screenshot: str, width: int, height: int) -> str:
name = '{}/screenshot{}.png'.format(generated_path, random_string(16)) name = '{}/screenshot{}.png'.format(generated_path, random_string(16))
img = Image.open(screenshot) img = Image.open(screenshot).resize((width, height), Image.ANTIALIAS)
img = img.resize((width, height), Image.ANTIALIAS)
img.save(name) img.save(name)
return name return name
@ -42,26 +41,23 @@ class MockupEngineer:
return dicted return dicted
def generate(self, template: templates.Template, screenshot: str, color: str = None, orientation: str = None): def generate(self, template: templates.Template, screenshot: str, color: str = None, orientation: str = None):
self.logger.info(
'Generating: {}'.format(
', '.join(
[': '.join([str(a).upper(), str(b)]) for a, b in template.__dict__.items()])))
if not orientation: if not orientation:
img = Image.open(screenshot) img = Image.open(screenshot)
width, height = img.size width, height = img.size
orientation = 'portrait' if height > width or height == width else 'landscape' orientation = 'portrait' if height > width or height == width else 'landscape'
if orientation == 'portrait': if orientation == 'portrait':
screen_width = template.portrait_resolution.width screen_width = template.__portrait_width__
screen_height = template.portrait_resolution.height screen_height = template.__portrait_height__
width_coordinate = template.__portrait_width__ screen_x = template.__portrait_x__
height_coordinate = template.__portrait_height__ screen_y = template.__portrait_y__
screen_mask = template.__portrait_mask__ if template.__use_mask__ else None
else: else:
screen_width = template.landscape_resolution.width screen_width = template.__landscape_width__
screen_height = template.landscape_resolution.height screen_height = template.__landscape_height__
width_coordinate = template.__landscape_width__ screen_x = template.__landscape_x__
height_coordinate = template.__landscape_height__ screen_y = template.__landscape_y__
screen_mask = template.__landscape_mask__ if template.__use_mask__ else None
screenshot = self.screenshot_resize(screenshot, screen_width, screen_height) screenshot = self.screenshot_resize(screenshot, screen_width, screen_height)
@ -79,9 +75,12 @@ class MockupEngineer:
template_img = Image.open(template_path) template_img = Image.open(template_path)
mask_img = Image.new('RGBA', template_img.size, (0, 0, 0, 0)) mask_img = Image.new('RGBA', template_img.size, (0, 0, 0, 0))
screenshot_img = Image.open(screenshot) screenshot_img = Image.open(screenshot)
mask_img.paste(screenshot_img, (width_coordinate, height_coordinate)) mask_img.paste(screenshot_img, (screen_x, screen_y))
mask_img.paste(template_img, (0, 0), template_img) mask_img.paste(template_img, (0, 0), template_img)
if screen_mask:
screen_mask = Image.open(screen_mask).convert('L')
mask_img.putalpha(screen_mask)
mask_img.save(name) mask_img.save(name)
return name return name

View File

@ -5,9 +5,10 @@ from MockupModule import MockupEngineer
def main(): def main():
mockup = MockupEngineer() mockup = MockupEngineer()
i = 0 i = 0
for template in mockup.templates: for template in mockup.templates:
print('[{}] {} {} ({})'.format(i, template.manufacturer, template.name, template.year)) print('[{}] {} {} [{}] ({})'.format(i, template.manufacturer, template.name, template.resolution, template.year))
i += 1 i += 1
template = mockup.templates[int(input('Choose device: '))] template = mockup.templates[int(input('Choose device: '))]
print('- - - - - - - - - -') print('- - - - - - - - - -')

View File

@ -4,7 +4,6 @@ from dataclasses import dataclass, field
from pathlib import Path from pathlib import Path
from typing import List from typing import List
templates_path = os.path.join("/".join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1]), 'templates') templates_path = os.path.join("/".join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1]), 'templates')
@ -18,11 +17,13 @@ ALL_TEMPLATES = sorted(__list_all_templates())
__all__ = ALL_TEMPLATES + ["ALL_TEMPLATES"] __all__ = ALL_TEMPLATES + ["ALL_TEMPLATES"]
@dataclass(frozen=False) def default_factory_none() -> None:
class TemplateResolution: return None
width: int = field(default_factory=int)
height: int = field(default_factory=int)
def default_factory_false() -> bool:
return False
@dataclass(frozen=False) @dataclass(frozen=False)
class TemplateColor: class TemplateColor:
@ -37,13 +38,40 @@ class Template:
name: str = field(default_factory=str) name: str = field(default_factory=str)
type: str = field(default_factory=str) type: str = field(default_factory=str)
year: int = field(default_factory=int) year: int = field(default_factory=int)
resolution: str = field(default_factory=str)
example_path: str = field(default_factory=str) example_path: str = field(default_factory=str)
portrait_resolution: TemplateResolution = field(default_factory=TemplateResolution)
landscape_resolution: TemplateResolution = field(default_factory=TemplateResolution)
colors: List[TemplateColor] = field(default_factory=list) colors: List[TemplateColor] = field(default_factory=list)
__template_path__: str = field(default_factory=str)
__colors__: dict = field(default_factory=dict)
__use_mask__: bool = field(default_factory=default_factory_false)
__portrait_width__: int = field(default_factory=int) __portrait_width__: int = field(default_factory=int)
__portrait_height__: int = field(default_factory=int) __portrait_height__: int = field(default_factory=int)
__portrait_x__: int = field(default_factory=int)
__portrait_y__: int = field(default_factory=int)
__portrait_mask__: str = field(default_factory=default_factory_none)
__landscape_width__: int = field(default_factory=int) __landscape_width__: int = field(default_factory=int)
__landscape_height__: int = field(default_factory=int) __landscape_height__: int = field(default_factory=int)
__landscape_x__: int = field(default_factory=int)
__landscape_y__: int = field(default_factory=int)
__landscape_mask__: str = field(default_factory=default_factory_none)
def __post_init__(self):
getattr(self, '__device_init__')()
self.example_path = '{}/{}/example.png'.format(templates_path, self.__template_path__)
self.colors = [
TemplateColor(
color=color,
portrait_path='{}/{}/{}/portrait.png'.format(templates_path, self.__template_path__, color_path),
landscape_path='{}/{}/{}/landscape.png'.format(templates_path, self.__template_path__, color_path),
) for color, color_path in self.__colors__.items()]
if self.__use_mask__:
self.__portrait_mask__ = '{}/{}/portrait-mask.png'.format(templates_path, self.__template_path__)
self.__landscape_mask__ = '{}/{}/landscape-mask.png'.format(templates_path, self.__template_path__)

View File

@ -0,0 +1,29 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Samsung'
self.name = 'Galaxy S20'
self.type = 'phone'
self.year = 2020
self.resolution = '{width} x {height}'.format(width=1440, height=3200)
self.__template_path__ = 'galaxys20'
self.__colors__ = {"Cloud Blue": 'blue',
"Cosmic Grey": 'grey',
"Pink": 'pink'}
self.__use_mask__ = True
self.__portrait_width__ = 1440
self.__portrait_height__ = 3200
self.__portrait_x__ = 200
self.__portrait_y__ = 200
self.__landscape_width__ = 3200
self.__landscape_height__ = 1440
self.__landscape_x__ = 200
self.__landscape_y__ = 200

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -0,0 +1,28 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Samsung'
self.name = 'Galaxy S20 Ultra'
self.type = 'phone'
self.year = 2020
self.resolution = '{width} x {height}'.format(width=1440, height=3200)
self.__template_path__ = 'galaxys20'
self.__colors__ = {"Cosmic Black": 'black',
"Cosmic Grey": 'grey'}
self.__use_mask__ = True
self.__portrait_width__ = 1440
self.__portrait_height__ = 3200
self.__portrait_x__ = 200
self.__portrait_y__ = 200
self.__landscape_width__ = 3200
self.__landscape_height__ = 1440
self.__landscape_x__ = 200
self.__landscape_y__ = 200

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View File

@ -0,0 +1,28 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Apple'
self.name = 'iPad 9'
self.type = 'tablet'
self.year = 2021
self.resolution = '{width} x {height}'.format(width=2160, height=1620)
self.__template_path__ = 'ipad9'
self.__colors__ = {"Gold": 'gold',
"Silver": 'silver',
"Space Gray": 'spacegray'}
self.__portrait_width__ = 1620
self.__portrait_height__ = 2160
self.__portrait_x__ = 150
self.__portrait_y__ = 275
self.__landscape_width__ = 2160
self.__landscape_height__ = 1620
self.__landscape_x__ = 275
self.__landscape_y__ = 150

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

View File

@ -0,0 +1,30 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Apple'
self.name = 'iPad Air 4'
self.type = 'tablet'
self.year = 2020
self.resolution = '{width} x {height}'.format(width=2360, height=1640)
self.__template_path__ = 'ipadair4'
self.__colors__ = {"Green": 'green',
"Rose Gold": 'rosegold',
"Silver": 'silver',
"Sky Blue": 'skyblue',
"Space Gray": 'spacegray'}
self.__portrait_width__ = 1640
self.__portrait_height__ = 2360
self.__portrait_x__ = 150
self.__portrait_y__ = 150
self.__landscape_width__ = 2360
self.__landscape_height__ = 1640
self.__landscape_x__ = 150
self.__landscape_y__ = 150

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

View File

@ -1,49 +1,30 @@
from dataclasses import dataclass from dataclasses import dataclass
from MockupModule.templates import templates_path, TemplateResolution, TemplateColor, Template from MockupModule.templates import Template
@dataclass @dataclass
class Device(Template): class Device(Template):
def __post_init__(self): def __device_init__(self):
self.manufacturer = 'Apple' self.manufacturer = 'Apple'
self.name = 'iPhone 12' self.name = 'iPhone 12'
self.type = 'phone' self.type = 'phone'
self.year = 2020 self.year = 2020
self.example_path = templates_path + '/iphone12/example.png' self.resolution = '{width} x {height}'.format(width=1170, height=2532)
self.portrait_resolution = TemplateResolution(width=1170, height=2532)
self.landscape_resolution = TemplateResolution(width=2532, height=1170)
self.colors = [ self.__template_path__ = 'iphone12'
TemplateColor( self.__colors__ = {"Black": 'black',
color='Black', "Blue": 'blue',
portrait_path=templates_path + '/iphone12/black/portrait.png', "Green": 'green',
landscape_path=templates_path + '/iphone12/black/landscape.png', "PRODUCT RED": 'red',
), "White": 'white'}
TemplateColor(
color='Blue',
portrait_path=templates_path + '/iphone12/blue/portrait.png',
landscape_path=templates_path + '/iphone12/blue/landscape.png',
),
TemplateColor(
color='Green',
portrait_path=templates_path + '/iphone12/green/portrait.png',
landscape_path=templates_path + '/iphone12/green/landscape.png',
),
TemplateColor(
color='PRODUCT RED',
portrait_path=templates_path + '/iphone12/red/portrait.png',
landscape_path=templates_path + '/iphone12/red/landscape.png',
),
TemplateColor(
color='White',
portrait_path=templates_path + '/iphone12/white/portrait.png',
landscape_path=templates_path + '/iphone12/white/landscape.png',
)
]
self.__portrait_width__ = 180 self.__portrait_width__ = 1170
self.__portrait_height__ = 180 self.__portrait_height__ = 2532
self.__landscape_width__ = 180 self.__portrait_x__ = 180
self.__landscape_height__ = 180 self.__portrait_y__ = 180
self.__landscape_width__ = 2532
self.__landscape_height__ = 1170
self.__landscape_x__ = 180
self.__landscape_y__ = 180

View File

@ -1,49 +1,30 @@
from dataclasses import dataclass from dataclasses import dataclass
from MockupModule.templates import templates_path, TemplateResolution, TemplateColor, Template from MockupModule.templates import Template
@dataclass @dataclass
class Device(Template): class Device(Template):
def __post_init__(self): def __device_init__(self):
self.manufacturer = 'Apple' self.manufacturer = 'Apple'
self.name = 'iPhone 12 Mini' self.name = 'iPhone 12 Mini'
self.type = 'phone' self.type = 'phone'
self.year = 2020 self.year = 2020
self.example_path = templates_path + '/iphone12mini/example.png' self.resolution = '{width} x {height}'.format(width=1080, height=2340)
self.portrait_resolution = TemplateResolution(width=1080, height=2340)
self.landscape_resolution = TemplateResolution(width=2340, height=1080)
self.colors = [ self.__template_path__ = 'iphone12mini'
TemplateColor( self.__colors__ = {"Black": 'black',
color='Black', "Blue": 'blue',
portrait_path=templates_path + '/iphone12mini/black/portrait.png', "Green": 'green',
landscape_path=templates_path + '/iphone12mini/black/landscape.png', "PRODUCT RED": 'red',
), "White": 'white'}
TemplateColor(
color='Blue',
portrait_path=templates_path + '/iphone12mini/blue/portrait.png',
landscape_path=templates_path + '/iphone12mini/blue/landscape.png',
),
TemplateColor(
color='Green',
portrait_path=templates_path + '/iphone12mini/green/portrait.png',
landscape_path=templates_path + '/iphone12mini/green/landscape.png',
),
TemplateColor(
color='PRODUCT RED',
portrait_path=templates_path + '/iphone12mini/red/portrait.png',
landscape_path=templates_path + '/iphone12mini/red/landscape.png',
),
TemplateColor(
color='White',
portrait_path=templates_path + '/iphone12mini/white/portrait.png',
landscape_path=templates_path + '/iphone12mini/white/landscape.png',
)
]
self.__portrait_width__ = 160 self.__portrait_width__ = 1080
self.__portrait_height__ = 160 self.__portrait_height__ = 2340
self.__landscape_width__ = 180 self.__portrait_x__ = 160
self.__landscape_height__ = 180 self.__portrait_y__ = 160
self.__landscape_width__ = 2340
self.__landscape_height__ = 1080
self.__landscape_x__ = 160
self.__landscape_y__ = 160

View File

@ -1,44 +1,29 @@
from dataclasses import dataclass from dataclasses import dataclass
from MockupModule.templates import templates_path, TemplateResolution, TemplateColor, Template from MockupModule.templates import Template
@dataclass @dataclass
class Device(Template): class Device(Template):
def __post_init__(self): def __device_init__(self):
self.manufacturer = 'Apple' self.manufacturer = 'Apple'
self.name = 'iPhone 12 Pro' self.name = 'iPhone 12 Pro'
self.type = 'phone' self.type = 'phone'
self.year = 2020 self.year = 2020
self.example_path = templates_path + '/iphone12pro/example.png' self.resolution = '{width} x {height}'.format(width=1170, height=2532)
self.portrait_resolution = TemplateResolution(width=1170, height=2532)
self.landscape_resolution = TemplateResolution(width=2532, height=1170)
self.colors = [ self.__template_path__ = 'iphone12pro'
TemplateColor( self.__colors__ = {"Gold": 'gold',
color='Gold', "Graphite": 'graphite',
portrait_path=templates_path + '/iphone12pro/gold/portrait.png', "Pacific Blue": 'pacificblue',
landscape_path=templates_path + '/iphone12pro/gold/landscape.png', "Silver": 'silver'}
),
TemplateColor(
color='Graphite',
portrait_path=templates_path + '/iphone12pro/graphite/portrait.png',
landscape_path=templates_path + '/iphone12pro/graphite/landscape.png',
),
TemplateColor(
color='Pacific Blue',
portrait_path=templates_path + '/iphone12pro/pacificblue/portrait.png',
landscape_path=templates_path + '/iphone12pro/pacificblue/landscape.png',
),
TemplateColor(
color='Silver',
portrait_path=templates_path + '/iphone12pro/silver/portrait.png',
landscape_path=templates_path + '/iphone12pro/silver/landscape.png',
)
]
self.__portrait_width__ = 180 self.__portrait_width__ = 1170
self.__portrait_height__ = 180 self.__portrait_height__ = 2532
self.__landscape_width__ = 180 self.__portrait_x__ = 180
self.__landscape_height__ = 180 self.__portrait_y__ = 180
self.__landscape_width__ = 2532
self.__landscape_height__ = 1170
self.__landscape_x__ = 180
self.__landscape_y__ = 180

View File

@ -1,44 +1,29 @@
from dataclasses import dataclass from dataclasses import dataclass
from MockupModule.templates import templates_path, TemplateResolution, TemplateColor, Template from MockupModule.templates import Template
@dataclass @dataclass
class Device(Template): class Device(Template):
def __post_init__(self): def __device_init__(self):
self.manufacturer = 'Apple' self.manufacturer = 'Apple'
self.name = 'iPhone 12 Pro Max' self.name = 'iPhone 12 Pro Max'
self.type = 'phone' self.type = 'phone'
self.year = 2020 self.year = 2020
self.example_path = templates_path + '/iphone12promax/example.png' self.resolution = '{width} x {height}'.format(width=1284, height=2778)
self.portrait_resolution = TemplateResolution(width=1284, height=2778)
self.landscape_resolution = TemplateResolution(width=2778, height=1284)
self.colors = [ self.__template_path__ = 'iphone12promax'
TemplateColor( self.__colors__ = {"Gold": 'gold',
color='Gold', "Graphite": 'graphite',
portrait_path=templates_path + '/iphone12promax/gold/portrait.png', "Pacific Blue": 'pacificblue',
landscape_path=templates_path + '/iphone12promax/gold/landscape.png', "Silver": 'silver'}
),
TemplateColor(
color='Graphite',
portrait_path=templates_path + '/iphone12promax/graphite/portrait.png',
landscape_path=templates_path + '/iphone12promax/graphite/landscape.png',
),
TemplateColor(
color='Pacific Blue',
portrait_path=templates_path + '/iphone12promax/pacificblue/portrait.png',
landscape_path=templates_path + '/iphone12promax/pacificblue/landscape.png',
),
TemplateColor(
color='Silver',
portrait_path=templates_path + '/iphone12promax/silver/portrait.png',
landscape_path=templates_path + '/iphone12promax/silver/landscape.png',
)
]
self.__portrait_width__ = 200 self.__portrait_width__ = 1284
self.__portrait_height__ = 200 self.__portrait_height__ = 2778
self.__landscape_width__ = 200 self.__portrait_x__ = 200
self.__landscape_height__ = 200 self.__portrait_y__ = 200
self.__landscape_width__ = 2778
self.__landscape_height__ = 1284
self.__landscape_x__ = 200
self.__landscape_y__ = 200

View File

@ -1,39 +1,29 @@
from dataclasses import dataclass from dataclasses import dataclass
from MockupModule.templates import templates_path, TemplateResolution, TemplateColor, Template from MockupModule.templates import Template
@dataclass @dataclass
class Device(Template): class Device(Template):
def __post_init__(self): def __device_init__(self):
self.manufacturer = 'Apple' self.manufacturer = 'Apple'
self.name = 'iPhone SE' self.name = 'iPhone SE'
self.type = 'phone' self.type = 'phone'
self.year = 2020 self.year = 2020
self.example_path = templates_path + '/iphonese2020/example.png' self.resolution = '{width} x {height}'.format(width=750, height=1334)
self.portrait_resolution = TemplateResolution(width=750, height=1334)
self.landscape_resolution = TemplateResolution(width=1334, height=750)
self.colors = [ self.__template_path__ = 'iphonese2020'
TemplateColor( self.__colors__ = {"Black": 'black',
color='Black', "PRODUCT RED": 'red',
portrait_path=templates_path + '/iphonese2020/black/portrait.png', "White": 'white'}
landscape_path=templates_path + '/iphonese2020/black/landscape.png',
),
TemplateColor(
color='PRODUCT RED',
portrait_path=templates_path + '/iphonese2020/red/portrait.png',
landscape_path=templates_path + '/iphonese2020/red/landscape.png',
),
TemplateColor(
color='White',
portrait_path=templates_path + '/iphonese2020/white/portrait.png',
landscape_path=templates_path + '/iphonese2020/white/landscape.png',
)
]
self.__portrait_width__ = 150 self.__portrait_width__ = 750
self.__portrait_height__ = 300 self.__portrait_height__ = 1334
self.__landscape_width__ = 300 self.__portrait_x__ = 150
self.__landscape_height__ = 140 self.__portrait_y__ = 300
self.__landscape_width__ = 1334
self.__landscape_height__ = 750
self.__landscape_x__ = 300
self.__landscape_y__ = 150

View File

@ -1,54 +1,31 @@
from dataclasses import dataclass from dataclasses import dataclass
from MockupModule.templates import templates_path, TemplateResolution, TemplateColor, Template from MockupModule.templates import Template
@dataclass @dataclass
class Device(Template): class Device(Template):
def __post_init__(self): def __device_init__(self):
self.manufacturer = 'Apple' self.manufacturer = 'Apple'
self.name = 'iPhone Xr' self.name = 'iPhone Xr'
self.type = 'phone' self.type = 'phone'
self.year = 2018 self.year = 2018
self.example_path = templates_path + '/iphonexr/example.png' self.resolution = '{width} x {height}'.format(width=828, height=1792)
self.portrait_resolution = TemplateResolution(width=828, height=1792)
self.landscape_resolution = TemplateResolution(width=1792, height=828)
self.colors = [ self.__template_path__ = 'iphonexr'
TemplateColor( self.__colors__ = {"Blue": 'blue',
color='Blue', "Coral": 'coral',
portrait_path=templates_path + '/iphonexr/blue/portrait.png', "PRODUCT RED": 'red',
landscape_path=templates_path + '/iphonexr/blue/landscape.png', "Silver": 'silver',
), "Space Gray": 'spacegray',
TemplateColor( "Yellow": 'yellow'}
color='Coral',
portrait_path=templates_path + '/iphonexr/coral/portrait.png',
landscape_path=templates_path + '/iphonexr/coral/landscape.png',
),
TemplateColor(
color='PRODUCT RED',
portrait_path=templates_path + '/iphonexr/red/portrait.png',
landscape_path=templates_path + '/iphonexr/red/landscape.png',
),
TemplateColor(
color='Silver',
portrait_path=templates_path + '/iphonexr/silver/portrait.png',
landscape_path=templates_path + '/iphonexr/silver/landscape.png',
),
TemplateColor(
color='Space Gray',
portrait_path=templates_path + '/iphonexr/spacegray/portrait.png',
landscape_path=templates_path + '/iphonexr/spacegray/landscape.png',
),
TemplateColor(
color='Yellow',
portrait_path=templates_path + '/iphonexr/yellow/portrait.png',
landscape_path=templates_path + '/iphonexr/yellow/landscape.png',
)
]
self.__portrait_width__ = 110 self.__portrait_width__ = 828
self.__portrait_height__ = 110 self.__portrait_height__ = 1792
self.__landscape_width__ = 110 self.__portrait_x__ = 110
self.__landscape_height__ = 110 self.__portrait_y__ = 110
self.__landscape_width__ = 1792
self.__landscape_height__ = 828
self.__landscape_x__ = 110
self.__landscape_y__ = 110

View File

@ -0,0 +1,27 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Apple'
self.name = 'MacBook 12"'
self.type = 'pc'
self.year = 2016
self.resolution = '{width} x {height}'.format(width=2304, height=1440)
self.__template_path__ = 'macbook122016'
self.__colors__ = {"Space Gray": 'spacegray',
"Gold": 'gold'}
self.__portrait_width__ = 1430
self.__portrait_height__ = 894
self.__portrait_x__ = 286
self.__portrait_y__ = 180
self.__landscape_width__ = 1430
self.__landscape_height__ = 894
self.__landscape_x__ = 286
self.__landscape_y__ = 180

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View File

@ -0,0 +1,28 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Google'
self.name = 'Pixel'
self.type = 'phone'
self.year = 2016
self.resolution = '{width} x {height}'.format(width=1080, height=1920)
self.__template_path__ = 'pixel'
self.__colors__ = {"Quite Black": 'black',
"Really Blue": 'blue',
"Very Silver": 'silver'}
self.__portrait_width__ = 932
self.__portrait_height__ = 1656
self.__portrait_x__ = 153
self.__portrait_y__ = 317
self.__landscape_width__ = 1656
self.__landscape_height__ = 932
self.__landscape_x__ = 346
self.__landscape_y__ = 149

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

View File

@ -0,0 +1,28 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Google'
self.name = 'Pixel 4'
self.type = 'phone'
self.year = 2019
self.resolution = '{width} x {height}'.format(width=1080, height=2280)
self.__template_path__ = 'pixel4'
self.__colors__ = {"Just Black": 'black',
"Clearly White": 'white',
"Oh So Orange": 'orange'}
self.__portrait_width__ = 1080
self.__portrait_height__ = 2280
self.__portrait_x__ = 100
self.__portrait_y__ = 200
self.__landscape_width__ = 2280
self.__landscape_height__ = 1080
self.__landscape_x__ = 200
self.__landscape_y__ = 100

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -0,0 +1,28 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Google'
self.name = 'Pixel 4 XL'
self.type = 'phone'
self.year = 2019
self.resolution = '{width} x {height}'.format(width=1440, height=3040)
self.__template_path__ = 'pixel4xl'
self.__colors__ = {"Just Black": 'black',
"Clearly White": 'white',
"Oh So Orange": 'orange'}
self.__portrait_width__ = 1440
self.__portrait_height__ = 3040
self.__portrait_x__ = 100
self.__portrait_y__ = 250
self.__landscape_width__ = 3040
self.__landscape_height__ = 1440
self.__landscape_x__ = 250
self.__landscape_y__ = 100

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

View File

@ -0,0 +1,27 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Google'
self.name = 'Pixel 5'
self.type = 'phone'
self.year = 2020
self.resolution = '{width} x {height}'.format(width=1080, height=2340)
self.__template_path__ = 'pixel5'
self.__colors__ = {"Just Black": 'black',
"Sorta Sage": 'sortasage'}
self.__portrait_width__ = 1080
self.__portrait_height__ = 2340
self.__portrait_x__ = 200
self.__portrait_y__ = 200
self.__landscape_width__ = 2340
self.__landscape_height__ = 1080
self.__landscape_x__ = 200
self.__landscape_y__ = 200

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

View File

@ -0,0 +1,35 @@
from dataclasses import dataclass
from MockupModule.templates import Template
@dataclass
class Device(Template):
def __device_init__(self):
self.manufacturer = 'Apple'
self.name = 'Watch Series 6 44mm'
self.type = 'wear'
self.year = 2020
self.resolution = '{width} x {height}'.format(width=368, height=448)
self.__template_path__ = 'watchseries644mm'
self.__colors__ = {"Aluminum Case - Blue": 'blue_aluminum',
"Aluminum Case - Gold": 'gold_aluminum',
"Aluminum Case - Space Gray": 'spacegray_aluminum',
"Aluminum Case - Silver": 'silver_aluminum',
"Aluminum Case - PRODUCT RED": 'red_aluminum',
"Titanium Case - Light": 'light_titanium',
"Titanium Case - Dark": 'dark_titanium',
"Stainless Steel Case - Gold": 'gold_steel',
"Stainless Steel Case - Graphite": 'graphite_steel',
"Stainless Steel Case - Silver": 'silver_steel'}
self.__portrait_width__ = 368
self.__portrait_height__ = 448
self.__portrait_x__ = 129
self.__portrait_y__ = 241
self.__landscape_width__ = 448
self.__landscape_height__ = 368
self.__landscape_x__ = 241
self.__landscape_y__ = 129

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Some files were not shown because too many files have changed in this diff Show More