id
stringclasses
20 values
date
timestamp[s]date
2025-05-12 00:00:00
2025-05-12 00:00:00
level
stringclasses
4 values
description
stringlengths
28
5.03k
project
stringclasses
50 values
task-1
2025-05-12T00:00:00
easy
JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.styl' imported by 'common.styl'.
stylus
task-2
2025-05-12T00:00:00
easy
In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to stylus nested variable '$color', all padding/margin value to stylus variables (using computed value) and all border properties to mixins. Use stylus functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.styl' which should be imported by 'common.styl'.
stylus
task-3
2025-05-12T00:00:00
easy
Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.styl' imported by 'common.styl'.
stylus
task-4
2025-05-12T00:00:00
easy
Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'.
stylus
task-5
2025-05-12T00:00:00
easy
Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.styl' imported by 'common.styl'.
stylus
task-6
2025-05-12T00:00:00
moderate
Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.styl' imported by 'common.styl'.
stylus
task-7
2025-05-12T00:00:00
moderate
Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place.
stylus
task-8
2025-05-12T00:00:00
moderate
Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel.
stylus
task-9
2025-05-12T00:00:00
moderate
Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1.
stylus
task-10
2025-05-12T00:00:00
moderate
Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control.
stylus
task-11
2025-05-12T00:00:00
moderate
Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control.
stylus
task-12
2025-05-12T00:00:00
challenging
Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form.
stylus
task-13
2025-05-12T00:00:00
challenging
Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place.
stylus
task-14
2025-05-12T00:00:00
challenging
Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.styl' imported by 'common.styl'.
stylus
task-15
2025-05-12T00:00:00
challenging
Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion.
stylus
task-16
2025-05-12T00:00:00
moderate
Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength.
stylus
task-17
2025-05-12T00:00:00
moderate
A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.
stylus
task-18
2025-05-12T00:00:00
challenging
Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'.
stylus
task-19
2025-05-12T00:00:00
challenging
Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page.
stylus
task-20
2025-05-12T00:00:00
challenging
Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel.
stylus
task-1
2025-05-12T00:00:00
easy
JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form.
survey
task-2
2025-05-12T00:00:00
easy
In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page.
survey
task-3
2025-05-12T00:00:00
easy
Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'.
survey
task-4
2025-05-12T00:00:00
easy
Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'.
survey
task-5
2025-05-12T00:00:00
easy
Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable.
survey
task-6
2025-05-12T00:00:00
moderate
Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place.
survey
task-7
2025-05-12T00:00:00
moderate
Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place.
survey
task-8
2025-05-12T00:00:00
moderate
Class OpenQuestion (file 'common/OpenQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel.
survey
task-9
2025-05-12T00:00:00
moderate
Class RatingQuestion (file 'common/RatingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1.
survey
task-10
2025-05-12T00:00:00
moderate
Class RankingQuestion (file 'common/RankingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control.
survey
task-11
2025-05-12T00:00:00
moderate
Class NpsQuestion (file 'common/NpsQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control.
survey
task-12
2025-05-12T00:00:00
challenging
Class LikertQuestion (file 'common/LikertQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form.
survey
task-13
2025-05-12T00:00:00
challenging
Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place.
survey
task-14
2025-05-12T00:00:00
challenging
Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time.
survey
task-15
2025-05-12T00:00:00
challenging
Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion.
survey
task-16
2025-05-12T00:00:00
moderate
Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength.
survey
task-17
2025-05-12T00:00:00
moderate
A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.
survey
task-18
2025-05-12T00:00:00
challenging
Class DataQuestion (file 'common/DataQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'.
survey
task-19
2025-05-12T00:00:00
challenging
Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page.
survey
task-20
2025-05-12T00:00:00
challenging
Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel.
survey
task-1
2025-05-12T00:00:00
easy
1) Create components/Header.svelte that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.svelte where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.svelte that accepts 'title' and 'detail' as props. Display mock blog data in Main.svelte using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 3) Include Header.svelte and Main.svelte in App.svelte 4) The classname of title in Blog.svelte is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px
svelte
task-2
2025-05-12T00:00:00
easy
1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.svelte, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.svelte with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.svelte occupies the remaining space of Main.svelte. The content of Blog.svelte should be from first item of the mock data.
svelte
task-3
2025-05-12T00:00:00
easy
1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item
svelte
task-4
2025-05-12T00:00:00
easy
1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.svelte to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.svelte.
svelte
task-5
2025-05-12T00:00:00
easy
1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible using onMount.
svelte
task-6
2025-05-12T00:00:00
moderate
1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData.
svelte
task-7
2025-05-12T00:00:00
moderate
1) Create stores/blogStore.ts using Svelte's writable store to manage related state (blog list and selected blog) 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.svelte to show the length of blogs
svelte
task-8
2025-05-12T00:00:00
moderate
1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.svelte. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is appended in stores/blogStore.ts.
svelte
task-9
2025-05-12T00:00:00
moderate
1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.svelte. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is appended in stores/blogStore.ts;
svelte
task-10
2025-05-12T00:00:00
moderate
1) Add a Search.svelte(width: 200px, border-box) component above BlogList.svelte in Main.svelte. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs using derived stores.
svelte
task-11
2025-05-12T00:00:00
challenging
1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\d]{12}', digits in title is random. 2) Ensure the page will not stuck when 100000 blogs appended. 3) Constraint: DO NOT USE any third-party packages, ONLY Svelte APIs can be used to optimize the performance.
svelte
task-12
2025-05-12T00:00:00
challenging
1) Add appealing Comments.svelte with the title 'Comments' at the bottom of Blog.svelte. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create stores/commentStore.ts to implement CommentStore using Svelte's store mechanism, and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize Svelte APIs.
svelte
task-13
2025-05-12T00:00:00
challenging
1) Create components/Tooltip.svelte that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body using Portal. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are allowed.
svelte
task-14
2025-05-12T00:00:00
challenging
1) Enable Markdown text input for blog details. Preview the Markdown in Blog.svelte. 2) Develop a store or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.
svelte
task-15
2025-05-12T00:00:00
challenging
1) Create utils/toast.ts to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.
svelte
task-16
2025-05-12T00:00:00
challenging
1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.
svelte
task-17
2025-05-12T00:00:00
challenging
1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.svelte and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API. Use bind:this instead.
svelte
task-18
2025-05-12T00:00:00
challenging
1) Add pages/Game.svelte with text 'Hello Game'. 2) Add router.ts to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.svelte to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.
svelte
task-19
2025-05-12T00:00:00
challenging
1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\d{1,2}-d\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to show current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.ts to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.
svelte
task-20
2025-05-12T00:00:00
challenging
1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner! ```game White(1,5); Black(14,11); White(11,4); ```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.
svelte
task-1
2025-05-12T00:00:00
challenging
In `index.js`, import `assets/data.js` object `configs`. Each item in `configs` is a `config` object. Do not generate `assets/data.js` which is existed in project.
svg-chart
task-2
2025-05-12T00:00:00
easy
In `common/Chart.js`, `Chart` class contains properties: `svg` (SVG element, id `config.id`, class `chart {config.type}`, viewBox `0 0 100 70`). In `index.js`, For each `config` whose `type` is line, create a `LineChart` instance and append its `svg` to `.root`.
svg-chart
task-3
2025-05-12T00:00:00
easy
In `common/LineChart.js`: - append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them) - append a polyline (class `dataset dataset-${index}`) inside `.datasets` for each `config.data.datasets` item (AKA. `dataset`) - all lines have unique colors - The min and max axis-y values correspond to the min and max values of all `dataset.data`
svg-chart
task-4
2025-05-12T00:00:00
moderate
In `common/Chart.js`, when `options.axes` is true or not defined: - append g element (class `axes axes-x`) inside `svg` and align it to the bottom - append g element (class `axes axes-y`) inside `svg` and align it to the left - append axis-x line (class `axis axis-x`, color gray) inside `.axes-x` and align it to the top - append axis-y line (class `axis axis-y`, color gray) inside `.axes-y` and align it to the right In `common/LineChart.js`, when `options.axes` is true or not defined: - place `.datasets` to the right side of `.axis-y` and above `.axis-x` - reduce `.datasets` lines width and height, and make `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space
svg-chart
task-5
2025-05-12T00:00:00
moderate
In `common/Chart.js`, when `options.axes` is true or not defined: - append axis-x labels (class `label label-{index}`, color black) inside `.axes-x` and align them to the bottom - axis-x labels, coming from `data.labels`, are evenly distributed from left to right, `.label-0` is aligned to the left of `.axes-x` - append axis-y labels (class `label label-{index}`, color black) inside `.axes-y` and align them to the left - The min and max axis-y values correspond to the min and max values of `dataset.data` - 6 axis-y labels, ranging from the min to the max, are evenly distributed across 5 sections from bottom to top, `.label-0` is aligned to the bottom of `.axes-y`
svg-chart
task-6
2025-05-12T00:00:00
moderate
In `common/Chart.js`, when `options.grids` is true or not defined: - append g element (class `grids`) in `svg` - append grid-x lines (each class `grid grid-x grid-x-{index}`, color gray) and grid-y lines (each class `grid grid-y grid-y-{index}`, color gray) in `.grids` - Ensure that `.grids` is placed under `.datasets`, and that its size matches `.datasets` - Each grid-x line is horizontally aligned with axis-x labels - Each grid-y line is vertically aligned with axis-y labels
svg-chart
task-7
2025-05-12T00:00:00
moderate
In `common/Chart.js`, when `options.legends` is true or not defined: - append g element (class `legends`) on the top of `svg` - append g element (class `legend legend-{index}`) in `.legends` - append circle (color is the same as `.dataset` line color) and text (content `dataset.label`) in each `.legend` In `common/Chart.js` and `common/LineChart.js`, when `options.legends` is true or not defined: - reduce `.datasets` lines height - reduce `.axes-y` axis-y height, update axis-y labels position - and make `.legends`, `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space
svg-chart
task-8
2025-05-12T00:00:00
moderate
In `common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`: - append g element (class `points points-{index}`) inside `svg` for each `dataset` - append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data` - each point covers the `.dataset` line, distributes from left to right - each point color is the same as `.dataset` line color
svg-chart
task-9
2025-05-12T00:00:00
moderate
In `common/LineChart.js`, when `options.dataLabels` is true: - append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset` - append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each item of `dataset.data` - each dataLabel is above the `.dataset` line, distributes from left to right - each dataLabel color is the same as `.dataset` line color
svg-chart
task-10
2025-05-12T00:00:00
challenging
In `common/LineChart.js`: - append an initially hidden g element (class `tooltips hidden`) inside `svg` - when mouse hovers over `.datasets` area, display `.tooltips` near the mouse position - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse - in `.tooltips`, show all data from the `.dataset` that corresponds to the selected `.grid-x` - when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)
svg-chart
task-11
2025-05-12T00:00:00
challenging
In `common/LineChart.js`, when `options.lineSmooth` is true: - replace all polylines with smooth curved lines inside `.datasets`
svg-chart
task-12
2025-05-12T00:00:00
moderate
In `common/Chart.js`, when click legend: - show (remove class `hidden`) or hide (add class `hidden`) `.dataset` lines, dataLabels, points
svg-chart
task-13
2025-05-12T00:00:00
challenging
In `common/ScatterChart.js`, class `ScatterChart` inherits from `LineChart`, `ScatterChart`: - options.pointStyle is always circle - options.dataLabels is always true - all `.dataset` lines are hidden Update `index.js`, create `ScatterChart` instances when `config.type` is `scatter`.
svg-chart
task-14
2025-05-12T00:00:00
challenging
In `common/StepChart.js`, class `StepChart` inherits from `LineChart`, `StepChart`: - replace all polylines with step style polylines inside `.datasets` - in each step style polyline: - each `dataset.data` responds to a horizontal line segment whose width is the distance between two near grid-x - the first and the last line segment width is the half - connect all line segments to a step style polyline Update `index.js`, create `StepChart` instances when `config.type` is `step`.
svg-chart
task-15
2025-05-12T00:00:00
challenging
In `common/AreaChart.js`, class `AreaChart` inherits from `LineChart`, `AreaChart`: - append g element (class `areas`) inside `svg` - append polygons (each class `area area-{index}`) inside `.areas` - each `.area` is below the `.dataset` line - each `.area` color is the same as `.dataset` line color, half transparent Update `index.js`, create `AreaChart` instances when `config.type` is `area`.
svg-chart
task-16
2025-05-12T00:00:00
challenging
In `common/BarChart.js`, class `BarChart` inherits from `Chart`, `BarChart`: - there is 1 more grid-x line than LineChart, all the grid-x lines are evenly distributed in `.grids` - append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them) - append g element (class `dataset dataset-${index}`) inside `.datasets` for each `datasets` item - append bars (rect elements, class `bar bar-{index}`) with the same color inside `.dataset` for each `dataset.data` item - bars are distributed within each column enclosed by 2 adjacent grid-x lines - bars in different `.dataset` have unique colors - bars in the same column are evenly distributed Update `index.js`, create `BarChart` instances when `config.type` is `bar`.
svg-chart
task-17
2025-05-12T00:00:00
challenging
In `common/BarChart.js`, when `options.dataLabels` is true: - append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset` - append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item - each dataLabel is above the `.dataset` bars, distributes from left to right - each dataLabel color is the same as `.dataset` bars color
svg-chart
task-18
2025-05-12T00:00:00
challenging
In `common/BarChart.js`: - append an initially hidden g element (class `tooltips hidden`) inside `svg` - when mouse hovers over `.datasets` area, display `.tooltips` near the mouse position - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse - in `.tooltips`, show all data from the `.dataset` that corresponds to the area enclosed by the selected `.grid-x` and next adjacent `.grid-x` - when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)
svg-chart
task-19
2025-05-12T00:00:00
challenging
In `common/PieChart.js`, class `PieChart` inherits from `Chart`, `PieChart`: - append g element (class `datasets`) inside `svg` and make it fill the most area of `svg` - append g element (class `dataset dataset-0`) inside `.datasets` for the first `datasets` item - append sectors (path elements, each class `sector sector-{index}`) with the unique color inside `.dataset` for each `dataset.data` item - all the sectors form a large circle - the area of each sector is related to its proportion of the data Update `index.js`, create `PieChart` instances when `config.type` is `pie`.
svg-chart
task-20
2025-05-12T00:00:00
challenging
In `common/PieChart.js`, when `options.dataLabels` is true: - append g element (class `dataLabels dataLabels-0`) inside `svg` for the first `dataset` - append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item - append connect lines (each class `connect connect-{index}`) inside `.dataLabels` to connect each dataLabel and its corresponding sector - each dataLabel is positioned near its corresponding sector and distributed around the large circle
svg-chart
task-1
2025-05-12T00:00:00
easy
Add svg element (class `system`, viewBox is (0 0 160 160)) in `.root`. `.system` fill the whole space of `.root`. Add defs element (id `systemDefs`) and g element (id `systemRoot`) in `.system`.
svg-solar
task-2
2025-05-12T00:00:00
easy
Import `assets/data.json` as an object `data`. Add a star (class is `data.name`, circle radius is `data.r`, fill is `data.color`) in systemRoot. Its center is system center.
svg-solar
task-3
2025-05-12T00:00:00
easy
Import `assets/data.json` as an object `data` whose `bodies` attribute contains all the planets data. Mark each bodies item as body. Add planet elliptical orbits (svg path, id `orbit_{body.name}`, class `orbit`, no fill, line color is white, line width is 0.1) to systemRoot. Each orbit's center is system center, rx is `body.rx`, ry is `body.ry`. Each orbit path's start point is the right point of the ellipse.
svg-solar
task-4
2025-05-12T00:00:00
easy
Add planets (svg circle, class `planet {body.name}`, fill is `body.color`, radius is `body.r`) to the right point of each orbit.
svg-solar
task-5
2025-05-12T00:00:00
challenging
Define gradient color format:`(linearGradient|radialGradient): offset stop-color stop-opacity[, offset stop-color stop-opacity]...`, `stop-opacity` is optional, default value is 1. When data color is gradient, append systemDefs with a gradient element whose color direction is downward linearGradient or default radialGradient, and children elements attributes come from parsed color values. Replace the fill of star or planet with `url(#gradient-{name})`.
svg-solar
task-6
2025-05-12T00:00:00
moderate
Make all planets revolve around the star along the orbit path with an orbital period of `body.dur` seconds. When the mouse hovers over a planet, stop all planets' revolution; otherwise, restore the revolution.
svg-solar
task-7
2025-05-12T00:00:00
challenging
We call the collection of star and planets as `star-planets` view. Click planet to clear systemRoot and systemDefs, and show planet at system center in systemRoot, all satellites(data from `body.bodies`) and its orbits just like `star-planets`. We call this new collection of planet and satellites as `planet-satellites` view. Make sure the minimal radius of planet is 8 in `planet-satellites`.
svg-solar
task-8
2025-05-12T00:00:00
challenging
Replace the fill of planet or satellites with `url(#gradient-{name})` when necessary. Gradient color format remains the same as before.
svg-solar
task-9
2025-05-12T00:00:00
challenging
Make all satellites revolve around the planet along the orbit path with an orbital period of `dur` seconds. When the mouse hovers over a satellite, stop all satellites' revolution; otherwise, restore the revolution.
svg-solar
task-10
2025-05-12T00:00:00
moderate
Press key 'Escape' in `planet-satellites` to jump to `star-planets`.
svg-solar
task-11
2025-05-12T00:00:00
challenging
Append a detail panel (foreignObject, id `detailPanel`) to the system. Display body type (star/planet/satellite), name and sub-bodies list in detailPanel. By default, show the details of the central body (star or planet). When hovering over a body, update the detailPanel to display its details.
svg-solar
task-12
2025-05-12T00:00:00
challenging
When hovering over the sub-bodies in detailPanel, highlight the body (planet/satellite) stroke and orbit fill in the system, add class `highlight` to the body and orbit.
svg-solar
task-13
2025-05-12T00:00:00
moderate
When clicking the sub-bodies (only planet) in detailPanel, jump to the `planet-satellites` view.
svg-solar
task-14
2025-05-12T00:00:00
challenging
Add planet ring (`use` element, id `ring_{body.name}`) in `star-planets` view when `body.ring` is true. Store ring template in the `symbol` element (id `ring`) which is the direct child of `.system`.
svg-solar
task-15
2025-05-12T00:00:00
challenging
Highlight the body's (planet/satellite) most recent orbital path (AKA tail, class `tail`), with this section accounting for less than 5% of the total orbital circumference.
svg-solar
task-16
2025-05-12T00:00:00
challenging
Append a global config panel (foreignObject, id `configPanel`) to the system. Global `configPanel` is inited once after page loaded. Add a tail checkbox (id `tailEnabled`, default checked) in the config panel. Uncheck it to hide the orbit tail.
svg-solar
task-17
2025-05-12T00:00:00
moderate
Add a orbit checkbox (id `orbitEnabled`, default checked) in the config panel. Uncheck it to hide the orbit.
svg-solar
task-18
2025-05-12T00:00:00
moderate
Add a speed number input (id `speed`, default 1, range is [0.1, 10]) in the config panel. The orbital speed of a body (planet/satellite) is a multiple of `speed` value.
svg-solar
task-19
2025-05-12T00:00:00
moderate
Add a background checkbox (id `bgEnabled`, default unchecked) in the config panel. Check it to display svg image in system (id `bg`, source `assets/bg.png`).
svg-solar
task-20
2025-05-12T00:00:00
challenging
Add a comet button (id `comet`) in the config panel. Keep it clickable only in `star-planets` view. Click it to request comet name by prompt dialog and generate a comet (class `comet`) that follows an elliptical orbit around the Sun, with its aphelion (farthest point) reaching near Neptune's orbit and its perihelion (closest point) near Mercury's orbit. Comet data format is `{type: 'comet', name: 'halley', r: 0.3, rx: 70, ry: 2, dur: 300, color: 'red', bodies: []}`, rx range is [60, 80], ry range is [2, 4], dur range is [200, 400].
svg-solar