/Vashisht-Event

GDSC Vashisht 2022 Event

Primary LanguageJavaScript

LangWars

Let's design with code!

You are supposed to recreate the StyleSheet only given an image. You get a points based on how much your output matches with the target and bonus if it is achieved with the lesser code in comparison.


List of Target Images

Try to complete as many images as possible in the given time.


How to submit

Type your code only inside the body tag.

For Example -

<!-- Type your code inside here -->
<body>
    <div></div>
    <style>
        * {
            margin: 0;
        }
        body {
            background: #5d3a3a;
            height: 298px;
            width: 398px;
        }
        div {
            width: 200px;
            height: 200px;
            background: #b5e0ba;
        }
    </style>
</body>

Save the index.html as index{id}.html.

For Example - If your Id is 34, then save your file as index34.html.

DO NOT edit anything outside of the body tag.

DO NOT create another file, make all the changes inside the same index.html file.


Code for getting the Output Image from index.html file

Put all the index.html files into a single folder. In the python file, go to line number 38 and replace the input_path variable with path to your folder that has all the index.html files

input_path = "D:/my_folder/subfolder"

For running the python code, open your cmd terminal,

  • Run pip install -r requirements.txt
  • Then run python Tester.py

This will generate all the output images for you, from the index.html files.

The output for index13.html will be out13.png.


How to use Image Slider

Modify the image path in the img tag by editing the src element. Add the path to both the original image and your modified image in

<img src="D:/my_folder/some_sub_folder/1.png" alt="Original Image">
<span class="cd-image-label" data-type="original">Original</span>

<div class="cd-resize-img"> <!-- the resizable image on top -->
    <img src="D:/my_folder/some_sub_folder/out1.png" alt="Modified Image">
    <span class="cd-image-label" data-type="modified">Modified</span>
</div>

You can slide and check the images to see whether both are matching.