Draw lines stylus function

In this example below you will see how to do a Draw lines stylus function with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by dictor, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright dictor ©
  • HTML
  • CSS
  • JavaScript
    .container
  h1.title.underline Привет, мир!

/*Downloaded from https://www.codeseek.co/dictor/draw-lines-stylus-function-QvPvop */
    .container
  margin 18px
  font-family sans-serif  
.title
  font-size 24px
  line-height 1.5
  
drawLines(width, colors)
  currentWidth = 0
  finalWord = ''
  for color in colors
    finalWord += color (currentWidth px) ', '
    currentWidth += width
    finalWord += color (currentWidth px) ', '
  finalWord += 'transparent' (currentWidth px)
  unquote(finalWord)
  
.underline
  background linear-gradient(to top, drawLines(2, #ccc #aaa))



/*Downloaded from https://www.codeseek.co/dictor/draw-lines-stylus-function-QvPvop */
    

Comments