Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Automate Connections with GitHub Actions! #299

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/workflows/issue-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Issue Comment

on:
issues:
types: [opened, closed]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on Issue
uses: actions/github-script@v6
with:
script: |
const issue = context.payload.issue;
const action = context.payload.action;

if (action === 'opened') {
await github.issues.createComment({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you for opening this issue! We will look into it soon.',
});
} else if (action === 'closed') {
await github.issues.createComment({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This issue has been closed. If you have any more questions, feel free to ask!',
});
}
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/workflows/pr-merge-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Merge Comment

on:
pull_request:
types: [closed]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on PR Merge
if: github.event.pull_request.merged == true
uses: actions/github-script@v6
with:
script: |
const pr = context.payload.pull_request;

await github.issues.createComment({
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you for your contribution! Your PR has been merged.',
});
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/workflows/pr-raise-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR Raise Comment

on:
pull_request:
types: [opened]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on PR Raise
uses: actions/github-script@v6
with:
script: |
const pr = context.payload.pull_request;

await github.issues.createComment({
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thanks for raising this PR! We will review it shortly.',
});
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="A simple timer application to track time efficiently." />
<meta name="keywords" content="timer, stopwatch, time tracking" />
<link rel="stylesheet" href=" <link rel="icon" type="image/svg+xml" href="https://www.svgrepo.com/show/123948/timer.svg" />" />
<title>Counter App</title>
counter

<!-- <link rel="stylesheet" href="preloaderStyle.css"> -->

main
</head>
<body>
<button id="scrollToTopBtn" style="display:none;">
Expand Down Expand Up @@ -65,5 +71,12 @@

<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>

<div class="scroll-btn">
<i class="fas fa-arrow-circle-up"></i>
</div>



</body>
</html>
15 changes: 15 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,19 @@ body {
.text-sm {
margin: 0;
}
}

body {
min-height: 500vh;
}
.scroll-btn {
font-size: 3rem;
cursor: pointer;
position: fixed;
bottom: 20px;
right: 20px;
display: none;
}
.scroll-btn:hover {
color: gray;
}
18 changes: 18 additions & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,21 @@ createRoot(document.getElementById("root")).render(
</StrictMode>
);

const scrollBtn = document.querySelector('.scroll-btn') ;


window.addEventListener('scroll', () => {
if(document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
scrollBtn.style.display = 'block' ;
}
else {
scrollBtn.style.display = 'none' ;
}
})
scrollBtn.addEventListener('click' , () => {
window.scroll({
top: 0 ,
behavior: "smooth"
})
})