Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AlekSIS/libs/django-iconify
1 result
Show changes
Commits on Source (2)
......@@ -8,34 +8,41 @@ import json
class IconifyOptional:
left: int = 0
top: int = 0
width: int = 16
height: int = 16
left: Optional[int] = None
top: Optional[int] = None
width: Optional[int] = None
height: Optional[int] = None
rotate: int = 0
h_flip: bool = False
v_flip: bool = False
rotate: Optional[int] = None
h_flip: Optional[bool] = None
v_flip: Optional[bool] = None
def _as_dict_optional(self) -> dict:
return {
"left": self.left,
"top": self.top,
"width": self.width,
"height": self.height,
"rotate": self.rotate,
"hFlip": self.h_flip,
"vFlip": self.v_flip,
}
res = {}
if self.left is not None:
res["left"] = self.left
if self.top is not None:
res["top"] = self.top
if self.width is not None:
res["width"] = self.width
if self.height is not None:
res["height"] = self.height
if self.rotate is not None:
res["rotate"] = self.rotate
if self.h_flip is not None:
res["hFlip"] = self.h_flip
if self.v_flip is not None:
res["vFlip"] = self.v_flip
return res
def _from_dict_optional(self, src: dict) -> None:
self.left = src.get("left", None) or self.left
self.top = src.get("top", None) or self.top
self.width = src.get("width", None) or self.width
self.height = src.get("height", None) or self.height
self.rotate = src.get("rotate", None) or self.rotate
self.h_flip = src.get("hFlip", None) or self.h_flip
self.v_flip = src.get("vFlip", None) or self.v_flip
self.left = src.get("left", None)
self.top = src.get("top", None)
self.width = src.get("width", None)
self.height = src.get("height", None)
self.rotate = src.get("rotate", None)
self.h_flip = src.get("hFlip", None)
self.v_flip = src.get("vFlip", None)
class IconifyIcon(IconifyOptional):
......
......@@ -6,6 +6,8 @@
<script type="text/javascript" src="https://code.iconify.design/1/1.0.6/iconify.min.js"></script>
</head>
<body>
<span class="iconify" data-icon="fa:home" style="color:#ff0000"></span>
<span class="iconify" data-icon="mdi:account" style="color:#00ff00"></span>
<span class="iconify" data-icon="mdi:account-cash" style="color:#0000ff;font-size:48pt"></span>
<span class="iconify" data-icon="mdi:seatbelt" style="color:#ff0000;font-size:72pt"></span>
</body>
</head>