Exemple #1
0
 def create_folder(self, name: str) -> str:
     # layout folders as columns
     xpos = 40 + (Math.round(self.count / 4)) * 100
     ypos = 60 + (((self.count % 3)) * 100)
     s = f"left:{xpos}px;top:{ypos}px;"
     # print(name, xpos, ypos)
     return str(
         div(
             _class="folder", _style=s, **{"_data-path": self.dir + "/" + name}
         ).html(
             div(span("📁"), _style="font-size:70px;", _class="icon"),
             span(name, _style="color: white;"),
         )
     )
Exemple #2
0
 def roll_dice():
     return Math.round(Math.random() * 6)