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

Adding alert message when send button is clicked #439

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0538e1e
Adding alert message when send button is clicked
LimSongWei Aug 9, 2022
f625fbb
Create directory
LimSongWei Sep 3, 2022
5ba7ff8
Delete .github directory
LimSongWei Sep 3, 2022
b65d01b
create directory
LimSongWei Sep 3, 2022
8fee8b3
Delete .github directory
LimSongWei Sep 3, 2022
732d602
Create directory and yml file
LimSongWei Sep 3, 2022
a324095
Update github-actions-demo.yml
LimSongWei Sep 3, 2022
d05af7e
Update and rename github-actions-demo.yml to learn-github-actions.yml
LimSongWei Sep 3, 2022
6ab6200
test
LimSongWei Sep 3, 2022
f04a8b7
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
1f0e6b5
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
240088f
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
f65673d
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
2445208
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
fe46861
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
e1c1585
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
6bedfdb
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
cf13d6d
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
25574bf
test2
LimSongWei Sep 3, 2022
2abeb01
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
749b79a
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
72e1751
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
182c7ff
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
340c2e9
Update learn-github-actions.yml
LimSongWei Sep 3, 2022
8c1f43b
Create codacy-analysis.yaml
LimSongWei Sep 3, 2022
01b6ae9
Update codacy-analysis.yaml
LimSongWei Sep 3, 2022
a46d211
test100
LimSongWei Sep 3, 2022
f84c50a
Update codacy-analysis.yaml
LimSongWei Sep 3, 2022
b65758d
Merge pull request #2 from LimSongWei/LimSongWei-patch-1
LimSongWei Sep 3, 2022
b2fa93d
Rename codacy-analysis.yaml to codacy-static-analysis.yaml
LimSongWei Sep 3, 2022
464d5d4
Update and rename learn-github-actions.yml to Zap-Baseline-Scan.yml
LimSongWei Sep 3, 2022
c05318a
Update Zap-Baseline-Scan.yml
LimSongWei Sep 4, 2022
d272a43
Update index.html
cheeyuannn Sep 4, 2022
4c5c708
Merge pull request #4 from cheeyuannn/patch-2
DHST7988 Sep 4, 2022
4766269
Update style.css
DHST7988 Sep 4, 2022
0376000
Add background-image
DHST7988 Sep 4, 2022
d49cc7e
Added form-container and background in index
DHST7988 Sep 4, 2022
541bb00
Update Zap-Baseline-Scan.yml
LimSongWei Sep 4, 2022
8c95097
Update codacy-static-analysis.yaml
LimSongWei Sep 4, 2022
d297b39
Merge pull request #5 from LimSongWei/Daniel-Heng
DHST7988 Sep 4, 2022
a454722
Update style.css
DHST7988 Sep 4, 2022
1b7647d
Delete background-image.jpg
DHST7988 Sep 4, 2022
d01c489
Update index.html
DHST7988 Sep 4, 2022
4847a62
Update style.css
DHST7988 Sep 4, 2022
b9fa177
Add a background image
DHST7988 Sep 4, 2022
3940515
Update index.html
DHST7988 Sep 4, 2022
1ca51f0
Merge pull request #7 from LimSongWei/Daniel-Heng
LimSongWei Sep 4, 2022
61c3cfe
Johnny
Johnnychuan Sep 4, 2022
4d7cb6d
Merge pull request #9 from LimSongWei/Johnny-Chuan
LimSongWei Sep 4, 2022
2fed86b
Update Zap-Baseline-Scan.yml
DHST7988 Sep 4, 2022
09c2ef6
Update codacy-static-analysis.yaml
LimSongWei Sep 4, 2022
64cc292
Update Zap-Baseline-Scan.yml
DHST7988 Sep 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/Zap-Baseline-Scan.yml
@@ -0,0 +1,27 @@
name: Zap-Baseline-Scan
on:
push:
branches:
- master
- 'Chee-Yuan'
- 'Daniel-Heng'
- 'Johnny-Chuan'
jobs:
check-vulneabilities:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
- name: action-git-diff-suggestions
uses: getsentry/action-git-diff-suggestions@v1
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
target: 'https://www.zaproxy.org'





34 changes: 34 additions & 0 deletions .github/workflows/codacy-static-analysis.yaml
@@ -0,0 +1,34 @@
name: Codacy Static Analysis

on:
push:
branches:
- master
- 'Chee-Yuan'
- 'Daniel-Heng'
- 'Johnny-Chuan'

jobs:
codacy-static-scan:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@master
with:
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@main
with:
sarif_file: results.sarif
Binary file added background-image.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dwyl_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
132 changes: 75 additions & 57 deletions index.html
@@ -1,75 +1,93 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="contact form example">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="contact form example">
<title>Contact Form Example</title>
</head>

<body>
<h2 class="content-head is-center">Contact Us!</h2>
<aside>
<p>
We would <em>love</em> to hear from you! </p>
<p>Please use the <b><em>Contact Form</em></b>
to send us a message.
</p>
</aside>

<!-- START HERE -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Style The Contact Form How Ever You Prefer -->
<link rel="stylesheet" href="style.css">
<body style="background-image: url('background-image.jpg'); background-size: cover;">
<div style="display:inline-block; width: 20%"> </div>
<div class="form-container">
<div class="header">
<img src="dwyl_logo.png" alt="dwyl_logo" />
<h2 class="content-head">Contact Us!</h2>
</div>
<aside>
<p>
We would <em>love</em> to hear from you! </p>
<p>Please use the <b><em>Contact Form</em></b>
to send us a message.
</p>
<p></p>
</aside>

<form class="gform pure-form pure-form-stacked" method="POST" data-email="[email protected]"
action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec">
<!-- change the form action to your script url -->
<!-- START HERE -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Style The Contact Form How Ever You Prefer -->
<link rel="stylesheet" href="style.css">

<div class="form-elements">
<fieldset class="pure-group">
<label for="name">Name: </label>
<input id="name" name="name" placeholder="What your Mom calls you" />
</fieldset>
<form class="gform pure-form pure-form-stacked" method="POST" data-email="[email protected]"
action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec">
<!-- change the form action to your script url -->

<fieldset class="pure-group">
<label for="message">Message: </label>
<textarea id="message" name="message" rows="10"
placeholder="Tell us what's on your mind..."></textarea>
</fieldset>
<div class="form-elements">
<fieldset class="pure-group">
<label for="name">Name: </label>
<input id="name" name="name" placeholder="What your Mom calls you" />
</fieldset>

<fieldset class="pure-group">
<label for="email"><em>Your</em> Email Address:</label>
<input id="email" name="email" type="email" value=""
required placeholder="[email protected]"/>
</fieldset>
<fieldset class="pure-group">
<label for="message">Message: </label>
<textarea id="message" name="message" rows="10" placeholder="Tell us what's on your mind..."></textarea>
</fieldset>

<fieldset class="pure-group">
<label for="color">Favourite Color: </label>
<input id="color" name="color" placeholder="green" />
</fieldset>
<fieldset class="pure-group">
<label for="email"><em>Your</em> Email Address:</label>
<input id="email" name="email" type="email" value="" required placeholder="[email protected]" />
</fieldset>

<fieldset class="pure-group honeypot-field">
<label for="honeypot">To help avoid spam, utilize a Honeypot technique with a hidden text field; must be empty to submit the form! Otherwise, we assume the user is a spam bot.</label>
<input id="honeypot" type="text" name="honeypot" value="" />
</fieldset>
<fieldset class="pure-group">
<label for="color">Favourite Color: </label>
<input id="color" name="color" placeholder="green" />
</fieldset>

<button class="button-success pure-button button-xlarge">
<i class="fa fa-paper-plane"></i>&nbsp;Send</button>
</div>
<fieldset class="pure-group honeypot-field">
<label for="honeypot">To help avoid spam, utilize a Honeypot technique with a hidden text field; must be empty
to submit the form! Otherwise, we assume the user is a spam bot.</label>
<input id="honeypot" type="text" name="honeypot" value="" />
</fieldset>

<!-- Customise the Thankyou Message People See when they submit the form: -->
<div class="thankyou_message" style="display:none;">
<h2><em>Thanks</em> for contacting us!
We will get back to you soon!</h2>
</div>
<button class="button-success pure-button button-xlarge" onclick="checker()">
<i class="fa fa-paper-plane"></i>&nbsp;Send
<span class="tooltiptext">Press this button after confirming all the information has been filled in
correctly.</span>
</button>
</div>

</form>
<!-- Customise the Thankyou Message People See when they submit the form: -->
<div class="thankyou_message" style="display:none;">
<h2><em>Thanks</em> for contacting us!
We will get back to you soon!</h2>
</div>

<!-- Submit the Form to Google Using "AJAX" -->
<script data-cfasync="false" src="form-submission-handler.js"></script>
<!-- END -->
</form>

<!-- Submit the Form to Google Using "AJAX" -->
<script data-cfasync="false" src="form-submission-handler.js"></script>
<script>
function checker() {
var result = confirm('Are you sure?');
if (result = false) {
event.preventDefault();
}
}
</script>
<!-- END -->
</div>
</body>
</html>

</html>
60 changes: 53 additions & 7 deletions style.css
@@ -1,40 +1,86 @@
body {
margin: 2em;
background-color: #44545c;
}

.header img {
float: left;
top: 10px;
width: 60px;
height: 60px;
padding-bottom: 40px;
}

aside {
background: #1f8dd6; /* same color as selected state on site menu */
padding: 0.3em 1em;
border-radius: 3px;
color: #fff;
margin-bottom: 2em;
background: #4dbfa9;
padding: 0.3em 1em;
border-radius: 3px;
color: #fff;
margin-bottom: 2em;
}

textarea {
width: 100%;
}

.content-head {
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0.1em;
margin: 2em 0 1em;
}

.is-center {
text-align: center;
}

.button-success {
color: white;
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
background: rgb(28, 184, 65); /* this is a green */
background: rgb(28, 184, 65);
/* this is a green */
}

.tooltiptext {
visibility: hidden;
background-color: #4dbfa9;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
font-size: 15px;
right: 135px;

/* Position the tooltip */
position: absolute;
z-index: 1;
}

.button-success:hover .tooltiptext {
visibility: visible;
}

.button-xlarge {
font-size: 125%;
}

button {
float: right;
}
#name, #email {

#name,
#email {
width: 50%;
}

.honeypot-field {
display: none;
}

.form-container {
background: rgba(255, 255, 255, 0.8);
width: 700px;
display: inline-block;
padding: 0px 35px 20px 35px;
}