Guest User

Untitled

a guest
Nov 18th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <div id="exercise">
  2. <!-- 1) Start the Effect with the Button. The Effect should alternate the "highlight" or "shrink" class on each new setInterval tick (attach respective class to the div with id "effect" below) -->
  3. <div>
  4. <button @click="startEffect">Start Effect</button>
  5. <div id="effect" :class="effect"></div>
  6. </div>
  7. <!-- 2) Create a couple of CSS classes and attach them via the array syntax -->
  8. <div :class="classes">I got no class :(</div>
  9. <!-- 3) Let the user enter a class (create some example classes) and attach it -->
  10. <div>
  11. <input type="text" v-model="dynamic" placeholder="Enter 'red' or 'blue'">
  12. <div :class="dynamic">Dynamic class</div>
  13. </div>
  14. <!-- 4) Let the user enter a class and enter true/ false for another class (create some example classes) and attach the classes -->
  15. <div>
  16. <input type="text" v-model="dynamicClass" placeholder="Enter class">
  17. <input type="text" v-model="dynamicClassEnabled" placeholder="Do you need this enabled? (true/false)">
  18. <div :class="{ [dynamicClass]: dynamicClassEnabled === 'true' }">An example</div>
  19. </div>
  20. <!-- 5) Repeat 3) but now with values for styles (instead of class names). Attach the respective styles. -->
  21. <div>
  22. <input v-model="fontSize" placeholder="Enter text size(e.g. 15px, 1rem etc.)" type="text">
  23. <div :style="{ fontSize: fontSize }">An example</div>
  24. </div>
  25. <!-- 6) Create a simple progress bar with setInterval and style bindings. Start it by hitting the below button. -->
  26. <div class="progress-bar-section">
  27. <button v-on:click="startProgress">Start Progress</button>
  28. <div class="progress-bar-wrapper">
  29. <div :style="{ width: progress + 'px' }" class="progress-bar"></div>
  30. </div>
  31. </div>
  32. </div>
Add Comment
Please, Sign In to add comment