4 |
5 |
6 | Knew you would say yes!
7 |
8 |
9 |
10 |
11 |
Knew you would say yes!
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Will You Be My Valentine?
7 |
8 |
9 |
10 |
11 |
Will you be my Valentine?
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/script.js:
--------------------------------------------------------------------------------
1 | const messages = [
2 | "Are you sure?",
3 | "Really sure??",
4 | "Are you positive?",
5 | "Pookie please...",
6 | "Just think about it!",
7 | "If you say no, I will be really sad...",
8 | "I will be very sad...",
9 | "I will be very very very sad...",
10 | "Ok fine, I will stop asking...",
11 | "Just kidding, say yes please! ❤️"
12 | ];
13 |
14 | let messageIndex = 0;
15 |
16 | function handleNoClick() {
17 | const noButton = document.querySelector('.no-button');
18 | const yesButton = document.querySelector('.yes-button');
19 | noButton.textContent = messages[messageIndex];
20 | messageIndex = (messageIndex + 1) % messages.length;
21 | const currentSize = parseFloat(window.getComputedStyle(yesButton).fontSize);
22 | yesButton.style.fontSize = `${currentSize * 1.5}px`;
23 | }
24 |
25 | function handleYesClick() {
26 | window.location.href = "yes_page.html";
27 | }
--------------------------------------------------------------------------------
/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | display: flex;
3 | justify-content: center;
4 | align-items: center;
5 | height: 100vh;
6 | margin: 0;
7 | background-color: #f9e3e3;
8 | font-family: 'Arial', sans-serif;
9 | flex-direction: column;
10 | }
11 |
12 | .container {
13 | text-align: center;
14 | }
15 |
16 | h1 {
17 | font-size: 2.5em;
18 | color: #d32f2f;
19 | }
20 |
21 | .buttons {
22 | margin-top: 20px;
23 | }
24 |
25 | .yes-button {
26 | font-size: 1.5em;
27 | padding: 10px 20px;
28 | margin-right: 10px;
29 | background-color: #4caf50;
30 | color: white;
31 | border: none;
32 | border-radius: 5px;
33 | cursor: pointer;
34 | }
35 |
36 | .no-button {
37 | font-size: 1.5em;
38 | padding: 10px 20px;
39 | background-color: #f44336;
40 | color: white;
41 | border: none;
42 | border-radius: 5px;
43 | cursor: pointer;
44 | }
45 |
46 | .gif_container img {
47 | max-width: 100%;
48 | height: auto;
49 | border-radius: 10px;
50 | margin-top: 20px;
51 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 ivysone
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Will You Be My Valentine? 💌
2 |
3 | This project is designed to be an interactive webpage to ask someone to be your Valentine. Please use this code as inspiration and avoid simply copying it without understanding or giving credit.
4 |
5 | ---
6 |
7 | ## How It Works
8 |
9 | This project consists of a simple webpage with a "Yes" and "No" button. When the user clicks the "No" button, the button text changes to a series of messages, and the "Yes" button grows larger. If the user clicks the "Yes" button, they are redirected to a new page (`yes_page.html`).
10 |
11 | ### Features:
12 | - **Interactive Buttons**: The "No" button cycles through , while the "Yes" button grows in size.
13 | - **Responsive Design**: The webpage is designed to work on all screen sizes.
14 |
15 | ---
16 |
17 | ## How to Use
18 |
19 | 1. **Download the Files**:
20 | - Clone this repository or download the `index.html`, `styles.css`,`yes_style.css`,`yes_page.html` and `script.js` files.
21 |
22 | 2. **Open the Project**:
23 | - Open the `index.html` file in your web browser.
24 |
25 |
26 | ---
27 |
28 | ## A Note on Code Usage
29 |
30 | While I am happy to share this project, I encourage you to use it as inspiration.
31 | If you use this code as a base for your own project, please give credit where it's due. A simple shoutout or link back to this repository is appreciated!
32 |
33 | ---
34 |
35 | ## Code Overview
36 |
37 | ### Files:
38 |
39 | - `index.html`: The main HTML file that structures the webpage.
40 | - `styles.css`: The CSS file that styles the webpage.
41 | - `script.js`: The JavaScript file that handles the button interactions.
42 | - `yes_page.html`: The yes page that sturctures the webpage.
43 | - `yes_style.css`: The css file that styles the yes webpage.
44 |
45 |
46 |
47 | ### Key Functions:
48 |
49 | - `handleNoClick()`: Changes the "No" button text and increases the size of the "Yes" button.
50 | - `handleYesClick()`: Redirects the user to `yes_page.html`.
51 |
52 | ---
53 |
54 | ## License 📄
55 |
56 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
57 |
58 | ---
59 |
60 | Enjoy 💖
61 |
--------------------------------------------------------------------------------