Esempio n. 1
0
def animation_easing():
    value = Random.choice([
        "linear", "ease", "ease-in", "ease-out", "ease-in-out", "cubic-bezier"
    ])
    if value == "cubic-bezier":
        value += "({})".format(seq([Random.number() for _ in range(4)]))
    return value
Esempio n. 2
0
 def generate(self, _):
     c = Random.selector(3)
     if c == 0:
         self.value = Random.choice(["auto", "auto-start-reverse"])
     elif c == 1:
         self.value = dv.angle()
     else:
         self.value = Random.number()
Esempio n. 3
0
def length(relative=False):
    if (not relative) or Random.bool():
        if Random.bool():
            return "{}px".format(Random.integer())
        else:
            return "{}em".format(Random.number())
    else:
        return "{}{}".format(Random.integer(),
                             Random.choice(["vw", "vh", "vmin", "vmax"]))
Esempio n. 4
0
 def generate(self, _):
     num = Random.range(1, 2)
     self.value = cat([Random.number() for _ in range(num)])
Esempio n. 5
0
 def generate(self, _):
     if Random.bool():
         self.value = dv.length_percentage()
     else:
         self.value = Random.number()
Esempio n. 6
0
 def generate(self, _):
     self.value = seq([Random.number() for _ in range(4)])
Esempio n. 7
0
 def generate(self, _):
     self.value = Random.number()
Esempio n. 8
0
def scale():
    num = Random.range(1, 2)
    value = seq([Random.number() for _ in range(num)])
    return "scale({})".format(value)
Esempio n. 9
0
 def generate(self, _):
     self.value = "{{ delay: {}, direction: \"{}\", duration: {}, easing: \"{}\", endDelay: {}, fill: \"{}\", " \
                  "iterationStart: {}, iterations: {} }}".format(
         dv.clock_in_ms(), dv.animation_direction(), dv.clock_in_ms(), dv.animation_easing(),
         dv.clock_in_ms(), dv.animation_fill_mode(), Random.number(), Random.integer())
Esempio n. 10
0
def rotate3d():
    values = [Random.number() for _ in range(3)]
    values.append(angle())
    return "rotate3d({})".format(seq(values))
Esempio n. 11
0
def scale_z():
    return "scaleZ({})".format(Random.number())
Esempio n. 12
0
def scale3d():
    value = seq([Random.number() for _ in range(3)])
    return "scale3d({})".format(value)
Esempio n. 13
0
def matrix3d():
    value = seq([Random.number() for _ in range(16)])
    return "matrix3d({})".format(value)
Esempio n. 14
0
def scale_y():
    return "scaleY({})".format(Random.number())
Esempio n. 15
0
def scale_x():
    return "scaleX({})".format(Random.number())
Esempio n. 16
0
 def generate(self, _):
     if Random.bool():
         self.value = cat([Random.number() for _ in range(20)])
     else:
         self.value = Random.float01()
Esempio n. 17
0
 def generate(self, _):
     self.value = "{{top: {}, left: {}, behavior: \"{}\"}}".format(
         Random.number(), Random.number(), Random.choice(["auto",
                                                          "smooth"]))
Esempio n. 18
0
def number_percentage():
    if Random.bool():
        return Random.number()
    else:
        return percentage()
Esempio n. 19
0
 def generate(self, _):
     if Random.bool():
         self.value = "auto"
     else:
         self.value = Random.number()
Esempio n. 20
0
def number_optional_number(signed):
    if signed:
        return seq([Random.signed_number(), Random.signed_number()])
    else:
        return seq([Random.number(), Random.number()])