Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Instant download button of the latest release diretly on the website #897

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xItsSunny
Copy link

@xItsSunny xItsSunny commented Jan 15, 2025

can be tested on https://useless-xd.github.io (this will download the latest releases of https://github.com/xItsSunny/Useless-Raven-XD and NOT the latest release of the original Raven XD

Summary by CodeRabbit

  • New Features

    • Updated download links to directly point to the latest Raven XD JAR file
    • Added GitHub repository links to project pages
  • Style

    • Modified CSS styles for .anim and .anim2 classes
    • Adjusted margins and added hover animations for page elements
  • Bug Fixes

    • Corrected HTML attribute casing in some elements

Copy link

coderabbitai bot commented Jan 15, 2025

📝 Walkthrough

Walkthrough

The pull request introduces consistent styling and interactive changes across multiple files. The CSS files (1.css and 2.css) are updated with new .anim2 class and modifications to the .anim class, focusing on margin, width, and hover animations. The HTML files (PC.html and PE.html) are modified to update download links to directly point to the latest Raven XD JAR file and add a new GitHub repository link, improving user accessibility and navigation.

Changes

File Changes
website/css/1.css - Updated .anim class margin to 50px auto
- Added explicit width of 100px to .anim
- Added new .anim2 class with 110px auto margin and 100px width
- Defined hover effects for both classes
website/css/2.css - Updated .anim class margin to 50px auto
- Added explicit width of 100px to .anim
- Added new .anim2 class with 110px auto margin and 100px width
- Defined hover effects for both classes
website/html/PC.html - Updated download link to direct JAR file download
- Added GitHub repository link
website/html/PE.html - Updated download link to direct JAR file download
- Added GitHub repository link
- Corrected HTML class attribute syntax

Sequence Diagram

sequenceDiagram
    participant User
    participant WebPage
    participant GitHub
    
    User->>WebPage: Visits page
    WebPage-->>User: Displays download and GitHub links
    User->>GitHub: Clicks download link
    GitHub-->>User: Provides latest Raven XD JAR
    User->>GitHub: Clicks GitHub link
    GitHub-->>User: Opens Raven XD repository
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or auto anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (3)
website/css/1.css (1)

Line range hint 279-317: Reduce code duplication in animation classes.

The .anim and .anim2 classes share identical properties except for their margin values. This duplication makes maintenance more difficult.

Consider refactoring using a shared class for common properties:

+.anim-base {
+    width: 100px;
+    line-height: 40px;
+    box-shadow: 0px 0px 100px 5px;
+    animation-name: Doff;
+    animation-duration: 1s;
+    animation-direction: alternate;
+}
+
+.anim-base:hover {
+    animation-name: D;
+    animation-duration: 1s;
+    animation-direction: alternate;
+    box-shadow: 0px 0px 100px 5px;
+    width: 200px;
+}
+
 .anim {
+    @extend .anim-base;
     margin: 50px auto;
-    width: 100px;
 }
 
 .anim2 {
+    @extend .anim-base;
     margin: 110px auto;
-    width: 100px;
 }
-
-.anim:hover,
-.anim2:hover {
-    animation-name: D;
-    animation-duration: 1s;
-    animation-direction: alternate;
-    line-height: 40px;
-    box-shadow: 0px 0px 100px 5px;
-    width: 200px;
-}
-
-.anim,
-.anim2 {
-    animation-name: Doff;
-    animation-duration: 1s;
-    animation-direction: alternate;
-    line-height: 40px;
-    box-shadow: 0px 0px 100px 5px;
-    width: 100px;
-}
website/css/2.css (2)

Line range hint 278-314: Consolidate duplicate CSS files.

The same animation classes are defined in both 1.css and 2.css. This creates maintenance overhead and potential for inconsistencies.

Consider:

  1. Consolidating common styles into a shared CSS file
  2. Using separate files only for page-specific styles
  3. Using a CSS preprocessor to manage shared styles through imports

Example structure:

website/css/
  ├── common/
  │   └── animations.css  (shared animation classes)
  ├── pages/
  │   ├── pc.css         (PC-specific styles)
  │   └── pe.css         (PE-specific styles)
  └── main.css           (imports and global styles)

Line range hint 79-79: Add security measures for direct downloads.

Direct JAR downloads without checksum verification could pose security risks.

Consider adding:

  1. SHA-256 checksum display next to download links
  2. HTTPS enforcement in URLs
  3. Subresource Integrity (SRI) hashes for external resources
  4. Security policy headers (Content-Security-Policy, etc.)

Example implementation for checksums:

<div class="download-section">
    <a href="https://github.com/xItsSunny/Useless-Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
    <div class="checksum">
        SHA-256: <span id="jar-checksum">Loading...</span>
        <script>
            // Fetch and display checksum from release API
            fetch('https://api.github.com/repos/xItsSunny/Useless-Raven-XD/releases/latest')
                .then(response => response.json())
                .then(data => {
                    const asset = data.assets.find(a => a.name === 'raven-xd.jar');
                    document.getElementById('jar-checksum').textContent = asset.checksum;
                });
        </script>
    </div>
</div>

Also applies to: 78-78

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23bc333 and b545e76.

📒 Files selected for processing (4)
  • website/css/1.css (3 hunks)
  • website/css/2.css (2 hunks)
  • website/html/PC.html (1 hunks)
  • website/html/PE.html (1 hunks)

Comment on lines +79 to +82
<a href="https://github.com/xia-mc/Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
</div>
<div class="anim2">
<a href="https://github.com/xia-mc/Raven-XD">Github</a>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Repository mismatch with PR objectives.

The download and GitHub repository links point to xia-mc/Raven-XD, but according to the PR objectives, they should point to xItsSunny/Useless-Raven-XD.

Apply this diff to update the repository URLs:

-			<a href="https://github.com/xia-mc/Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
+			<a href="https://github.com/xItsSunny/Useless-Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
-				<a href="https://github.com/xia-mc/Raven-XD">Github</a>
+				<a href="https://github.com/xItsSunny/Useless-Raven-XD">Github</a>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a href="https://github.com/xia-mc/Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
</div>
<div class="anim2">
<a href="https://github.com/xia-mc/Raven-XD">Github</a>
<a href="https://github.com/xItsSunny/Useless-Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
</div>
<div class="anim2">
<a href="https://github.com/xItsSunny/Useless-Raven-XD">Github</a>

Comment on lines +78 to +81
<a href="https://github.com/xia-mc/Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
</div>
<div class="anim2">
<a href="https://github.com/xia-mc/Raven-XD">Github</a>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Repository mismatch with PR objectives.

The download and GitHub repository links point to xia-mc/Raven-XD, but according to the PR objectives, they should point to xItsSunny/Useless-Raven-XD.

Apply this diff to update the repository URLs:

-			<a href="https://github.com/xia-mc/Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
+			<a href="https://github.com/xItsSunny/Useless-Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
-				<a href="https://github.com/xia-mc/Raven-XD">Github</a>
+				<a href="https://github.com/xItsSunny/Useless-Raven-XD">Github</a>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a href="https://github.com/xia-mc/Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
</div>
<div class="anim2">
<a href="https://github.com/xia-mc/Raven-XD">Github</a>
<a href="https://github.com/xItsSunny/Useless-Raven-XD/releases/latest/download/raven-xd.jar">Download</a>
</div>
<div class="anim2">
<a href="https://github.com/xItsSunny/Useless-Raven-XD">Github</a>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant